exit 0
fi
-echo "1..1"
+echo "1..6"
keyid="472CDAFA"
oldpwd=`pwd`
assert_not_reached "pull with no trusted GPG keys unexpectedly succeeded!"
fi
rm repo -rf
+echo "ok pull no trusted GPG"
# And a test case with valid signature
cd ${test_tmpdir}
ostree_repo_init repo
${CMD_PREFIX} ostree --repo=repo remote add origin $(cat httpd-address)/ostree/gnomerepo
${CMD_PREFIX} ostree --repo=repo pull origin main
-${CMD_PREFIX} ostree --repo=repo show --gpg-verify-remote=origin main | grep -o 'Found [[:digit:]] signature' > show-verify-remote
-assert_file_has_content show-verify-remote 'Found 1 signature'
+${CMD_PREFIX} ostree --repo=repo show --gpg-verify-remote=origin main > show.txt
+assert_file_has_content_literal show.txt 'Found 1 signature'
rm repo -rf
+echo "ok pull verify"
# A test with corrupted detached signature
cd ${test_tmpdir}
assert_not_reached "pull with corrupted signature unexpectedly succeeded!"
fi
rm repo -rf
+echo "ok pull corrupted sig"
# And now attempt to pull the same corrupted commit, but with GPG
# verification off
${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo
${CMD_PREFIX} ostree --repo=repo pull origin main
rm repo -rf
+echo "ok repull corrupted"
# Add an unsigned commit to the repo, then pull, then sign the commit,
# then pull again. Make sure we get the expected number of signatures
ostree_repo_init repo
${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo
${CMD_PREFIX} ostree --repo=repo pull origin main
-if ${CMD_PREFIX} ostree --repo=repo show main | grep -o 'Found [[:digit:]] signature'; then
- assert_not_reached
-fi
+${CMD_PREFIX} ostree --repo=repo show main > show.txt
+assert_not_file_has_content show.txt 'Found.*signature'
${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo gpg-sign --gpg-homedir=${test_tmpdir}/gpghome main $keyid
${CMD_PREFIX} ostree --repo=repo pull origin main
-${CMD_PREFIX} ostree --repo=repo show main | grep -o 'Found [[:digit:]] signature' > show
-assert_file_has_content show 'Found 1 signature'
+${CMD_PREFIX} ostree --repo=repo show main > show.txt
+assert_file_has_content_literal show.txt 'Found 1 signature'
+echo "ok pull unsigned, then sign"
# Delete the signature from the commit so the detached metadata is empty,
# then pull and verify the signature is also deleted on the client side.
${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo gpg-sign --gpg-homedir=${test_tmpdir}/gpghome --delete main $keyid
${CMD_PREFIX} ostree --repo=repo pull origin main
-if ${CMD_PREFIX} ostree --repo=repo show main | grep -o 'Found [[:digit:]] signature'; then
- assert_not_reached
-fi
+${CMD_PREFIX} ostree --repo=repo show main >show.txt
+assert_not_file_has_content show.txt 'Found.*signature'
+echo "ok pull sig deleted"
rm -rf repo gnomerepo-files
libtest_cleanup_gpg
-
-echo "ok"