Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
because depsolve accepts NEVRA we only make a sanity test here. Depsolving the example recipes will be done when testing bdcs-cli because it has the notion of reading recipes.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
# Note: execute from the project root directory | ||
|
||
set -x | ||
|
||
DEPSOLVE="./dist/build/depsolve/depsolve" | ||
|
||
# when executed without parameters shows usage | ||
if [[ `$DEPSOLVE` != "Usage: depsolve metadata.db NEVRA [NEVRA ...]" ]]; then | ||
exit 1 | ||
fi | ||
|
||
# when executed with non-existing DB returns non-zero | ||
$DEPSOLVE /tmp/none.db httpd | ||
if [[ $? == 0 ]]; then | ||
echo "FAIL: Return code is zero" | ||
exit 1 | ||
fi | ||
|
||
### Prepare for testing depsolve against recipes | ||
|
||
METADATA_DB="metadata.db" | ||
[ -f "$METADATA_DB" ] || curl https://s3.amazonaws.com/weldr/metadata.db > "$METADATA_DB" | ||
|
||
# when called with correct parameters | ||
# then output contains input nevra | ||
# and the return code is 0 | ||
OUTPUT=`$DEPSOLVE $METADATA_DB httpd-2.4.6-45.el7.centos.x86_64` | ||
if [[ $? != 0 ]]; then | ||
echo "FAIL: Return code is not zero" | ||
exit 1 | ||
fi | ||
|
||
echo "$OUTPUT" | grep httpd-2.4.6-45.el7.centos.x86_64 | ||
if [ $? != 0 ]; then | ||
echo "FAIL: httpd not included in depsolved list" | ||
exit 1 | ||
fi |