[ostree] tests: Check error messages instead of "expected-fail", handle old parallel



commit 530631376ea4492c18c76de8e28c4ef08c4db906
Author: Colin Walters <walters verbum org>
Date:   Mon Jun 29 13:35:07 2015 -0400

    tests: Check error messages instead of "expected-fail", handle old parallel

 tests/basic-test.sh               |    7 ++++---
 tests/test-admin-locking.sh       |    7 ++++++-
 tests/test-pull-mirror-summary.sh |    5 +++--
 3 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/tests/basic-test.sh b/tests/basic-test.sh
index 2fea4e0..927764f 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 b6cd7bd..e416fe7 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 dfb3f20..5c639a7 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}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]