diff options
author | Colin Walters <walters@verbum.org> | 2021-09-10 17:07:42 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2021-09-10 17:07:42 -0400 |
commit | bc30806c6edc005de9fe32dd645ed9a13469796f (patch) | |
tree | 43ce6c497c80377405e03e0558acfd843fa2ffb7 /tests/test-admin-deploy-etcmerge-cornercases.sh | |
parent | 213b8608ea579b6cd0fb4140e9689fc814f36c26 (diff) | |
download | ostree-bc30806c6edc005de9fe32dd645ed9a13469796f.tar.gz |
tests: Add new TAP APIs
Having to touch a global test counter when adding tests is
a recipe for conflicts between PRs.
The TAP protocol allows *ending* with the expected number of
tests, so the best way to do this is to have an explicit
API like our `tap_ok` which bumps a counter, then end with `tap_end`.
I ported one test as a demo.
Diffstat (limited to 'tests/test-admin-deploy-etcmerge-cornercases.sh')
-rwxr-xr-x | tests/test-admin-deploy-etcmerge-cornercases.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test-admin-deploy-etcmerge-cornercases.sh b/tests/test-admin-deploy-etcmerge-cornercases.sh index 4f55bc3a..98e2bbe6 100755 --- a/tests/test-admin-deploy-etcmerge-cornercases.sh +++ b/tests/test-admin-deploy-etcmerge-cornercases.sh @@ -26,8 +26,6 @@ set -euo pipefail # Exports OSTREE_SYSROOT so --sysroot not needed. setup_os_repository "archive" "syslinux" -echo "1..2" - ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime) export rev @@ -89,7 +87,7 @@ test -L ${newetc}/a/link-to-no-such-file || assert_not_reached "should have syml assert_has_dir ${newroot}/usr/etc/testdirectory assert_not_has_dir ${newetc}/testdirectory -echo "ok" +tap_ok first # Add /etc/initially-empty cd "${test_tmpdir}/osdata" @@ -141,4 +139,6 @@ assert_not_has_file sysroot/ostree/deploy/testos/deploy/${rev}.0/usr/etc/initial assert_has_file sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/initially-empty/mynewfile rm ${newconfpath} -echo "ok" +tap_ok second + +tap_end |