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

This commit is contained in:
Colin Walters 2015-06-29 13:35:07 -04:00
parent c8c239f94c
commit 530631376e
3 changed files with 13 additions and 6 deletions

View File

@ -204,9 +204,10 @@ ${CMD_PREFIX} ostree --repo=shadow-repo checkout "${parent_rev_test2}" test2-che
echo "ok checkout from shadow repo" echo "ok checkout from shadow repo"
cd ${test_tmpdir} cd ${test_tmpdir}
rm -f expected-fail if $OSTREE checkout test2 --subpath /enoent 2>err.txt; then
$OSTREE checkout test2 --subpath /enoent 2>/dev/null || touch expected-fail assert_not_reached "checking outnonexistent file unexpectedly succeeded!"
assert_has_file expected-fail fi
assert_file_has_content err.txt 'No such file or directory'
echo "ok subdir enoent" echo "ok subdir enoent"
cd ${test_tmpdir} cd ${test_tmpdir}

View File

@ -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 ${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} 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)) 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 ${CMD_PREFIX} ostree admin --sysroot=sysroot status > status.txt
grep "testos ${rev}" status.txt | wc -l > status-matches.txt grep "testos ${rev}" status.txt | wc -l > status-matches.txt

View File

@ -70,8 +70,9 @@ rm -rf repo
mkdir repo mkdir repo
${OSTREE} --repo=repo init --mode=archive-z2 ${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 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 if ${OSTREE} --repo=repo pull --mirror origin 2>err.txt; then
assert_has_file expected-fail assert_not_reached "Mirroring unexpectedly succeeded"
fi
echo "ok pull mirror without signed summary" echo "ok pull mirror without signed summary"
${OSTREE} --repo=${test_tmpdir}/ostree-srv/gnomerepo summary -u ${COMMIT_SIGN} ${OSTREE} --repo=${test_tmpdir}/ostree-srv/gnomerepo summary -u ${COMMIT_SIGN}