diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-03-10 00:59:44 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-03-16 18:01:54 +0100 |
commit | 25b86db159fbc3c043628e285c0c1ef24dec2c6e (patch) | |
tree | eee3860a1a0ff542959db83dcf8e7ffafad91bf1 /test/integration/framework | |
parent | b209edfa318e89df31a2dcae82c3d72b48c1e77f (diff) |
test exitcode as well as string equality
We use test{success,failure} now all over the place in the framework, so
its only consequencial to do this in the situations in which we test for
a specific output as well.
Git-Dch: Ignore
Diffstat (limited to 'test/integration/framework')
-rw-r--r-- | test/integration/framework | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/test/integration/framework b/test/integration/framework index 5f13df1c0..ec23e41e6 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -1338,7 +1338,7 @@ testwarning() { else msgtest 'Test for successful execution with warnings of' "$*" fi - local OUTPUT="${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output" + local OUTPUT="${TMPWORKINGDIRECTORY}/rootdir/tmp/testwarning.output" if "$@" >${OUTPUT} 2>&1; then if expr match "$1" '^apt.*' >/dev/null; then if grep -q -E ' runtime error: ' "$OUTPUT"; then @@ -1388,6 +1388,26 @@ testfailure() { aptautotest 'testfailure' "$@" } +testsuccessequal() { + local CMP="$1" + shift + testsuccess "$@" + testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output" "$CMP" +} +testwarningequal() { + local CMP="$1" + shift + testwarning "$@" + testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/testwarning.output" "$CMP" +} +testfailureequal() { + local CMP="$1" + shift + testfailure "$@" + testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailure.output" "$CMP" +} + + testfilestats() { msgtest "Test that file $1 has $2 $3" "$4" if [ "$4" "$3" "$(stat --format "$2" "$1")" ]; then @@ -1493,7 +1513,7 @@ aptautotest_apt_update() { aptautotest_aptget_update "$@"; } testaptautotestnodpkgwarning() { local TESTCALL="$1" while [ -n "$2" ]; do - if [ "$2" = '-s' ]; then return; fi + if expr match "$2" '^-[a-z]*s' >/dev/null 2>&1; then return; fi shift done testfailure grep '^dpkg: warning:.*ignor.*' "${TMPWORKINGDIRECTORY}/rootdir/tmp-before/${TESTCALL}.output" |