From dd6844a61ef7b82e656481d6ddd1389012ab3fb9 Mon Sep 17 00:00:00 2001 From: Matthew Leeds Date: Mon, 1 Apr 2019 19:01:49 -0700 Subject: [PATCH] tests: Escape periods when appropriate Don't match any character in a regular expression when we only want to match a period. Closes: #1834 Approved by: rfairley --- tests/admin-test.sh | 4 +- tests/basic-test.sh | 2 +- .../installed/destructive/itest-bare-root.sh | 10 +- .../nondestructive/itest-bare-user-root.sh | 4 +- tests/pull-test2.sh | 2 +- tests/test-admin-pull-deploy-split.sh | 4 +- tests/test-config.sh | 4 +- tests/test-create-usb.sh | 24 ++-- tests/test-find-remotes.sh | 108 +++++++++--------- tests/test-fsck-collections.sh | 40 +++---- tests/test-init-collections.sh | 2 +- tests/test-no-initramfs.sh | 2 +- tests/test-pull-summary-sigs.sh | 2 +- tests/test-refs-collections.sh | 20 ++-- tests/test-remote-add.sh | 14 +-- tests/test-repo-finder-mount-integration.sh | 14 +-- tests/test-summary-collections.sh | 16 +-- tests/test-summary-update.sh | 6 +- tests/test-xattrs.sh | 4 +- 19 files changed, 141 insertions(+), 141 deletions(-) diff --git a/tests/admin-test.sh b/tests/admin-test.sh index 79a23f59..31e969c2 100644 --- a/tests/admin-test.sh +++ b/tests/admin-test.sh @@ -60,7 +60,7 @@ validate_bootloader echo "ok deploy command" ${CMD_PREFIX} ostree admin --print-current-dir > curdir -assert_file_has_content curdir ^`pwd`/sysroot/ostree/deploy/testos/deploy/${rev}.0$ +assert_file_has_content curdir ^`pwd`/sysroot/ostree/deploy/testos/deploy/${rev}\.0$ echo "ok --print-current-dir" @@ -239,7 +239,7 @@ cp ${originfile} saved-origin ${CMD_PREFIX} ostree admin set-origin --index=0 bacon --set=gpg-verify=false http://tasty.com assert_file_has_content "${originfile}" "bacon:testos/buildmaster/x86_64-runtime" ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote list -u > remotes.txt -assert_file_has_content remotes.txt 'bacon.*http://tasty.com' +assert_file_has_content remotes.txt 'bacon.*http://tasty\.com' cp saved-origin ${originfile} validate_bootloader diff --git a/tests/basic-test.sh b/tests/basic-test.sh index 0c80a5f5..ba88cc73 100644 --- a/tests/basic-test.sh +++ b/tests/basic-test.sh @@ -245,7 +245,7 @@ EOF $OSTREE commit ${COMMIT_ARGS} -b branch-with-commitmsg -F commitmsg.txt -s 'a message' $test_tmpdir/checkout-test2-4 $OSTREE log branch-with-commitmsg > log.txt assert_file_has_content log.txt '^ *This is a long$' -assert_file_has_content log.txt '^ *Build-Host:.*example.com$' +assert_file_has_content log.txt '^ *Build-Host:.*example\.com$' assert_file_has_content log.txt '^ *Crunchy-With.*true$' $OSTREE refs --delete branch-with-commitmsg echo "ok commit body file" diff --git a/tests/installed/destructive/itest-bare-root.sh b/tests/installed/destructive/itest-bare-root.sh index 3a5302ee..18a3931f 100755 --- a/tests/installed/destructive/itest-bare-root.sh +++ b/tests/installed/destructive/itest-bare-root.sh @@ -25,17 +25,17 @@ setfattr -n security.crunchy -v withketchup co/usr/bin csum=$(ostree commit -b testref --link-checkout-speedup --tree=dir=co) ostree fsck ostree ls -X testref ${victim_symlink} > ls.txt -assert_file_has_content ls.txt 'security.biometric' +assert_file_has_content ls.txt 'security\.biometric' ostree ls -X ${host_refspec} ${victim_symlink} > ls.txt -assert_not_file_has_content ls.txt security.biometric +assert_not_file_has_content ls.txt security\.biometric ostree ls -X testref usr/bin > ls.txt -assert_file_has_content ls.txt 'security.crunchy' +assert_file_has_content ls.txt 'security\.crunchy' ostree checkout -H testref co-testref getfattr -n security.biometric co-testref/${victim_symlink} > xattr.txt -assert_file_has_content xattr.txt 'security.biometric="iris"' +assert_file_has_content xattr.txt 'security\.biometric="iris"' getfattr -n security.crunchy co-testref/usr/bin > xattr.txt -assert_file_has_content xattr.txt 'security.crunchy="withketchup"' +assert_file_has_content xattr.txt 'security\.crunchy="withketchup"' rm co -rf rm co-testref -rf diff --git a/tests/installed/nondestructive/itest-bare-user-root.sh b/tests/installed/nondestructive/itest-bare-user-root.sh index 40722384..9e04f7bc 100755 --- a/tests/installed/nondestructive/itest-bare-user-root.sh +++ b/tests/installed/nondestructive/itest-bare-user-root.sh @@ -35,7 +35,7 @@ ostree --repo=repo commit --selinux-policy / -b rootfs --link-checkout-speedup - ostree --repo=repo ls rootfs /usr/bin/systemd >ls.txt assert_file_has_content ls.txt '^-007.. 0 0 .*/usr/bin/systemd' ostree --repo=repo ls -X rootfs /usr/lib/dbus-daemon-helper >ls.txt -assert_file_has_content ls.txt '^-007.. 0 81 .*security.selinux.*/usr/lib/dbus-daemon-helper' -assert_not_file_has_content ls.txt 'user.ostreemeta' +assert_file_has_content ls.txt '^-007.. 0 81 .*security\.selinux.*/usr/lib/dbus-daemon-helper' +assert_not_file_has_content ls.txt 'user\.ostreemeta' echo "ok bare-user link-checkout-speedup with modified xattrs maintains uids" date diff --git a/tests/pull-test2.sh b/tests/pull-test2.sh index 1d91e514..064bbfe6 100644 --- a/tests/pull-test2.sh +++ b/tests/pull-test2.sh @@ -55,7 +55,7 @@ ${CMD_PREFIX} ostree --repo=ostree-srv/repo static-delta generate ${remote_ref} ${CMD_PREFIX} ostree --repo=ostree-srv/repo summary -u ${CMD_PREFIX} ostree --repo=repo pull origin ${remote_ref}@${prev_rev} ${CMD_PREFIX} ostree --repo=repo pull --dry-run --require-static-deltas origin ${remote_ref} >dry-run-pull.txt -assert_file_has_content dry-run-pull.txt 'Delta update: 0/1 parts, 0 bytes/[45][0-9].[0-9][  ]kB, 1.[678][  ]MB total uncompressed' +assert_file_has_content dry-run-pull.txt 'Delta update: 0/1 parts, 0 bytes/[45][0-9]\.[0-9][  ]kB, 1\.[678][  ]MB total uncompressed' ${CMD_PREFIX} ostree --repo=repo pull --require-static-deltas origin ${remote_ref} final_rev=$(${CMD_PREFIX} ostree --repo=repo rev-parse origin:${remote_ref}) assert_streq "${rev}" "${final_rev}" diff --git a/tests/test-admin-pull-deploy-split.sh b/tests/test-admin-pull-deploy-split.sh index 5e38d6fa..1196368d 100755 --- a/tests/test-admin-pull-deploy-split.sh +++ b/tests/test-admin-pull-deploy-split.sh @@ -46,13 +46,13 @@ ${CMD_PREFIX} ostree admin upgrade --os=testos --pull-only --os=testos > out.txt assert_not_file_has_content out.txt 'No update available' assert_has_dir sysroot/ostree/deploy/testos/deploy/${parent_rev}.0 assert_not_has_dir sysroot/ostree/deploy/testos/deploy/${rev}.0 -assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'TestOS 42 1.0.9' +assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'TestOS 42 1\.0\.9' assert_streq "${rev}" $(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) # Now, generate new content upstream; we shouldn't pull it os_repository_new_commit ${CMD_PREFIX} ostree admin upgrade --os=testos --deploy-only --os=testos > out.txt assert_not_file_has_content out.txt 'No update available' -assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'TestOS 42 1.0.10' +assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'TestOS 42 1\.0\.10' assert_has_dir sysroot/ostree/deploy/testos/deploy/${parent_rev}.0 assert_has_dir sysroot/ostree/deploy/testos/deploy/${rev}.0 ${CMD_PREFIX} ostree admin upgrade --os=testos --deploy-only --os=testos > out.txt diff --git a/tests/test-config.sh b/tests/test-config.sh index 3499de7a..483cff41 100755 --- a/tests/test-config.sh +++ b/tests/test-config.sh @@ -40,7 +40,7 @@ assert_file_has_content list.txt "bare" assert_file_has_content list.txt "1" assert_file_has_content list.txt "Flathub" assert_file_has_content list.txt "true" -assert_file_has_content list.txt "http://example.com/ostree/repo/" +assert_file_has_content list.txt "http://example\.com/ostree/repo/" # Check that it errors out if too many arguments are given if ${CMD_PREFIX} ostree config --repo=repo get --group=core lock-timeout-secs extra 2>err.txt; then @@ -57,7 +57,7 @@ ${CMD_PREFIX} ostree config --repo=repo set --group='remote "org.mozilla.Firefox assert_file_has_content repo/config "bare-user-only" assert_file_has_content repo/config "Nightly Flathub" assert_file_has_content repo/config "false" -assert_file_has_content repo/config "http://example.com/ostree/" +assert_file_has_content repo/config "http://example\.com/ostree/" # Check that it errors out if too many arguments are given if ${CMD_PREFIX} ostree config --repo=repo set --group=core lock-timeout-secs 120 extra 2>err.txt; then diff --git a/tests/test-create-usb.sh b/tests/test-create-usb.sh index 392352fd..8040ed9c 100755 --- a/tests/test-create-usb.sh +++ b/tests/test-create-usb.sh @@ -56,9 +56,9 @@ ${CMD_PREFIX} ostree --repo=local-repo create-usb dest-mount1 org.example.Collec assert_has_dir dest-mount1/.ostree/repo ${CMD_PREFIX} ostree --repo=dest-mount1/.ostree/repo refs --collections > dest-refs -assert_file_has_content dest-refs "^(org.example.Collection1, test-1)$" -assert_file_has_content dest-refs "^(org.example.Collection1, test-2)$" -assert_not_file_has_content dest-refs "^(org.example.Collection1, test-3)$" +assert_file_has_content dest-refs "^(org\.example\.Collection1, test-1)$" +assert_file_has_content dest-refs "^(org\.example\.Collection1, test-2)$" +assert_not_file_has_content dest-refs "^(org\.example\.Collection1, test-3)$" assert_has_file dest-mount1/.ostree/repo/summary echo "ok 1 simple usb" @@ -83,7 +83,7 @@ ${CMD_PREFIX} ostree --repo=local-repo create-usb --destination-repo some-dest d assert_has_dir "dest-mount3/some-dest" assert_symlink_has_content "dest-mount3/.ostree/repos.d/00-generated" "/some-dest$" ${CMD_PREFIX} ostree --repo=dest-mount3/.ostree/repos.d/00-generated refs --collections > dest-refs -assert_file_has_content dest-refs "^(org.example.Collection1, test-1)$" +assert_file_has_content dest-refs "^(org\.example\.Collection1, test-1)$" assert_has_file dest-mount3/.ostree/repos.d/00-generated/summary echo "ok 3 usb in non-standard location" @@ -93,13 +93,13 @@ ${CMD_PREFIX} ostree --repo=local-repo create-usb --destination-repo some-dest d assert_has_dir "dest-mount3/some-dest" assert_symlink_has_content "dest-mount3/.ostree/repos.d/00-generated" "/some-dest$" ${CMD_PREFIX} ostree --repo=dest-mount3/.ostree/repos.d/00-generated refs --collections > dest-refs -assert_file_has_content dest-refs "^(org.example.Collection1, test-1)$" -assert_file_has_content dest-refs "^(org.example.Collection1, test-2)$" -assert_file_has_content dest-refs "^(org.example.Collection1, test-3)$" +assert_file_has_content dest-refs "^(org\.example\.Collection1, test-1)$" +assert_file_has_content dest-refs "^(org\.example\.Collection1, test-2)$" +assert_file_has_content dest-refs "^(org\.example\.Collection1, test-3)$" ${CMD_PREFIX} ostree --repo=dest-mount3/.ostree/repos.d/00-generated summary -v > dest-summary -assert_file_has_content dest-summary "(org.example.Collection1, test-1)$" -assert_file_has_content dest-summary "(org.example.Collection1, test-2)$" -assert_file_has_content dest-summary "(org.example.Collection1, test-3)$" +assert_file_has_content dest-summary "(org\.example\.Collection1, test-1)$" +assert_file_has_content dest-summary "(org\.example\.Collection1, test-2)$" +assert_file_has_content dest-summary "(org\.example\.Collection1, test-3)$" echo "ok 4 adding ref to an existing usb" @@ -109,7 +109,7 @@ ostree_repo_init finder-repo ${CMD_PREFIX} ostree --repo=finder-repo remote add remote1 file://$(pwd)/just-needed-for-the-keyring --collection-id org.example.Collection1 --gpg-import="${test_tmpdir}/gpghome/key1.asc" ${test_builddir}/repo-finder-mount finder-repo dest-mount1 org.example.Collection1 test-1 org.example.Collection1 test-2 &> out -assert_file_has_content out "^0 .*_2Fdest-mount1_2F.ostree_2Frepo_remote1.trustedkeys.gpg org.example.Collection1 test-1 $(ostree --repo=repo show test-1)$" -assert_file_has_content out "^0 .*_2Fdest-mount1_2F.ostree_2Frepo_remote1.trustedkeys.gpg org.example.Collection1 test-2 $(ostree --repo=repo show test-2)$" +assert_file_has_content out "^0 .*_2Fdest-mount1_2F\.ostree_2Frepo_remote1\.trustedkeys\.gpg org\.example\.Collection1 test-1 $(ostree --repo=repo show test-1)$" +assert_file_has_content out "^0 .*_2Fdest-mount1_2F\.ostree_2Frepo_remote1\.trustedkeys\.gpg org\.example\.Collection1 test-2 $(ostree --repo=repo show test-2)$" echo "ok 5 find from usb repo" diff --git a/tests/test-find-remotes.sh b/tests/test-find-remotes.sh index b9ddc604..226053ce 100755 --- a/tests/test-find-remotes.sh +++ b/tests/test-find-remotes.sh @@ -60,8 +60,8 @@ assert_file_has_content refs "^os-remote:os/amd64/master$" ${CMD_PREFIX} ostree --repo=local refs --collections > refs cat refs | wc -l > refscount -assert_file_has_content refs "^(org.example.AppsCollection, app1)$" -assert_file_has_content refs "^(org.example.OsCollection, os/amd64/master)$" +assert_file_has_content refs "^(org\.example\.AppsCollection, app1)$" +assert_file_has_content refs "^(org\.example\.OsCollection, os/amd64/master)$" assert_file_has_content refscount "^2$" # Create a local mirror repository where we pull the branches *in mirror mode* from the two remotes. @@ -80,8 +80,8 @@ ls -1 local-mirror/refs/remotes | wc -l > remotescount assert_file_has_content remotescount "^0$" ${CMD_PREFIX} ostree --repo=local-mirror refs --collections > refs -assert_file_has_content refs "^(org.example.AppsCollection, app1)$" -assert_file_has_content refs "^(org.example.OsCollection, os/amd64/master)$" +assert_file_has_content refs "^(org\.example\.AppsCollection, app1)$" +assert_file_has_content refs "^(org\.example\.OsCollection, os/amd64/master)$" assert_file_has_content local-mirror/refs/mirrors/org.example.AppsCollection/app1 "^$(cat app1-checksum)$" assert_file_has_content local-mirror/refs/mirrors/org.example.OsCollection/os/amd64/master "^$(cat os-checksum)$" @@ -90,69 +90,69 @@ for repo in local local-mirror; do # Try finding an update for an existing branch. ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.AppsCollection app1 > find assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/apps-collection$" - assert_file_has_content find "^ - Keyring: apps-remote.trustedkeys.gpg$" - assert_file_has_content find "^ - (org.example.AppsCollection, app1) = $(cat app1-checksum)$" - assert_file_has_content find "^1/1 refs were found.$" - assert_not_file_has_content find "^No results.$" + assert_file_has_content find "^ - Keyring: apps-remote\.trustedkeys\.gpg$" + assert_file_has_content find "^ - (org\.example\.AppsCollection, app1) = $(cat app1-checksum)$" + assert_file_has_content find "^1/1 refs were found\.$" + assert_not_file_has_content find "^No results\.$" # Find several updates for several existing branches. ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.AppsCollection app1 org.example.OsCollection os/amd64/master > find assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/apps-collection$" - assert_file_has_content find "^ - Keyring: apps-remote.trustedkeys.gpg$" - assert_file_has_content find "^ - (org.example.AppsCollection, app1) = $(cat app1-checksum)$" + assert_file_has_content find "^ - Keyring: apps-remote\.trustedkeys\.gpg$" + assert_file_has_content find "^ - (org\.example\.AppsCollection, app1) = $(cat app1-checksum)$" assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$" - assert_file_has_content find "^ - Keyring: os-remote.trustedkeys.gpg$" - assert_file_has_content find "^ - (org.example.OsCollection, os/amd64/master) = $(cat os-checksum)$" - assert_file_has_content find "^2/2 refs were found.$" - assert_not_file_has_content find "^No results.$" + assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$" + assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum)$" + assert_file_has_content find "^2/2 refs were found\.$" + assert_not_file_has_content find "^No results\.$" # Find some updates and a new branch. ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.AppsCollection app1 org.example.AppsCollection app2 org.example.OsCollection os/amd64/master > find assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/apps-collection$" - assert_file_has_content find "^ - Keyring: apps-remote.trustedkeys.gpg$" - assert_file_has_content find "^ - (org.example.AppsCollection, app1) = $(cat app1-checksum)$" - assert_file_has_content find "^ - (org.example.AppsCollection, app2) = $(cat app2-checksum)$" + assert_file_has_content find "^ - Keyring: apps-remote\.trustedkeys\.gpg$" + assert_file_has_content find "^ - (org\.example\.AppsCollection, app1) = $(cat app1-checksum)$" + assert_file_has_content find "^ - (org\.example\.AppsCollection, app2) = $(cat app2-checksum)$" assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$" - assert_file_has_content find "^ - Keyring: os-remote.trustedkeys.gpg$" - assert_file_has_content find "^ - (org.example.OsCollection, os/amd64/master) = $(cat os-checksum)$" - assert_file_has_content find "^3/3 refs were found.$" - assert_not_file_has_content find "^No results.$" + assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$" + assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum)$" + assert_file_has_content find "^3/3 refs were found\.$" + assert_not_file_has_content find "^No results\.$" # Find an update and a non-existent branch. ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.AppsCollection app1 org.example.AppsCollection not-an-app > find assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/apps-collection$" - assert_file_has_content find "^ - Keyring: apps-remote.trustedkeys.gpg$" - assert_file_has_content find "^ - (org.example.AppsCollection, not-an-app) = (not found)$" - assert_file_has_content find "^ - (org.example.AppsCollection, app1) = $(cat app1-checksum)$" + assert_file_has_content find "^ - Keyring: apps-remote\.trustedkeys\.gpg$" + assert_file_has_content find "^ - (org\.example\.AppsCollection, not-an-app) = (not found)$" + assert_file_has_content find "^ - (org\.example\.AppsCollection, app1) = $(cat app1-checksum)$" assert_file_has_content find "^Refs not found in any remote:$" - assert_file_has_content find "^ - (org.example.AppsCollection, not-an-app)$" - assert_file_has_content find "^1/2 refs were found.$" - assert_not_file_has_content find "^No results.$" + assert_file_has_content find "^ - (org\.example\.AppsCollection, not-an-app)$" + assert_file_has_content find "^1/2 refs were found\.$" + assert_not_file_has_content find "^No results\.$" # Do all the above, but pull this time. ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.AppsCollection app1 > pull || true - assert_file_has_content pull "^1/1 refs were found.$" - assert_file_has_content pull "^Pulled 1/1 refs successfully.$" + assert_file_has_content pull "^1/1 refs were found\.$" + assert_file_has_content pull "^Pulled 1/1 refs successfully\.$" assert_not_file_has_content pull "Failed to pull some refs from the remotes" assert_ref $repo app1 $(cat app1-checksum) ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.AppsCollection app1 org.example.OsCollection os/amd64/master > pull - assert_file_has_content pull "^2/2 refs were found.$" - assert_file_has_content pull "^Pulled 2/2 refs successfully.$" + assert_file_has_content pull "^2/2 refs were found\.$" + assert_file_has_content pull "^Pulled 2/2 refs successfully\.$" assert_not_file_has_content pull "Failed to pull some refs from the remotes" assert_ref $repo app1 $(cat app1-checksum) assert_ref $repo os/amd64/master $(cat os-checksum) ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.AppsCollection app1 org.example.AppsCollection app2 org.example.OsCollection os/amd64/master > pull - assert_file_has_content pull "^3/3 refs were found.$" - assert_file_has_content pull "^Pulled 3/3 refs successfully.$" + assert_file_has_content pull "^3/3 refs were found\.$" + assert_file_has_content pull "^Pulled 3/3 refs successfully\.$" assert_not_file_has_content pull "Failed to pull some refs from the remotes" assert_ref $repo app1 $(cat app1-checksum) assert_ref $repo app2 $(cat app2-checksum) assert_ref $repo os/amd64/master $(cat os-checksum) ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.AppsCollection app1 org.example.AppsCollection not-an-app > pull - assert_file_has_content pull "^1/2 refs were found.$" + assert_file_has_content pull "^1/2 refs were found\.$" assert_not_file_has_content pull "Failed to pull some refs from the remotes" assert_ref $repo app1 $(cat app1-checksum) assert_not_ref $repo not-an-app @@ -168,15 +168,15 @@ for repo in local-mirror; do # Try finding an update for that branch. ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.OsCollection os/amd64/master > find assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$" - assert_file_has_content find "^ - Keyring: os-remote.trustedkeys.gpg$" - assert_file_has_content find "^ - (org.example.OsCollection, os/amd64/master) = $(cat os-checksum-2)$" - assert_file_has_content find "^1/1 refs were found.$" - assert_not_file_has_content find "^No results.$" + assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$" + assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum-2)$" + assert_file_has_content find "^1/1 refs were found\.$" + assert_not_file_has_content find "^No results\.$" # Pull it. ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.OsCollection os/amd64/master > pull || true - assert_file_has_content pull "^1/1 refs were found.$" - assert_file_has_content pull "^Pulled 1/1 refs successfully.$" + assert_file_has_content pull "^1/1 refs were found\.$" + assert_file_has_content pull "^Pulled 1/1 refs successfully\.$" assert_not_file_has_content pull "Failed to pull some refs from the remotes" assert_ref $repo os/amd64/master $(cat os-checksum-2) @@ -195,18 +195,18 @@ for repo in local; do # Try finding an update for that branch. ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.OsCollection os/amd64/master > find assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$" - assert_file_has_content find "^ - Keyring: os-remote.trustedkeys.gpg$" - assert_file_has_content find "^ - (org.example.OsCollection, os/amd64/master) = $(cat os-checksum-2)$" + assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$" + assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum-2)$" assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/local-mirror$" - assert_file_has_content find "^ - Keyring: os-remote-local-mirror.trustedkeys.gpg$" - assert_file_has_content find "^ - (org.example.OsCollection, os/amd64/master) = $(cat os-checksum-2)$" - assert_file_has_content find "^1/1 refs were found.$" - assert_not_file_has_content find "^No results.$" + assert_file_has_content find "^ - Keyring: os-remote-local-mirror\.trustedkeys\.gpg$" + assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum-2)$" + assert_file_has_content find "^1/1 refs were found\.$" + assert_not_file_has_content find "^No results\.$" # Pull it. ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.OsCollection os/amd64/master > pull || true - assert_file_has_content pull "^1/1 refs were found.$" - assert_file_has_content pull "^Pulled 1/1 refs successfully.$" + assert_file_has_content pull "^1/1 refs were found\.$" + assert_file_has_content pull "^Pulled 1/1 refs successfully\.$" assert_not_file_has_content pull "Failed to pull some refs from the remotes" assert_ref $repo os/amd64/master $(cat os-checksum-2) done @@ -222,15 +222,15 @@ for repo in local; do # Try finding an update for that branch. ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.OsCollection os/amd64/master > find assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$" - assert_file_has_content find "^ - Keyring: os-remote.trustedkeys.gpg$" - assert_file_has_content find "^ - (org.example.OsCollection, os/amd64/master) = $(cat os-checksum-3)$" - assert_file_has_content find "^1/1 refs were found.$" - assert_not_file_has_content find "^No results.$" + assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$" + assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum-3)$" + assert_file_has_content find "^1/1 refs were found\.$" + assert_not_file_has_content find "^No results\.$" # Pull it. ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.OsCollection os/amd64/master > pull || true - assert_file_has_content pull "^1/1 refs were found.$" - assert_file_has_content pull "^Pulled 1/1 refs successfully.$" + assert_file_has_content pull "^1/1 refs were found\.$" + assert_file_has_content pull "^Pulled 1/1 refs successfully\.$" assert_not_file_has_content pull "Failed to pull some refs from the remotes" assert_ref $repo os/amd64/master $(cat os-checksum-3) done diff --git a/tests/test-fsck-collections.sh b/tests/test-fsck-collections.sh index 79d5d8c9..dc6bcfeb 100755 --- a/tests/test-fsck-collections.sh +++ b/tests/test-fsck-collections.sh @@ -61,7 +61,7 @@ set_up_repo_with_collection_id # fsck at this point should succeed ${CMD_PREFIX} ostree fsck --repo=repo > fsck -assert_file_has_content fsck "^Validating refs in collections...$" +assert_file_has_content fsck "^Validating refs in collections\.\.\.$" # Drop the commit the ref points to, and drop the original ref so that fsck doesn’t prematurely fail on that. find repo/objects -name '*.commit' -delete -print | wc -l > commitcount @@ -73,8 +73,8 @@ rm repo/refs/heads/ref1 if ${CMD_PREFIX} ostree fsck --repo=repo > fsck; then assert_not_reached "fsck unexpectedly succeeded after deleting commit!" fi -assert_file_has_content fsck "^Validating refs...$" -assert_file_has_content fsck "^Validating refs in collections...$" +assert_file_has_content fsck "^Validating refs\.\.\.$" +assert_file_has_content fsck "^Validating refs in collections\.\.\.$" echo "ok 1 fsck-collections" @@ -84,8 +84,8 @@ set_up_repo_with_collection_id rm -rf repo/refs/mirrors ${CMD_PREFIX} ostree fsck --repo=repo > fsck -assert_file_has_content fsck "^Validating refs...$" -assert_file_has_content fsck "^Validating refs in collections...$" +assert_file_has_content fsck "^Validating refs\.\.\.$" +assert_file_has_content fsck "^Validating refs in collections\.\.\.$" echo "ok 2 fsck-collections in old repository" @@ -101,7 +101,7 @@ if ${CMD_PREFIX} ostree fsck --repo=repo --verify-bindings > fsck 2> fsck-error; assert_not_reached "fsck unexpectedly succeeded after adding unbound ref!" fi assert_file_has_content fsck-error "Commit has no requested ref ‘new-ref’ in ref binding metadata (‘ref1’)" -assert_file_has_content fsck "^Validating refs...$" +assert_file_has_content fsck "^Validating refs\.\.\.$" echo "ok 3 fsck detects missing ref bindings" @@ -114,8 +114,8 @@ if ${CMD_PREFIX} ostree fsck --repo=repo --verify-bindings > fsck 2> fsck-error; assert_not_reached "fsck unexpectedly succeeded after adding unbound ref!" fi assert_file_has_content fsck-error "Commit has no requested ref ‘new-ref’ in ref binding metadata (‘ref1’)" -assert_file_has_content fsck "^Validating refs...$" -assert_file_has_content fsck "^Validating refs in collections...$" +assert_file_has_content fsck "^Validating refs\.\.\.$" +assert_file_has_content fsck "^Validating refs in collections\.\.\.$" echo "ok 4 fsck detects missing collection–ref bindings" @@ -127,9 +127,9 @@ ${CMD_PREFIX} ostree --repo=repo refs --collections --create=org.example.Collect if ${CMD_PREFIX} ostree fsck --repo=repo --verify-bindings > fsck 2> fsck-error; then assert_not_reached "fsck unexpectedly succeeded after adding unbound ref!" fi -assert_file_has_content fsck-error "Commit has collection ID ‘org.example.Collection’ in collection binding metadata, while the remote it came from has collection ID ‘org.example.Collection2’" -assert_file_has_content fsck "^Validating refs...$" -assert_file_has_content fsck "^Validating refs in collections...$" +assert_file_has_content fsck-error "Commit has collection ID ‘org\.example\.Collection’ in collection binding metadata, while the remote it came from has collection ID ‘org\.example\.Collection2’" +assert_file_has_content fsck "^Validating refs\.\.\.$" +assert_file_has_content fsck "^Validating refs in collections\.\.\.$" echo "ok 5 fsck detects missing collection–ref bindings" @@ -139,7 +139,7 @@ ${CMD_PREFIX} ostree --repo=repo refs --delete ref1 # fsck at this point should succeed ${CMD_PREFIX} ostree fsck --repo=repo > fsck -assert_file_has_content fsck "^Validating refs in collections...$" +assert_file_has_content fsck "^Validating refs in collections\.\.\.$" echo "ok 6 fsck ignores unreferenced ref bindings" @@ -147,9 +147,9 @@ echo "ok 6 fsck ignores unreferenced ref bindings" if ${CMD_PREFIX} ostree fsck --repo=repo --verify-back-refs > fsck 2> fsck-error; then assert_not_reached "fsck unexpectedly succeeded after adding unbound ref!" fi -assert_file_has_content fsck-error "Collection–ref (org.example.Collection, ref1) in bindings for commit .* does not exist" -assert_file_has_content fsck "^Validating refs...$" -assert_file_has_content fsck "^Validating refs in collections...$" +assert_file_has_content fsck-error "Collection–ref (org\.example\.Collection, ref1) in bindings for commit .* does not exist" +assert_file_has_content fsck "^Validating refs\.\.\.$" +assert_file_has_content fsck "^Validating refs in collections\.\.\.$" echo "ok 7 fsck ignores unreferenced ref bindings" @@ -161,7 +161,7 @@ set_up_repo_without_collection_id # fsck at this point should succeed ${CMD_PREFIX} ostree fsck --repo=repo --verify-bindings > fsck -assert_file_has_content fsck "^Validating refs in collections...$" +assert_file_has_content fsck "^Validating refs in collections\.\.\.$" # Drop the commit the ref points to, and drop the original ref so that fsck doesn’t prematurely fail on that. find repo/objects -name '*.commit' -delete -print | wc -l > commitcount @@ -173,7 +173,7 @@ rm repo/refs/heads/ref3 if ${CMD_PREFIX} ostree fsck --repo=repo --verify-bindings > fsck; then assert_not_reached "fsck unexpectedly succeeded after deleting commit!" fi -assert_file_has_content fsck "^Validating refs...$" +assert_file_has_content fsck "^Validating refs\.\.\.$" echo "ok 8 fsck-collections" @@ -187,7 +187,7 @@ if ${CMD_PREFIX} ostree fsck --repo=repo --verify-bindings > fsck 2> fsck-error; assert_not_reached "fsck unexpectedly succeeded after adding unbound ref!" fi assert_file_has_content fsck-error "Commit has no requested ref ‘new-ref’ in ref binding metadata (‘ref3’, ‘ref4’)" -assert_file_has_content fsck "^Validating refs...$" +assert_file_has_content fsck "^Validating refs\.\.\.$" echo "ok 9 fsck detects missing ref bindings" @@ -197,7 +197,7 @@ ${CMD_PREFIX} ostree --repo=repo refs --delete ref3 # fsck at this point should succeed ${CMD_PREFIX} ostree fsck --repo=repo > fsck -assert_file_has_content fsck "^Validating refs...$" +assert_file_has_content fsck "^Validating refs\.\.\.$" echo "ok 10 fsck ignores unreferenced ref bindings" @@ -206,6 +206,6 @@ if ${CMD_PREFIX} ostree fsck --repo=repo --verify-back-refs > fsck 2> fsck-error assert_not_reached "fsck unexpectedly succeeded after adding unbound ref!" fi assert_file_has_content fsck-error "Ref ‘ref3’ in bindings for commit .* does not exist" -assert_file_has_content fsck "^Validating refs...$" +assert_file_has_content fsck "^Validating refs\.\.\.$" echo "ok 11 fsck ignores unreferenced ref bindings" diff --git a/tests/test-init-collections.sh b/tests/test-init-collections.sh index 5c3dd4e2..1954f1ae 100755 --- a/tests/test-init-collections.sh +++ b/tests/test-init-collections.sh @@ -30,6 +30,6 @@ cd ${test_tmpdir} # Check that initialising a repository with a collection ID results in the ID being in the config. mkdir repo ostree_repo_init repo --collection-id org.example.Collection -assert_file_has_content repo/config "^collection-id=org.example.Collection$" +assert_file_has_content repo/config "^collection-id=org\.example\.Collection$" echo "ok init-collections" diff --git a/tests/test-no-initramfs.sh b/tests/test-no-initramfs.sh index 60e1f9a7..22846c8f 100755 --- a/tests/test-no-initramfs.sh +++ b/tests/test-no-initramfs.sh @@ -83,7 +83,7 @@ do ${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'init=' - assert_file_has_content sysroot/boot/"$(get_key_from_bootloader_conf sysroot/boot/loader/entries/ostree-2-testos.conf 'devicetree')" "my .dtb file" + assert_file_has_content sysroot/boot/"$(get_key_from_bootloader_conf sysroot/boot/loader/entries/ostree-2-testos.conf 'devicetree')" "my \.dtb file" assert_not_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'initrd' echo "ok switching from initramfs to no initramfs sysroot with devicetree layout=$layout" diff --git a/tests/test-pull-summary-sigs.sh b/tests/test-pull-summary-sigs.sh index dee186b5..e2864beb 100755 --- a/tests/test-pull-summary-sigs.sh +++ b/tests/test-pull-summary-sigs.sh @@ -146,7 +146,7 @@ assert_file_has_content summary.txt "* main" assert_file_has_content summary.txt "* other" assert_file_has_content summary.txt "* yet-another" assert_file_has_content summary.txt "found 1 signature" -assert_file_has_content summary.txt "Good signature from \"Ostree Tester \"" +assert_file_has_content summary.txt "Good signature from \"Ostree Tester \"" grep static-deltas summary.txt > static-deltas.txt assert_file_has_content static-deltas.txt \ $(${OSTREE} --repo=repo rev-parse origin:main) diff --git a/tests/test-refs-collections.sh b/tests/test-refs-collections.sh index 9a123dd9..bf233970 100755 --- a/tests/test-refs-collections.sh +++ b/tests/test-refs-collections.sh @@ -46,11 +46,11 @@ assert_file_has_content refscount "^5$" ${CMD_PREFIX} ostree --repo=repo refs > refs assert_file_has_content refs "^test\-1$" assert_file_has_content refs "^test\-5$" -assert_not_file_has_content refs "org.example.Collection" +assert_not_file_has_content refs "org\.example\.Collection" ${CMD_PREFIX} ostree --repo=repo refs --collections > refs -assert_file_has_content refs "^(org.example.Collection, test-1)$" -assert_file_has_content refs "^(org.example.Collection, test-5)$" +assert_file_has_content refs "^(org\.example\.Collection, test-1)$" +assert_file_has_content refs "^(org\.example\.Collection, test-5)$" # Similarly, the collection IDs should only be listed when filtering if --collections is passed. ${CMD_PREFIX} ostree --repo=repo refs --list org.example.Collection | wc -l > refscount @@ -102,8 +102,8 @@ assert_file_has_content refs "^ctest$" assert_not_file_has_content refs "^ctest-mirror$" ${CMD_PREFIX} ostree --repo=repo refs --collections > refs -assert_file_has_content refs "^(org.example.Collection, ctest)$" -assert_file_has_content refs "^(org.example.NewCollection, ctest-mirror)$" +assert_file_has_content refs "^(org\.example\.Collection, ctest)$" +assert_file_has_content refs "^(org\.example\.NewCollection, ctest-mirror)$" # Remote refs should be listed if they have collection IDs @@ -116,13 +116,13 @@ ${CMD_PREFIX} ostree --repo=repo remote add --no-gpg-verify --collection-id org. ${CMD_PREFIX} ostree --repo=repo pull collection-repo-remote rcommit ${CMD_PREFIX} ostree --repo=repo refs --collections > refs -assert_file_has_content refs "^(org.example.RemoteCollection, rcommit)$" +assert_file_has_content refs "^(org\.example\.RemoteCollection, rcommit)$" ${CMD_PREFIX} ostree --repo=repo refs --collections org.example.RemoteCollection > refs -assert_file_has_content refs "^(org.example.RemoteCollection, rcommit)$" +assert_file_has_content refs "^(org\.example\.RemoteCollection, rcommit)$" ${CMD_PREFIX} ostree --repo=repo refs --collections org.example.NonexistentID > refs -assert_not_file_has_content refs "^(org.example.RemoteCollection, rcommit)$" +assert_not_file_has_content refs "^(org\.example\.RemoteCollection, rcommit)$" cd ${test_tmpdir} mkdir no-collection-repo @@ -147,8 +147,8 @@ ${CMD_PREFIX} ostree --repo=repo refs --collections rm -rf repo/refs/mirrors ${CMD_PREFIX} ostree --repo=repo refs --collections --create=org.example.NewCollection:ctest-mirror ctest ${CMD_PREFIX} ostree --repo=repo refs --collections > refs -assert_file_has_content refs "^(org.example.Collection, ctest)$" -assert_file_has_content refs "^(org.example.NewCollection, ctest-mirror)$" +assert_file_has_content refs "^(org\.example\.Collection, ctest)$" +assert_file_has_content refs "^(org\.example\.NewCollection, ctest-mirror)$" rm -rf repo/refs/mirrors ${CMD_PREFIX} ostree refs --repo=repo --collections --delete org.example.NonexistentCollection diff --git a/tests/test-remote-add.sh b/tests/test-remote-add.sh index 57fe7eec..bb7eae89 100755 --- a/tests/test-remote-add.sh +++ b/tests/test-remote-add.sh @@ -51,18 +51,18 @@ $OSTREE remote list > list.txt assert_file_has_content list.txt "origin" assert_file_has_content list.txt "another" assert_file_has_content list.txt "another-noexist" -assert_not_file_has_content list.txt "http://example.com/ostree/gnome" -assert_not_file_has_content list.txt "http://another.com/repo" -assert_not_file_has_content list.txt "http://another-noexist.example.com/anotherrepo" +assert_not_file_has_content list.txt "http://example\.com/ostree/gnome" +assert_not_file_has_content list.txt "http://another\.com/repo" +assert_not_file_has_content list.txt "http://another-noexist\.example\.com/anotherrepo" echo "ok remote list" $OSTREE remote list --show-urls > list.txt assert_file_has_content list.txt "origin" assert_file_has_content list.txt "another" assert_file_has_content list.txt "another-noexist" -assert_file_has_content list.txt "http://example.com/ostree/gnome" -assert_file_has_content list.txt "http://another.com/repo" -assert_file_has_content list.txt "http://another-noexist.example.com/anotherrepo" +assert_file_has_content list.txt "http://example\.com/ostree/gnome" +assert_file_has_content list.txt "http://another\.com/repo" +assert_file_has_content list.txt "http://another-noexist\.example\.com/anotherrepo" echo "ok remote list with urls" cd ${test_tmpdir} @@ -116,5 +116,5 @@ echo "ok remote add fail --if-not-exists and --force" # Overwrite with --force $OSTREE remote add --force another http://another.example.com/anotherrepo $OSTREE remote list --show-urls > list.txt -assert_file_has_content list.txt "^another \+http://another.example.com/anotherrepo$" +assert_file_has_content list.txt "^another \+http://another\.example\.com/anotherrepo$" echo "ok remote add --force" diff --git a/tests/test-repo-finder-mount-integration.sh b/tests/test-repo-finder-mount-integration.sh index 283e4b0b..243df591 100755 --- a/tests/test-repo-finder-mount-integration.sh +++ b/tests/test-repo-finder-mount-integration.sh @@ -101,9 +101,9 @@ for fs_type in ext4 vfat; do assert_has_dir "${usb_mount}"/.ostree/repo ${CMD_PREFIX} ostree --repo="${usb_mount}"/.ostree/repo refs --collections > dest-refs - assert_file_has_content dest-refs "^(org.example.Collection1, test-1)$" - assert_file_has_content dest-refs "^(org.example.Collection1, test-2)$" - assert_not_file_has_content dest-refs "^(org.example.Collection1, test-3)$" + assert_file_has_content dest-refs "^(org\.example\.Collection1, test-1)$" + assert_file_has_content dest-refs "^(org\.example\.Collection1, test-2)$" + assert_not_file_has_content dest-refs "^(org\.example\.Collection1, test-3)$" assert_has_file "${usb_mount}"/.ostree/repo/summary # Pull into a second local repository (theoretically, a separate computer). @@ -112,15 +112,15 @@ for fs_type in ext4 vfat; do ${CMD_PREFIX} ostree --repo=peer-repo_$fs_type remote add remote1 file://just-here-for-the-keyring --collection-id org.example.Collection1 --gpg-import="${test_tmpdir}/gpghome/key1.asc" ${CMD_PREFIX} ostree --repo=peer-repo_$fs_type find-remotes --finders=mount org.example.Collection1 test-1 > find-results - assert_not_file_has_content find-results "^No results.$" + assert_not_file_has_content find-results "^No results\.$" assert_file_has_content find-results "^Result 0: file://${usb_mount}" - assert_file_has_content find-results "(org.example.Collection1, test-1) = $(cat ref1-checksum)$" + assert_file_has_content find-results "(org\.example\.Collection1, test-1) = $(cat ref1-checksum)$" ${CMD_PREFIX} ostree --repo=peer-repo_$fs_type find-remotes --finders=mount --pull org.example.Collection1 test-1 > pull-results - assert_file_has_content pull-results "^Pulled 1/1 refs successfully.$" + assert_file_has_content pull-results "^Pulled 1/1 refs successfully\.$" ${CMD_PREFIX} ostree --repo=peer-repo_$fs_type refs --collections > refs - assert_file_has_content refs "^(org.example.Collection1, test-1)$" + assert_file_has_content refs "^(org\.example\.Collection1, test-1)$" ${SUDO} umount "${MOUNT_INTEGRATION_DEV}" diff --git a/tests/test-summary-collections.sh b/tests/test-summary-collections.sh index 22921f53..777d3d0c 100755 --- a/tests/test-summary-collections.sh +++ b/tests/test-summary-collections.sh @@ -43,19 +43,19 @@ done ${CMD_PREFIX} ostree --repo=repo summary --update ${CMD_PREFIX} ostree --repo=repo summary --view > summary -assert_file_has_content summary "(org.example.Collection, test-1)$" -assert_file_has_content summary "(org.example.Collection, test-2)$" -assert_file_has_content summary "(org.example.Collection, test-3)$" -assert_file_has_content summary "(org.example.Collection, test-4)$" -assert_file_has_content summary "(org.example.Collection, test-5)$" -assert_file_has_content summary "^Collection ID (ostree\.summary\.collection-id): org.example.Collection$" +assert_file_has_content summary "(org\.example\.Collection, test-1)$" +assert_file_has_content summary "(org\.example\.Collection, test-2)$" +assert_file_has_content summary "(org\.example\.Collection, test-3)$" +assert_file_has_content summary "(org\.example\.Collection, test-4)$" +assert_file_has_content summary "(org\.example\.Collection, test-5)$" +assert_file_has_content summary "^Collection ID (ostree\.summary\.collection-id): org\.example\.Collection$" # Test that mirrored branches are listed too. ${CMD_PREFIX} ostree --repo=repo refs --collections --create=org.example.OtherCollection:test-1-mirror test-1 ${CMD_PREFIX} ostree --repo=repo summary --update ${CMD_PREFIX} ostree --repo=repo summary --view > summary -assert_file_has_content summary "(org.example.OtherCollection, test-1-mirror)$" +assert_file_has_content summary "(org\.example\.OtherCollection, test-1-mirror)$" # Test that remote refs are listed, but only if they have collection IDs cd ${test_tmpdir} @@ -68,7 +68,7 @@ ${CMD_PREFIX} ostree --repo=repo pull collection-repo-remote rcommit ${CMD_PREFIX} ostree --repo=repo summary --update ${CMD_PREFIX} ostree --repo=repo summary --view > summary -assert_file_has_content summary "(org.example.RemoteCollection, rcommit)$" +assert_file_has_content summary "(org\.example\.RemoteCollection, rcommit)$" cd ${test_tmpdir} mkdir no-collection-repo diff --git a/tests/test-summary-update.sh b/tests/test-summary-update.sh index 6fb5a4be..062d5bd4 100755 --- a/tests/test-summary-update.sh +++ b/tests/test-summary-update.sh @@ -90,12 +90,12 @@ assert_file_has_content summary "^map: {}$" # Check the ostree-metadata ref has also been created with the same content and appropriate bindings. ${CMD_PREFIX} ostree --repo=repo refs --collections > refs -assert_file_has_content refs "^(org.example.Collection1, ostree-metadata)$" +assert_file_has_content refs "^(org\.example\.Collection1, ostree-metadata)$" ${CMD_PREFIX} ostree --repo=repo show ostree-metadata --raw > metadata assert_file_has_content metadata "'map': <@a{sv} {}>" -assert_file_has_content metadata "'ostree.ref-binding': <\['ostree-metadata'\]>" -assert_file_has_content metadata "'ostree.collection-binding': <'org.example.Collection1'>" +assert_file_has_content metadata "'ostree\.ref-binding': <\['ostree-metadata'\]>" +assert_file_has_content metadata "'ostree\.collection-binding': <'org\.example\.Collection1'>" # There should be 5 commits in the ostree-metadata branch, since we’ve updated the summary 5 times. ${CMD_PREFIX} ostree --repo=repo log ostree-metadata | grep 'commit ' | wc -l > commit-count diff --git a/tests/test-xattrs.sh b/tests/test-xattrs.sh index e2a192a9..07c9ac38 100755 --- a/tests/test-xattrs.sh +++ b/tests/test-xattrs.sh @@ -42,8 +42,8 @@ echo "ok commit with xattrs" ${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' +assert_file_has_content attrs '^user\.ostree-test' +assert_file_has_content attrs '^user\.test0' getfattr -n user.ostree-test --only-values test2-checkout2/firstfile > v0 assert_file_has_content v0 '^testvalue$' getfattr -n user.test0 --only-values test2-checkout2/firstfile > v1