From 45cee1bd70234347198b9226f2d79c99b6fe27bc Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 9 Nov 2015 13:03:35 +0100 Subject: [PATCH] tests: prefix invocation of ostree with where missing And add a syntax rule to avoid this in future. Fixed by: sed -i -e 's|^ostree |${CMD_PREFIX} ostree |g' tests/*.sh Signed-off-by: Giuseppe Scrivano --- maint.mk | 6 +++ tests/pull-test.sh | 20 ++++----- tests/test-admin-deploy-2.sh | 12 +++--- tests/test-admin-deploy-clean.sh | 8 ++-- tests/test-admin-deploy-karg.sh | 18 ++++---- tests/test-admin-instutil-set-kargs.sh | 16 +++---- tests/test-archivez.sh | 6 +-- tests/test-delta.sh | 58 +++++++++++++------------- tests/test-oldstyle-partial.sh | 4 +- tests/test-pull-commit-only.sh | 4 +- tests/test-pull-depth.sh | 10 ++--- tests/test-pull-metalink.sh | 4 +- tests/test-pull-mirror-summary.sh | 20 ++++----- tests/test-pull-summary-sigs.sh | 20 ++++----- tests/test-repo-checkout-subpath.sh | 4 +- tests/test-xattrs.sh | 6 +-- 16 files changed, 111 insertions(+), 105 deletions(-) diff --git a/maint.mk b/maint.mk index 0c00fd77..3a6c9a88 100644 --- a/maint.mk +++ b/maint.mk @@ -1120,6 +1120,12 @@ sc_copyright_check: halt='out of date copyright in $(texi); update it' \ $(_sc_search_regexp) +sc_missing_cmd_prefix: + @prohibit='^ostree ' \ + halt='found missing ${CMD_PREFIX}' \ + in_vc_files='$tests/.*\.sh$$' \ + $(_sc_search_regexp) + # If tests/help-version exists and seems to be new enough, assume that its # use of init.sh and path_prepend_ is correct, and ensure that every other # use of init.sh is identical. diff --git a/tests/pull-test.sh b/tests/pull-test.sh index f0d70efa..a6da9743 100755 --- a/tests/pull-test.sh +++ b/tests/pull-test.sh @@ -48,7 +48,7 @@ echo "ok pull contents" cd ${test_tmpdir} mkdir mirrorrepo -ostree --repo=mirrorrepo init --mode=archive-z2 +${CMD_PREFIX} ostree --repo=mirrorrepo init --mode=archive-z2 ${CMD_PREFIX} ostree --repo=mirrorrepo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo ${CMD_PREFIX} ostree --repo=mirrorrepo pull --mirror origin main ${CMD_PREFIX} ostree --repo=mirrorrepo fsck @@ -57,7 +57,7 @@ echo "ok pull mirror" cd ${test_tmpdir} mkdir mirrorrepo-local -ostree --repo=mirrorrepo-local init --mode=archive-z2 +${CMD_PREFIX} ostree --repo=mirrorrepo-local init --mode=archive-z2 ${CMD_PREFIX} ostree --repo=mirrorrepo-local remote add --set=gpg-verify=false origin file://$(pwd)/ostree-srv/gnomerepo ${CMD_PREFIX} ostree --repo=mirrorrepo-local pull --mirror origin main ${CMD_PREFIX} ostree --repo=mirrorrepo-local fsck @@ -65,7 +65,7 @@ $OSTREE show main >/dev/null echo "ok pull local mirror" cd ${test_tmpdir} -ostree --repo=ostree-srv/gnomerepo commit -b main -s "Metadata string" --add-detached-metadata-string=SIGNATURE=HANCOCK --tree=ref=main +${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo commit -b main -s "Metadata string" --add-detached-metadata-string=SIGNATURE=HANCOCK --tree=ref=main ${CMD_PREFIX} ostree --repo=repo pull origin main ${CMD_PREFIX} ostree --repo=repo fsck $OSTREE show --print-detached-metadata-key=SIGNATURE main > main-meta @@ -78,19 +78,19 @@ ${CMD_PREFIX} ostree --repo=repo pull origin main ${CMD_PREFIX} ostree --repo=repo fsck # Generate a delta from old to current, even though we aren't going to # use it. -ostree --repo=ostree-srv/gnomerepo static-delta generate main +${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo static-delta generate main rm main-files -rf -ostree --repo=ostree-srv/gnomerepo checkout main main-files +${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo checkout main main-files cd main-files echo "an added file for static deltas" > added-file echo "modified file for static deltas" > baz/cow rm baz/saucer -ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s 'static delta test' +${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s 'static delta test' cd .. rm main-files -rf # Generate delta that we'll use -ostree --repo=ostree-srv/gnomerepo static-delta generate main +${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo static-delta generate main cd ${test_tmpdir} ${CMD_PREFIX} ostree --repo=repo pull origin main @@ -111,7 +111,7 @@ echo "ok static delta" cd ${test_tmpdir} rm main-files -rf -ostree --repo=ostree-srv/gnomerepo checkout main main-files +${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo checkout main main-files cd main-files echo "more added files for static deltas" > added-file2 ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s 'inline static delta test' @@ -138,10 +138,10 @@ cd main-files # Make a file larger than 16M for testing dd if=/dev/zero of=test-bigfile count=1 seek=42678 echo "further modified file for static deltas" > baz/cow -ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s '2nd static delta test' +${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s '2nd static delta test' cd .. rm main-files -rf -ostree --repo=ostree-srv/gnomerepo static-delta generate main +${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo static-delta generate main cd ${test_tmpdir} ${CMD_PREFIX} ostree --repo=repo pull origin main diff --git a/tests/test-admin-deploy-2.sh b/tests/test-admin-deploy-2.sh index db77f6f6..d6117de0 100755 --- a/tests/test-admin-deploy-2.sh +++ b/tests/test-admin-deploy-2.sh @@ -30,11 +30,11 @@ echo "ok setup" echo "1..2" -ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime +${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) export rev # This initial deployment gets kicked off with some kernel arguments -ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime +${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime assert_has_dir sysroot/boot/ostree/testos-${bootcsum} echo "ok deploy command" @@ -42,12 +42,12 @@ echo "ok deploy command" # Commit + upgrade twice, so that we'll rotate out the original deployment bootcsum1=${bootcsum} os_repository_new_commit -ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo testos/buildmaster/x86_64-runtime -ostree admin upgrade --os=testos +${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo testos/buildmaster/x86_64-runtime +${CMD_PREFIX} ostree admin upgrade --os=testos bootcsum2=${bootcsum} os_repository_new_commit "1" bootcsum3=${bootcsum} -ostree admin upgrade --os=testos +${CMD_PREFIX} ostree admin upgrade --os=testos rev=${newrev} newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) @@ -61,7 +61,7 @@ assert_file_has_content sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/os-r echo "ok deploy and GC /boot" -ostree admin cleanup +${CMD_PREFIX} ostree admin cleanup assert_has_dir sysroot/boot/ostree/testos-${bootcsum} assert_file_has_content sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/os-release 'NAME=TestOS' diff --git a/tests/test-admin-deploy-clean.sh b/tests/test-admin-deploy-clean.sh index 5eceaf8b..19f71e61 100644 --- a/tests/test-admin-deploy-clean.sh +++ b/tests/test-admin-deploy-clean.sh @@ -26,12 +26,12 @@ setup_os_repository "archive-z2" "syslinux" echo "1..1" -ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime +${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) export rev -ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime -ostree admin undeploy 0 -ostree --repo=sysroot/ostree/repo refs > refs.txt +${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime +${CMD_PREFIX} ostree admin undeploy 0 +${CMD_PREFIX} ostree --repo=sysroot/ostree/repo refs > refs.txt assert_not_file_has_content refs.txt '^ostree/' echo "ok deploy + undeploy repo prune" diff --git a/tests/test-admin-deploy-karg.sh b/tests/test-admin-deploy-karg.sh index 01e72f05..9decec67 100644 --- a/tests/test-admin-deploy-karg.sh +++ b/tests/test-admin-deploy-karg.sh @@ -30,23 +30,23 @@ echo "ok setup" echo "1..1" -ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime +${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) export rev # This initial deployment gets kicked off with some kernel arguments -ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime -ostree admin deploy --karg=FOO=BAR --os=testos testos:testos/buildmaster/x86_64-runtime -ostree admin deploy --karg=TESTARG=TESTVALUE --os=testos testos:testos/buildmaster/x86_64-runtime +${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime +${CMD_PREFIX} ostree admin deploy --karg=FOO=BAR --os=testos testos:testos/buildmaster/x86_64-runtime +${CMD_PREFIX} ostree admin deploy --karg=TESTARG=TESTVALUE --os=testos testos:testos/buildmaster/x86_64-runtime assert_file_has_content sysroot/boot/loader/entries/ostree-testos-1.conf 'options.*FOO=BAR' assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=BAR' assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*TESTARG=TESTVALUE' -ostree admin deploy --karg=ANOTHERARG=ANOTHERVALUE --os=testos testos:testos/buildmaster/x86_64-runtime +${CMD_PREFIX} ostree admin deploy --karg=ANOTHERARG=ANOTHERVALUE --os=testos testos:testos/buildmaster/x86_64-runtime assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*TESTARG=TESTVALUE' assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*ANOTHERARG=ANOTHERVALUE' echo "ok deploy with --karg, but same config" -ostree admin deploy --karg-proc-cmdline --os=testos testos:testos/buildmaster/x86_64-runtime +${CMD_PREFIX} ostree admin deploy --karg-proc-cmdline --os=testos testos:testos/buildmaster/x86_64-runtime # Here we're asserting that the *host* system has a root= kernel # argument. I think it's unlikely that anyone doesn't have one, but # if this is not true for you, please file a bug! @@ -54,10 +54,10 @@ assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'option echo "ok deploy --karg-proc-cmdline" -ostree admin status -ostree admin undeploy 0 +${CMD_PREFIX} ostree admin status +${CMD_PREFIX} ostree admin undeploy 0 -ostree admin deploy --os=testos --karg-append=APPENDARG=VALAPPEND --karg-append=APPENDARG=2NDAPPEND testos:testos/buildmaster/x86_64-runtime +${CMD_PREFIX} ostree admin deploy --os=testos --karg-append=APPENDARG=VALAPPEND --karg-append=APPENDARG=2NDAPPEND testos:testos/buildmaster/x86_64-runtime assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=BAR' assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*TESTARG=TESTVALUE' assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*APPENDARG=VALAPPEND .*APPENDARG=2NDAPPEND' diff --git a/tests/test-admin-instutil-set-kargs.sh b/tests/test-admin-instutil-set-kargs.sh index b108bd3c..04f98c01 100644 --- a/tests/test-admin-instutil-set-kargs.sh +++ b/tests/test-admin-instutil-set-kargs.sh @@ -31,33 +31,33 @@ echo "ok setup" echo "1..5" -ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime -ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime +${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime +${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime -ostree admin instutil set-kargs FOO=BAR -ostree admin instutil set-kargs FOO=BAZ FOO=BIF TESTARG=TESTVALUE +${CMD_PREFIX} ostree admin instutil set-kargs FOO=BAR +${CMD_PREFIX} ostree admin instutil set-kargs FOO=BAZ FOO=BIF TESTARG=TESTVALUE assert_not_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=BAR' assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=BAZ .*FOO=BIF' assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*TESTARG=TESTVALUE' echo "ok instutil set-kargs (basic)" -ostree admin instutil set-kargs --merge FOO=BAR +${CMD_PREFIX} ostree admin instutil set-kargs --merge FOO=BAR assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=BAZ .*FOO=BIF .*FOO=BAR' assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*TESTARG=TESTVALUE' echo "ok instutil set-kargs --merge" -ostree admin instutil set-kargs --merge --replace=FOO=XXX +${CMD_PREFIX} ostree admin instutil set-kargs --merge --replace=FOO=XXX assert_not_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=BAR' assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=XXX' assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*TESTARG=TESTVALUE' echo "ok instutil set-kargs --replace" -ostree admin instutil set-kargs --merge --append=FOO=BAR --append=APPENDARG=VALAPPEND --append=APPENDARG=2NDAPPEND testos:testos/buildmaster/x86_64-runtime +${CMD_PREFIX} ostree admin instutil set-kargs --merge --append=FOO=BAR --append=APPENDARG=VALAPPEND --append=APPENDARG=2NDAPPEND testos:testos/buildmaster/x86_64-runtime assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=XXX.*FOO=BAR' assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*APPENDARG=VALAPPEND .*APPENDARG=2NDAPPEND' echo "ok instutil set-kargs --append" -ostree admin instutil set-kargs --import-proc-cmdline +${CMD_PREFIX} ostree admin instutil set-kargs --import-proc-cmdline # Here we're asserting that the *host* system has a root= kernel # argument. I think it's unlikely that anyone doesn't have one, but # if this is not true for you, please file a bug! diff --git a/tests/test-archivez.sh b/tests/test-archivez.sh index c228a66e..d5b7fc35 100755 --- a/tests/test-archivez.sh +++ b/tests/test-archivez.sh @@ -32,7 +32,7 @@ cd ${test_tmpdir} mkdir repo2 ${CMD_PREFIX} ostree --repo=repo2 init ${CMD_PREFIX} ostree --repo=repo2 remote add --set=gpg-verify=false aremote file://$(pwd)/repo test2 -ostree --repo=repo2 pull aremote -ostree --repo=repo2 rev-parse aremote/test2 -ostree --repo=repo2 fsck +${CMD_PREFIX} ostree --repo=repo2 pull aremote +${CMD_PREFIX} ostree --repo=repo2 rev-parse aremote/test2 +${CMD_PREFIX} ostree --repo=repo2 fsck echo "ok pull with from file:/// uri" diff --git a/tests/test-delta.sh b/tests/test-delta.sh index ce32a235..2dddefee 100755 --- a/tests/test-delta.sh +++ b/tests/test-delta.sh @@ -27,14 +27,14 @@ morebindatafiles="false ls" echo '1..3' mkdir repo -ostree --repo=repo init --mode=archive-z2 +${CMD_PREFIX} ostree --repo=repo init --mode=archive-z2 mkdir files for bin in ${bindatafiles}; do cp $(which ${bin}) files done -ostree --repo=repo commit -b test -s test --tree=dir=files +${CMD_PREFIX} ostree --repo=repo commit -b test -s test --tree=dir=files function permuteFile() { permutation=$(($1 % 2)) @@ -79,17 +79,17 @@ get_assert_one_direntry_matching() { origrev=$(${CMD_PREFIX} ostree --repo=repo rev-parse test) -ostree --repo=repo static-delta generate --empty --to=${origrev} -ostree --repo=repo static-delta list | grep ${origrev} || exit 1 -ostree --repo=repo prune -ostree --repo=repo static-delta list | grep ${origrev} || exit 1 +${CMD_PREFIX} ostree --repo=repo static-delta generate --empty --to=${origrev} +${CMD_PREFIX} ostree --repo=repo static-delta list | grep ${origrev} || exit 1 +${CMD_PREFIX} ostree --repo=repo prune +${CMD_PREFIX} ostree --repo=repo static-delta list | grep ${origrev} || exit 1 permuteDirectory 1 files -ostree --repo=repo commit -b test -s test --tree=dir=files +${CMD_PREFIX} ostree --repo=repo commit -b test -s test --tree=dir=files newrev=$(${CMD_PREFIX} ostree --repo=repo rev-parse test) -ostree --repo=repo static-delta generate --from=${origrev} --to=${newrev} --inline +${CMD_PREFIX} ostree --repo=repo static-delta generate --from=${origrev} --to=${newrev} --inline deltaprefix=$(get_assert_one_direntry_matching repo/deltas '.') deltadir=$(get_assert_one_direntry_matching repo/deltas/${deltaprefix} '-') @@ -97,16 +97,16 @@ deltadir=$(get_assert_one_direntry_matching repo/deltas/${deltaprefix} '-') assert_has_file repo/deltas/${deltaprefix}/${deltadir}/superblock assert_not_has_file repo/deltas/${deltaprefix}/${deltadir}/0 -ostree --repo=repo static-delta generate --from=${origrev} --to=${newrev} +${CMD_PREFIX} ostree --repo=repo static-delta generate --from=${origrev} --to=${newrev} assert_has_file repo/deltas/${deltaprefix}/${deltadir}/superblock assert_has_file repo/deltas/${deltaprefix}/${deltadir}/0 -ostree --repo=repo static-delta generate --disable-bsdiff --from=${origrev} --to=${newrev} 2>&1 | grep "bsdiff=0 objects" -ostree --repo=repo static-delta generate --max-bsdiff-size=0 --from=${origrev} --to=${newrev} 2>&1 | grep "bsdiff=0 objects" -ostree --repo=repo static-delta generate --max-bsdiff-size=10000 --from=${origrev} --to=${newrev} 2>&1 | grep "bsdiff=[1-9]" +${CMD_PREFIX} ostree --repo=repo static-delta generate --disable-bsdiff --from=${origrev} --to=${newrev} 2>&1 | grep "bsdiff=0 objects" +${CMD_PREFIX} ostree --repo=repo static-delta generate --max-bsdiff-size=0 --from=${origrev} --to=${newrev} 2>&1 | grep "bsdiff=0 objects" +${CMD_PREFIX} ostree --repo=repo static-delta generate --max-bsdiff-size=10000 --from=${origrev} --to=${newrev} 2>&1 | grep "bsdiff=[1-9]" -ostree --repo=repo static-delta list | grep ${origrev}-${newrev} || exit 1 +${CMD_PREFIX} ostree --repo=repo static-delta list | grep ${origrev}-${newrev} || exit 1 if ${CMD_PREFIX} ostree --repo=repo static-delta generate --from=${origrev} --to=${newrev} --empty 2>>err.txt; then assert_not_reached "static-delta generate --from=${origrev} --empty unexpectedly succeeded" @@ -114,38 +114,38 @@ fi echo 'ok generate' -mkdir repo2 && ostree --repo=repo2 init --mode=archive-z2 -ostree --repo=repo2 pull-local repo ${newrev} -ostree --repo=repo2 fsck -ostree --repo=repo2 ls ${newrev} >/dev/null +mkdir repo2 && ${CMD_PREFIX} ostree --repo=repo2 init --mode=archive-z2 +${CMD_PREFIX} ostree --repo=repo2 pull-local repo ${newrev} +${CMD_PREFIX} ostree --repo=repo2 fsck +${CMD_PREFIX} ostree --repo=repo2 ls ${newrev} >/dev/null echo 'ok pull delta' rm repo2 -rf -mkdir repo2 && ostree --repo=repo2 init --mode=bare-user +mkdir repo2 && ${CMD_PREFIX} ostree --repo=repo2 init --mode=bare-user mkdir deltadir deltaprefix=$(get_assert_one_direntry_matching repo/deltas '.') deltadir=$(get_assert_one_direntry_matching repo/deltas/${deltaprefix} '-') -ostree --repo=repo2 pull-local repo ${origrev} -ostree --repo=repo2 ls ${origrev} >/dev/null -ostree --repo=repo2 static-delta apply-offline repo/deltas/${deltaprefix}/${deltadir} -ostree --repo=repo2 fsck -ostree --repo=repo2 ls ${newrev} >/dev/null +${CMD_PREFIX} ostree --repo=repo2 pull-local repo ${origrev} +${CMD_PREFIX} ostree --repo=repo2 ls ${origrev} >/dev/null +${CMD_PREFIX} ostree --repo=repo2 static-delta apply-offline repo/deltas/${deltaprefix}/${deltadir} +${CMD_PREFIX} ostree --repo=repo2 fsck +${CMD_PREFIX} ostree --repo=repo2 ls ${newrev} >/dev/null echo 'ok apply offline' rm -rf repo/deltas/${deltaprefix}/${deltadir}/* -ostree --repo=repo static-delta generate --from=${origrev} --to=${newrev} --inline +${CMD_PREFIX} ostree --repo=repo static-delta generate --from=${origrev} --to=${newrev} --inline assert_not_has_file repo/deltas/${deltaprefix}/${deltadir}/0 rm repo2 -rf mkdir repo2 && ostree --repo=repo2 init --mode=bare-user -ostree --repo=repo2 pull-local repo ${origrev} -ostree --repo=repo2 ls ${origrev} >/dev/null -ostree --repo=repo2 static-delta apply-offline repo/deltas/${deltaprefix}/${deltadir} -ostree --repo=repo2 fsck -ostree --repo=repo2 ls ${newrev} >/dev/null +${CMD_PREFIX} ostree --repo=repo2 pull-local repo ${origrev} +${CMD_PREFIX} ostree --repo=repo2 ls ${origrev} >/dev/null +${CMD_PREFIX} ostree --repo=repo2 static-delta apply-offline repo/deltas/${deltaprefix}/${deltadir} +${CMD_PREFIX} ostree --repo=repo2 fsck +${CMD_PREFIX} ostree --repo=repo2 ls ${newrev} >/dev/null echo 'ok apply offline inline' diff --git a/tests/test-oldstyle-partial.sh b/tests/test-oldstyle-partial.sh index 84460e97..b7da9a86 100644 --- a/tests/test-oldstyle-partial.sh +++ b/tests/test-oldstyle-partial.sh @@ -31,7 +31,7 @@ mkdir repo ${CMD_PREFIX} ostree --repo=repo init ${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo -ostree --repo=repo pull origin main --subpath /baz -ostree fsck --repo=repo >fsck.out +${CMD_PREFIX} ostree --repo=repo pull origin main --subpath /baz +${CMD_PREFIX} ostree fsck --repo=repo >fsck.out assert_file_has_content fsck.out 'Verifying content integrity of 0 commit objects' assert_file_has_content fsck.out '1 partial commits not verified' diff --git a/tests/test-pull-commit-only.sh b/tests/test-pull-commit-only.sh index 1cdc675f..136cc3b9 100755 --- a/tests/test-pull-commit-only.sh +++ b/tests/test-pull-commit-only.sh @@ -30,10 +30,10 @@ mkdir repo ${CMD_PREFIX} ostree --repo=repo init ${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo -ostree --repo=repo pull --commit-metadata-only origin main +${CMD_PREFIX} ostree --repo=repo pull --commit-metadata-only origin main find repo/objects -name '*.commit' | wc -l > commitcount assert_file_has_content commitcount "^1$" -ostree --repo=repo fsck +${CMD_PREFIX} ostree --repo=repo fsck find repo/objects -name '*.file.*' | wc -l > commitcount assert_file_has_content commitcount "^0$" diff --git a/tests/test-pull-depth.sh b/tests/test-pull-depth.sh index 819c1f1e..35191cc4 100644 --- a/tests/test-pull-depth.sh +++ b/tests/test-pull-depth.sh @@ -30,23 +30,23 @@ mkdir repo ${CMD_PREFIX} ostree --repo=repo init ${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo -ostree --repo=repo pull --depth=0 origin main +${CMD_PREFIX} ostree --repo=repo pull --depth=0 origin main find repo/objects -name '*.commit' | wc -l > commitcount assert_file_has_content commitcount "^1$" -ostree --repo=repo pull --depth=0 origin main +${CMD_PREFIX} ostree --repo=repo pull --depth=0 origin main find repo/objects -name '*.commit' | wc -l > commitcount assert_file_has_content commitcount "^1$" -ostree --repo=repo pull --depth=1 origin main +${CMD_PREFIX} ostree --repo=repo pull --depth=1 origin main find repo/objects -name '*.commit' | wc -l > commitcount assert_file_has_content commitcount "^2$" -ostree --repo=repo pull --depth=1 origin main +${CMD_PREFIX} ostree --repo=repo pull --depth=1 origin main find repo/objects -name '*.commit' | wc -l > commitcount assert_file_has_content commitcount "^2$" -ostree --repo=repo pull --depth=-1 origin main +${CMD_PREFIX} ostree --repo=repo pull --depth=-1 origin main find repo/objects -name '*.commit' | wc -l > commitcount assert_file_has_content commitcount "^3$" diff --git a/tests/test-pull-metalink.sh b/tests/test-pull-metalink.sh index 085a72ae..84ef3739 100755 --- a/tests/test-pull-metalink.sh +++ b/tests/test-pull-metalink.sh @@ -27,11 +27,11 @@ setup_fake_remote_repo1 "archive-z2" cd ${test_tmpdir} mkdir metalink-data cd metalink-data -ostree trivial-httpd --autoexit --daemonize -p ${test_tmpdir}/metalink-httpd-port +${CMD_PREFIX} ostree trivial-httpd --autoexit --daemonize -p ${test_tmpdir}/metalink-httpd-port metalink_port=$(cat ${test_tmpdir}/metalink-httpd-port) echo "http://127.0.0.1:${metalink_port}" > ${test_tmpdir}/metalink-httpd-address -ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo summary -u +${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo summary -u summary_path=${test_tmpdir}/ostree-srv/gnomerepo/summary diff --git a/tests/test-pull-mirror-summary.sh b/tests/test-pull-mirror-summary.sh index ff65d4d4..958044f9 100755 --- a/tests/test-pull-mirror-summary.sh +++ b/tests/test-pull-mirror-summary.sh @@ -28,28 +28,28 @@ setup_fake_remote_repo1 "archive-z2" "${COMMIT_SIGN}" mkdir ${test_tmpdir}/ostree-srv/other-files cd ${test_tmpdir}/ostree-srv/other-files echo 'hello world another object' > hello-world -ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit ${COMMIT_SIGN} -b other -s "A commit" -m "Another Commit body" +${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit ${COMMIT_SIGN} -b other -s "A commit" -m "Another Commit body" mkdir ${test_tmpdir}/ostree-srv/yet-other-files cd ${test_tmpdir}/ostree-srv/yet-other-files echo 'hello world yet another object' > yet-another-hello-world -ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit ${COMMIT_SIGN} -b yet-another -s "A commit" -m "Another Commit body" +${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit ${COMMIT_SIGN} -b yet-another -s "A commit" -m "Another Commit body" -ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo summary -u +${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo summary -u prev_dir=`pwd` cd ${test_tmpdir} -ostree --repo=repo init --mode=archive-z2 -ostree --repo=repo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo -ostree --repo=repo pull --mirror origin +${CMD_PREFIX} ostree --repo=repo init --mode=archive-z2 +${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo +${CMD_PREFIX} ostree --repo=repo pull --mirror origin assert_has_file repo/summary -ostree --repo=repo checkout -U main main-copy +${CMD_PREFIX} ostree --repo=repo checkout -U main main-copy assert_file_has_content main-copy/baz/cow "moo" -ostree --repo=repo checkout -U other other-copy +${CMD_PREFIX} ostree --repo=repo checkout -U other other-copy assert_file_has_content other-copy/hello-world "hello world another object" -ostree --repo=repo checkout -U yet-another yet-another-copy +${CMD_PREFIX} ostree --repo=repo checkout -U yet-another yet-another-copy assert_file_has_content yet-another-copy/yet-another-hello-world "hello world yet another object" -ostree --repo=repo fsck +${CMD_PREFIX} ostree --repo=repo fsck rev=$(ostree --repo=repo rev-parse main) find repo/objects -name '*.filez' | while read name; do mode=$(stat -c '%a' "${name}") diff --git a/tests/test-pull-summary-sigs.sh b/tests/test-pull-summary-sigs.sh index b0acf460..eb987c76 100644 --- a/tests/test-pull-summary-sigs.sh +++ b/tests/test-pull-summary-sigs.sh @@ -28,28 +28,28 @@ setup_fake_remote_repo1 "archive-z2" "${COMMIT_SIGN}" mkdir ${test_tmpdir}/ostree-srv/other-files cd ${test_tmpdir}/ostree-srv/other-files echo 'hello world another object' > hello-world -ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit ${COMMIT_SIGN} -b other -s "A commit" -m "Another Commit body" +${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit ${COMMIT_SIGN} -b other -s "A commit" -m "Another Commit body" mkdir ${test_tmpdir}/ostree-srv/yet-other-files cd ${test_tmpdir}/ostree-srv/yet-other-files echo 'hello world yet another object' > yet-another-hello-world -ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit ${COMMIT_SIGN} -b yet-another -s "A commit" -m "Another Commit body" +${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit ${COMMIT_SIGN} -b yet-another -s "A commit" -m "Another Commit body" -ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo summary -u +${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo summary -u prev_dir=`pwd` cd ${test_tmpdir} -ostree --repo=repo init --mode=archive-z2 -ostree --repo=repo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo -ostree --repo=repo pull --mirror origin +${CMD_PREFIX} ostree --repo=repo init --mode=archive-z2 +${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo +${CMD_PREFIX} ostree --repo=repo pull --mirror origin assert_has_file repo/summary -ostree --repo=repo checkout -U main main-copy +${CMD_PREFIX} ostree --repo=repo checkout -U main main-copy assert_file_has_content main-copy/baz/cow "moo" -ostree --repo=repo checkout -U other other-copy +${CMD_PREFIX} ostree --repo=repo checkout -U other other-copy assert_file_has_content other-copy/hello-world "hello world another object" -ostree --repo=repo checkout -U yet-another yet-another-copy +${CMD_PREFIX} ostree --repo=repo checkout -U yet-another yet-another-copy assert_file_has_content yet-another-copy/yet-another-hello-world "hello world yet another object" -ostree --repo=repo fsck +${CMD_PREFIX} ostree --repo=repo fsck echo "ok pull mirror summary" if ! ${CMD_PREFIX} ostree --version | grep -q -e '\+gpgme'; then diff --git a/tests/test-repo-checkout-subpath.sh b/tests/test-repo-checkout-subpath.sh index db21fef7..343b2614 100755 --- a/tests/test-repo-checkout-subpath.sh +++ b/tests/test-repo-checkout-subpath.sh @@ -29,6 +29,6 @@ echo '1..2' repopath=${test_tmpdir}/ostree-srv/gnomerepo -ostree --repo=repo checkout -U --subpath=/ test2 checkedout +${CMD_PREFIX} ostree --repo=repo checkout -U --subpath=/ test2 checkedout -ostree --repo=repo checkout -U --subpath=/firstfile test2 checkedout2 +${CMD_PREFIX} ostree --repo=repo checkout -U --subpath=/firstfile test2 checkedout2 diff --git a/tests/test-xattrs.sh b/tests/test-xattrs.sh index 6c19592b..b95707e2 100755 --- a/tests/test-xattrs.sh +++ b/tests/test-xattrs.sh @@ -31,14 +31,14 @@ echo "1..2" setup_test_repository "archive-z2" cd ${test_tmpdir} -ostree --repo=repo checkout test2 test2-checkout1 +${CMD_PREFIX} ostree --repo=repo checkout test2 test2-checkout1 setfattr -n user.ostree-test -v testvalue test2-checkout1/firstfile setfattr -n user.test0 -v moo test2-checkout1/firstfile -ostree --repo=repo commit -b test2 -s xattrs --tree=dir=test2-checkout1 +${CMD_PREFIX} ostree --repo=repo commit -b test2 -s xattrs --tree=dir=test2-checkout1 rm test2-checkout1 -rf echo "ok commit with xattrs" -ostree --repo=repo checkout test2 test2-checkout2 +${CMD_PREFIX} ostree --repo=repo checkout test2 test2-checkout2 getfattr -m . test2-checkout2/firstfile > attrs assert_file_has_content attrs '^user.ostree-test' assert_file_has_content attrs '^user.test0'