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
This commit is contained in:
Matthew Leeds 2019-04-01 19:01:49 -07:00 committed by Atomic Bot
parent 077b23cc98
commit dd6844a61e
19 changed files with 141 additions and 141 deletions

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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}"

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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 doesnt 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 collectionref 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 collectionref 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 "Collectionref (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 "Collectionref (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 doesnt 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"

View File

@ -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"

View File

@ -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"

View File

@ -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 <test@test.com>\""
assert_file_has_content summary.txt "Good signature from \"Ostree Tester <test@test\.com>\""
grep static-deltas summary.txt > static-deltas.txt
assert_file_has_content static-deltas.txt \
$(${OSTREE} --repo=repo rev-parse origin:main)

View File

@ -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

View File

@ -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"

View File

@ -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}"

View File

@ -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

View File

@ -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 weve updated the summary 5 times.
${CMD_PREFIX} ostree --repo=repo log ostree-metadata | grep 'commit ' | wc -l > commit-count

View File

@ -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