summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2015-06-29 13:35:07 -0400
committerColin Walters <walters@verbum.org>2015-06-29 13:35:07 -0400
commit530631376ea4492c18c76de8e28c4ef08c4db906 (patch)
tree75bfc339d13683941523b0ef31b5206059d78590
parentc8c239f94c9bbe41c959ac448a7a2ca2babf9013 (diff)
downloadostree-530631376ea4492c18c76de8e28c4ef08c4db906.tar.gz
tests: Check error messages instead of "expected-fail", handle old parallel
-rwxr-xr-xtests/basic-test.sh7
-rw-r--r--tests/test-admin-locking.sh7
-rwxr-xr-xtests/test-pull-mirror-summary.sh5
3 files changed, 13 insertions, 6 deletions
diff --git a/tests/basic-test.sh b/tests/basic-test.sh
index 2fea4e03..927764f6 100755
--- a/tests/basic-test.sh
+++ b/tests/basic-test.sh
@@ -204,9 +204,10 @@ ${CMD_PREFIX} ostree --repo=shadow-repo checkout "${parent_rev_test2}" test2-che
echo "ok checkout from shadow repo"
cd ${test_tmpdir}
-rm -f expected-fail
-$OSTREE checkout test2 --subpath /enoent 2>/dev/null || touch expected-fail
-assert_has_file expected-fail
+if $OSTREE checkout test2 --subpath /enoent 2>err.txt; then
+ assert_not_reached "checking outnonexistent file unexpectedly succeeded!"
+fi
+assert_file_has_content err.txt 'No such file or directory'
echo "ok subdir enoent"
cd ${test_tmpdir}
diff --git a/tests/test-admin-locking.sh b/tests/test-admin-locking.sh
index b6cd7bd9..e416fe78 100644
--- a/tests/test-admin-locking.sh
+++ b/tests/test-admin-locking.sh
@@ -39,8 +39,13 @@ echo "rev=${rev}"
${CMD_PREFIX} ostree admin --sysroot=sysroot deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime
assert_has_dir sysroot/boot/ostree/testos-${bootcsum}
+parallel_cmd=parallel
+if parallel --help | grep -q -e --no-notice; then
+ parallel_cmd="${parallel_cmd} --no-notice"
+fi
+
count=$(($(getconf _NPROCESSORS_ONLN) * 2))
-seq "${count}" | parallel --no-notice -n0 ${CMD_PREFIX} ostree admin --sysroot=sysroot deploy --retain --os=testos testos:testos/buildmaster/x86_64-runtime
+seq "${count}" | ${parallel_cmd} -n0 ${CMD_PREFIX} ostree admin --sysroot=sysroot deploy --retain --os=testos testos:testos/buildmaster/x86_64-runtime
${CMD_PREFIX} ostree admin --sysroot=sysroot status > status.txt
grep "testos ${rev}" status.txt | wc -l > status-matches.txt
diff --git a/tests/test-pull-mirror-summary.sh b/tests/test-pull-mirror-summary.sh
index dfb3f20d..5c639a7f 100755
--- a/tests/test-pull-mirror-summary.sh
+++ b/tests/test-pull-mirror-summary.sh
@@ -70,8 +70,9 @@ rm -rf repo
mkdir repo
${OSTREE} --repo=repo init --mode=archive-z2
${OSTREE} --repo=repo remote add --set=gpg-verify-summary=true origin $(cat httpd-address)/ostree/gnomerepo
-${OSTREE} --repo=repo pull --mirror origin 2>/dev/null || touch expected-fail
-assert_has_file expected-fail
+if ${OSTREE} --repo=repo pull --mirror origin 2>err.txt; then
+ assert_not_reached "Mirroring unexpectedly succeeded"
+fi
echo "ok pull mirror without signed summary"
${OSTREE} --repo=${test_tmpdir}/ostree-srv/gnomerepo summary -u ${COMMIT_SIGN}