tests: use option "--no-sign-verify" for adding remote

Option "--no-sign-verify" disable the signature verification including
GPG. So use it in tests instead of "--no-gpg-verification".

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
This commit is contained in:
Denis Pynkin 2019-11-17 21:01:13 +03:00
parent 6608436441
commit 68aa13550a
6 changed files with 30 additions and 30 deletions

View File

@ -29,7 +29,7 @@ function repo_init() {
${CMD_PREFIX} ostree --repo=repo remote add origin $(cat httpd-address)/ostree/gnomerepo "$@" ${CMD_PREFIX} ostree --repo=repo remote add origin $(cat httpd-address)/ostree/gnomerepo "$@"
} }
repo_init --no-gpg-verify repo_init --no-sign-verify
# See also the copy of this in basic-test.sh # See also the copy of this in basic-test.sh
COMMIT_ARGS="" COMMIT_ARGS=""
@ -62,7 +62,7 @@ else
fi fi
# Try both syntaxes # Try both syntaxes
repo_init --no-gpg-verify repo_init --no-sign-verify
${CMD_PREFIX} ostree --repo=repo pull origin main >out.txt ${CMD_PREFIX} ostree --repo=repo pull origin main >out.txt
assert_file_has_content out.txt "[1-9][0-9]* metadata, [1-9][0-9]* content objects fetched" assert_file_has_content out.txt "[1-9][0-9]* metadata, [1-9][0-9]* content objects fetched"
${CMD_PREFIX} ostree --repo=repo pull origin:main > out.txt ${CMD_PREFIX} ostree --repo=repo pull origin:main > out.txt
@ -164,7 +164,7 @@ echo "ok pull (bareuseronly mirror)"
# Corruption tests <https://github.com/ostreedev/ostree/issues/1211> # Corruption tests <https://github.com/ostreedev/ostree/issues/1211>
cd ${test_tmpdir} cd ${test_tmpdir}
repo_init --no-gpg-verify repo_init --no-sign-verify
if ! is_bare_user_only_repo repo; then if ! is_bare_user_only_repo repo; then
if ! skip_one_without_user_xattrs; then if ! skip_one_without_user_xattrs; then
if is_bare_user_only_repo repo; then if is_bare_user_only_repo repo; then
@ -216,7 +216,7 @@ if ! skip_one_without_user_xattrs; then
done done
# And ensure the repo is reinitialized # And ensure the repo is reinitialized
repo_init --no-gpg-verify repo_init --no-sign-verify
echo "ok corruption" echo "ok corruption"
fi fi
else else
@ -320,7 +320,7 @@ echo "ok pull specific commit"
# test pull -T # test pull -T
cd ${test_tmpdir} cd ${test_tmpdir}
repo_init --no-gpg-verify repo_init --no-sign-verify
${CMD_PREFIX} ostree --repo=repo pull origin main ${CMD_PREFIX} ostree --repo=repo pull origin main
origrev=$(${CMD_PREFIX} ostree --repo=repo rev-parse main) origrev=$(${CMD_PREFIX} ostree --repo=repo rev-parse main)
# Check we can pull the same commit with timestamp checking enabled # Check we can pull the same commit with timestamp checking enabled
@ -350,7 +350,7 @@ ${CMD_PREFIX} ostree --repo=repo pull origin main
echo "ok pull timestamp checking" echo "ok pull timestamp checking"
cd ${test_tmpdir} cd ${test_tmpdir}
repo_init --no-gpg-verify repo_init --no-sign-verify
${CMD_PREFIX} ostree --repo=repo pull origin main ${CMD_PREFIX} ostree --repo=repo pull origin main
${CMD_PREFIX} ostree --repo=repo fsck ${CMD_PREFIX} ostree --repo=repo fsck
# Generate a delta from old to current, even though we aren't going to # Generate a delta from old to current, even though we aren't going to
@ -375,7 +375,7 @@ ${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo summary -u
# Explicitly test delta fetches via ref name as well as commit hash # Explicitly test delta fetches via ref name as well as commit hash
for delta_target in main ${new_rev}; do for delta_target in main ${new_rev}; do
cd ${test_tmpdir} cd ${test_tmpdir}
repo_init --no-gpg-verify repo_init --no-sign-verify
${CMD_PREFIX} ostree --repo=repo pull origin main@${prev_rev} ${CMD_PREFIX} ostree --repo=repo pull origin main@${prev_rev}
${CMD_PREFIX} ostree --repo=repo pull --dry-run --require-static-deltas origin ${delta_target} >dry-run-pull.txt ${CMD_PREFIX} ostree --repo=repo pull --dry-run --require-static-deltas origin ${delta_target} >dry-run-pull.txt
# Compression can vary, so we support 400-699 # Compression can vary, so we support 400-699
@ -388,7 +388,7 @@ done
# Test pull via file:/// - this should still use the deltas path for testing # Test pull via file:/// - this should still use the deltas path for testing
cd ${test_tmpdir} cd ${test_tmpdir}
repo_init --no-gpg-verify repo_init --no-sign-verify
${CMD_PREFIX} ostree --repo=repo remote delete origin ${CMD_PREFIX} ostree --repo=repo remote delete origin
${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin file://$(pwd)/ostree-srv/gnomerepo ${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin file://$(pwd)/ostree-srv/gnomerepo
${CMD_PREFIX} ostree --repo=repo pull origin main@${prev_rev} ${CMD_PREFIX} ostree --repo=repo pull origin main@${prev_rev}
@ -400,7 +400,7 @@ echo "ok pull file:// + deltas required"
# Explicitly test delta fetches via ref name as well as commit hash # Explicitly test delta fetches via ref name as well as commit hash
for delta_target in main ${new_rev}; do for delta_target in main ${new_rev}; do
cd ${test_tmpdir} cd ${test_tmpdir}
repo_init --no-gpg-verify repo_init --no-sign-verify
${CMD_PREFIX} ostree --repo=repo pull origin main@${prev_rev} ${CMD_PREFIX} ostree --repo=repo pull origin main@${prev_rev}
${CMD_PREFIX} ostree --repo=repo pull --require-static-deltas origin ${delta_target} ${CMD_PREFIX} ostree --repo=repo pull --require-static-deltas origin ${delta_target}
if test ${delta_target} = main; then if test ${delta_target} = main; then
@ -414,12 +414,12 @@ done
# Test no-op with deltas: https://github.com/ostreedev/ostree/issues/1321 # Test no-op with deltas: https://github.com/ostreedev/ostree/issues/1321
cd ${test_tmpdir} cd ${test_tmpdir}
repo_init --no-gpg-verify repo_init --no-sign-verify
${CMD_PREFIX} ostree --repo=repo pull origin main ${CMD_PREFIX} ostree --repo=repo pull origin main
${CMD_PREFIX} ostree --repo=repo pull --require-static-deltas origin main ${CMD_PREFIX} ostree --repo=repo pull --require-static-deltas origin main
cd ${test_tmpdir} cd ${test_tmpdir}
repo_init --no-gpg-verify repo_init --no-sign-verify
${CMD_PREFIX} ostree --repo=repo pull origin main@${prev_rev} ${CMD_PREFIX} ostree --repo=repo pull origin main@${prev_rev}
${CMD_PREFIX} ostree --repo=repo pull --disable-static-deltas origin main ${CMD_PREFIX} ostree --repo=repo pull --disable-static-deltas origin main
${CMD_PREFIX} ostree --repo=repo fsck ${CMD_PREFIX} ostree --repo=repo fsck
@ -437,7 +437,7 @@ cd ${test_tmpdir}
${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo static-delta generate --swap-endianness main ${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo static-delta generate --swap-endianness main
${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo summary -u ${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo summary -u
repo_init --no-gpg-verify repo_init --no-sign-verify
${CMD_PREFIX} ostree --repo=repo pull origin main@${prev_rev} ${CMD_PREFIX} ostree --repo=repo pull origin main@${prev_rev}
${CMD_PREFIX} ostree --repo=repo pull --require-static-deltas --dry-run origin main >byteswapped-dry-run-pull.txt ${CMD_PREFIX} ostree --repo=repo pull --require-static-deltas --dry-run origin main >byteswapped-dry-run-pull.txt
${CMD_PREFIX} ostree --repo=repo fsck ${CMD_PREFIX} ostree --repo=repo fsck
@ -451,7 +451,7 @@ echo "ok pull byteswapped delta"
cd ${test_tmpdir} cd ${test_tmpdir}
rm ostree-srv/gnomerepo/deltas -rf rm ostree-srv/gnomerepo/deltas -rf
${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo summary -u ${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo summary -u
repo_init --no-gpg-verify repo_init --no-sign-verify
if ${CMD_PREFIX} ostree --repo=repo pull --require-static-deltas origin main 2>err.txt; then if ${CMD_PREFIX} ostree --repo=repo pull --require-static-deltas origin main 2>err.txt; then
assert_not_reached "--require-static-deltas unexpectedly succeeded" assert_not_reached "--require-static-deltas unexpectedly succeeded"
fi fi
@ -459,7 +459,7 @@ assert_file_has_content err.txt "deltas required, but none found"
${CMD_PREFIX} ostree --repo=repo fsck ${CMD_PREFIX} ostree --repo=repo fsck
# Now test with a partial commit # Now test with a partial commit
repo_init --no-gpg-verify repo_init --no-sign-verify
${CMD_PREFIX} ostree --repo=repo pull --commit-metadata-only origin main@${prev_rev} ${CMD_PREFIX} ostree --repo=repo pull --commit-metadata-only origin main@${prev_rev}
if ${CMD_PREFIX} ostree --repo=repo pull --require-static-deltas origin main 2>err.txt; then if ${CMD_PREFIX} ostree --repo=repo pull --require-static-deltas origin main 2>err.txt; then
assert_not_reached "--require-static-deltas unexpectedly succeeded" assert_not_reached "--require-static-deltas unexpectedly succeeded"
@ -467,7 +467,7 @@ fi
assert_file_has_content err.txt "deltas required, but none found" assert_file_has_content err.txt "deltas required, but none found"
echo "ok delta required but don't exist" echo "ok delta required but don't exist"
repo_init --no-gpg-verify repo_init --no-sign-verify
${CMD_PREFIX} ostree --repo=repo pull origin main@${prev_rev} ${CMD_PREFIX} ostree --repo=repo pull origin main@${prev_rev}
if ${CMD_PREFIX} ostree --repo=repo pull --require-static-deltas origin ${new_rev} 2>err.txt; then if ${CMD_PREFIX} ostree --repo=repo pull --require-static-deltas origin ${new_rev} 2>err.txt; then
assert_not_reached "--require-static-deltas unexpectedly succeeded" assert_not_reached "--require-static-deltas unexpectedly succeeded"
@ -595,7 +595,7 @@ if has_gpgme; then
fi fi
cd ${test_tmpdir} cd ${test_tmpdir}
repo_init --no-gpg-verify repo_init --no-sign-verify
mv ostree-srv/gnomerepo/refs/heads/main{,.orig} mv ostree-srv/gnomerepo/refs/heads/main{,.orig}
rm ostree-srv/gnomerepo/summary rm ostree-srv/gnomerepo/summary
(for x in $(seq 20); do echo "lots of html here "; done) > ostree-srv/gnomerepo/refs/heads/main (for x in $(seq 20); do echo "lots of html here "; done) > ostree-srv/gnomerepo/refs/heads/main

View File

@ -29,7 +29,7 @@ function repo_init() {
${CMD_PREFIX} ostree --repo=repo remote add origin $(cat httpd-address)/ostree/gnomerepo "$@" ${CMD_PREFIX} ostree --repo=repo remote add origin $(cat httpd-address)/ostree/gnomerepo "$@"
} }
repo_init --no-gpg-verify repo_init --no-sign-verify
# See also the copy of this in basic-test.sh # See also the copy of this in basic-test.sh
COMMIT_ARGS="" COMMIT_ARGS=""
@ -48,7 +48,7 @@ fi
echo "1..1" echo "1..1"
cd ${test_tmpdir} cd ${test_tmpdir}
repo_init --no-gpg-verify repo_init --no-sign-verify
prev_rev=$(ostree --repo=ostree-srv/repo rev-parse ${remote_ref}^) prev_rev=$(ostree --repo=ostree-srv/repo rev-parse ${remote_ref}^)
rev=$(ostree --repo=ostree-srv/repo rev-parse ${remote_ref}) rev=$(ostree --repo=ostree-srv/repo rev-parse ${remote_ref})
${CMD_PREFIX} ostree --repo=ostree-srv/repo static-delta generate ${remote_ref} ${CMD_PREFIX} ostree --repo=ostree-srv/repo static-delta generate ${remote_ref}

View File

@ -75,7 +75,7 @@ EOF
cd ${test_tmpdir} cd ${test_tmpdir}
mkdir repo mkdir repo
ostree_repo_init repo ostree_repo_init repo
${CMD_PREFIX} ostree --repo=repo remote add origin --no-gpg-verify \ ${CMD_PREFIX} ostree --repo=repo remote add origin --no-sign-verify \
mirrorlist=$(cat httpd-address)/ostree/mirrorlist mirrorlist=$(cat httpd-address)/ostree/mirrorlist
${CMD_PREFIX} ostree --repo=repo pull origin:main ${CMD_PREFIX} ostree --repo=repo pull origin:main
@ -87,7 +87,7 @@ cd ${test_tmpdir}
rm -rf repo rm -rf repo
mkdir repo mkdir repo
ostree_repo_init repo ostree_repo_init repo
${CMD_PREFIX} ostree --repo=repo remote add origin --no-gpg-verify \ ${CMD_PREFIX} ostree --repo=repo remote add origin --no-sign-verify \
--contenturl=mirrorlist=$(cat httpd-address)/ostree/mirrorlist \ --contenturl=mirrorlist=$(cat httpd-address)/ostree/mirrorlist \
$(cat httpd-address)/ostree/gnomerepo $(cat httpd-address)/ostree/gnomerepo
${CMD_PREFIX} ostree --repo=repo pull origin:main ${CMD_PREFIX} ostree --repo=repo pull origin:main
@ -100,7 +100,7 @@ cd ${test_tmpdir}
rm -rf repo rm -rf repo
mkdir repo mkdir repo
ostree_repo_init repo ostree_repo_init repo
${CMD_PREFIX} ostree --repo=repo remote add origin --no-gpg-verify \ ${CMD_PREFIX} ostree --repo=repo remote add origin --no-sign-verify \
--contenturl=mirrorlist=$(cat httpd-address)/ostree/mirrorlist \ --contenturl=mirrorlist=$(cat httpd-address)/ostree/mirrorlist \
mirrorlist=$(cat httpd-address)/ostree/mirrorlist mirrorlist=$(cat httpd-address)/ostree/mirrorlist
${CMD_PREFIX} ostree --repo=repo pull origin:main ${CMD_PREFIX} ostree --repo=repo pull origin:main

View File

@ -112,7 +112,7 @@ mkdir collection-repo
ostree_repo_init collection-repo --collection-id org.example.RemoteCollection ostree_repo_init collection-repo --collection-id org.example.RemoteCollection
mkdir -p adir mkdir -p adir
${CMD_PREFIX} ostree --repo=collection-repo commit --branch=rcommit -m rcommit -s rcommit adir ${CMD_PREFIX} ostree --repo=collection-repo commit --branch=rcommit -m rcommit -s rcommit adir
${CMD_PREFIX} ostree --repo=repo remote add --no-gpg-verify --collection-id org.example.RemoteCollection collection-repo-remote "file://${test_tmpdir}/collection-repo" ${CMD_PREFIX} ostree --repo=repo remote add --no-sign-verify --collection-id org.example.RemoteCollection collection-repo-remote "file://${test_tmpdir}/collection-repo"
${CMD_PREFIX} ostree --repo=repo pull collection-repo-remote rcommit ${CMD_PREFIX} ostree --repo=repo pull collection-repo-remote rcommit
${CMD_PREFIX} ostree --repo=repo refs --collections > refs ${CMD_PREFIX} ostree --repo=repo refs --collections > refs
@ -129,7 +129,7 @@ mkdir no-collection-repo
ostree_repo_init no-collection-repo ostree_repo_init no-collection-repo
mkdir -p adir2 mkdir -p adir2
${CMD_PREFIX} ostree --repo=no-collection-repo commit --branch=rcommit2 -m rcommit2 -s rcommit2 adir2 ${CMD_PREFIX} ostree --repo=no-collection-repo commit --branch=rcommit2 -m rcommit2 -s rcommit2 adir2
${CMD_PREFIX} ostree --repo=repo remote add --no-gpg-verify no-collection-repo-remote "file://${test_tmpdir}/no-collection-repo" ${CMD_PREFIX} ostree --repo=repo remote add --no-sign-verify no-collection-repo-remote "file://${test_tmpdir}/no-collection-repo"
${CMD_PREFIX} ostree --repo=repo pull no-collection-repo-remote rcommit2 ${CMD_PREFIX} ostree --repo=repo pull no-collection-repo-remote rcommit2
${CMD_PREFIX} ostree --repo=repo refs --collections > refs ${CMD_PREFIX} ostree --repo=repo refs --collections > refs
assert_not_file_has_content refs "rcommit2" assert_not_file_has_content refs "rcommit2"

View File

@ -30,20 +30,20 @@ $OSTREE remote add origin http://example.com/ostree/gnome
$OSTREE remote show-url origin >/dev/null $OSTREE remote show-url origin >/dev/null
echo "ok config" echo "ok config"
$OSTREE remote add --no-gpg-verify another http://another.com/repo $OSTREE remote add --no-sign-verify another http://another.com/repo
$OSTREE remote show-url another >/dev/null $OSTREE remote show-url another >/dev/null
echo "ok remote no gpg-verify" echo "ok remote no gpg-verify"
if $OSTREE remote add --no-gpg-verify another http://another.example.com/anotherrepo 2>err.txt; then if $OSTREE remote add --no-sign-verify another http://another.example.com/anotherrepo 2>err.txt; then
assert_not_reached "Adding duplicate remote unexpectedly succeeded" assert_not_reached "Adding duplicate remote unexpectedly succeeded"
fi fi
echo "ok" echo "ok"
$OSTREE remote add --if-not-exists --no-gpg-verify another http://another.example.com/anotherrepo $OSTREE remote add --if-not-exists --no-sign-verify another http://another.example.com/anotherrepo
$OSTREE remote show-url another >/dev/null $OSTREE remote show-url another >/dev/null
echo "ok" echo "ok"
$OSTREE remote add --if-not-exists --no-gpg-verify another-noexist http://another-noexist.example.com/anotherrepo $OSTREE remote add --if-not-exists --no-sign-verify another-noexist http://another-noexist.example.com/anotherrepo
$OSTREE remote show-url another-noexist >/dev/null $OSTREE remote show-url another-noexist >/dev/null
echo "ok" echo "ok"
@ -69,7 +69,7 @@ cd ${test_tmpdir}
rm -rf parent-repo rm -rf parent-repo
ostree_repo_init parent-repo ostree_repo_init parent-repo
$OSTREE config set core.parent ${test_tmpdir}/parent-repo $OSTREE config set core.parent ${test_tmpdir}/parent-repo
${CMD_PREFIX} ostree --repo=parent-repo remote add --no-gpg-verify parent-remote http://parent-remote.example.com/parent-remote ${CMD_PREFIX} ostree --repo=parent-repo remote add --no-sign-verify parent-remote http://parent-remote.example.com/parent-remote
$OSTREE remote list > list.txt $OSTREE remote list > list.txt
assert_file_has_content list.txt "origin" assert_file_has_content list.txt "origin"
assert_file_has_content list.txt "another" assert_file_has_content list.txt "another"

View File

@ -63,7 +63,7 @@ mkdir collection-repo
ostree_repo_init collection-repo --collection-id org.example.RemoteCollection ostree_repo_init collection-repo --collection-id org.example.RemoteCollection
mkdir -p adir mkdir -p adir
${CMD_PREFIX} ostree --repo=collection-repo commit --branch=rcommit -m rcommit -s rcommit adir ${CMD_PREFIX} ostree --repo=collection-repo commit --branch=rcommit -m rcommit -s rcommit adir
${CMD_PREFIX} ostree --repo=repo remote add --no-gpg-verify --collection-id org.example.RemoteCollection collection-repo-remote "file://${test_tmpdir}/collection-repo" ${CMD_PREFIX} ostree --repo=repo remote add --no-sign-verify --collection-id org.example.RemoteCollection collection-repo-remote "file://${test_tmpdir}/collection-repo"
${CMD_PREFIX} ostree --repo=repo pull collection-repo-remote rcommit ${CMD_PREFIX} ostree --repo=repo pull collection-repo-remote rcommit
${CMD_PREFIX} ostree --repo=repo summary --update ${CMD_PREFIX} ostree --repo=repo summary --update
@ -75,7 +75,7 @@ mkdir no-collection-repo
ostree_repo_init no-collection-repo ostree_repo_init no-collection-repo
mkdir -p adir2 mkdir -p adir2
${CMD_PREFIX} ostree --repo=no-collection-repo commit --branch=rcommit2 -m rcommit2 -s rcommit2 adir2 ${CMD_PREFIX} ostree --repo=no-collection-repo commit --branch=rcommit2 -m rcommit2 -s rcommit2 adir2
${CMD_PREFIX} ostree --repo=repo remote add --no-gpg-verify no-collection-repo-remote "file://${test_tmpdir}/no-collection-repo" ${CMD_PREFIX} ostree --repo=repo remote add --no-sign-verify no-collection-repo-remote "file://${test_tmpdir}/no-collection-repo"
${CMD_PREFIX} ostree --repo=repo pull no-collection-repo-remote rcommit2 ${CMD_PREFIX} ostree --repo=repo pull no-collection-repo-remote rcommit2
${CMD_PREFIX} ostree --repo=repo summary --update ${CMD_PREFIX} ostree --repo=repo summary --update