summaryrefslogtreecommitdiff
path: root/tests/test-pull-collections.sh
diff options
context:
space:
mode:
authorDenis Pynkin <denis.pynkin@collabora.com>2019-07-30 02:39:12 +0300
committerAtomic Bot <atomic-devel@projectatomic.io>2019-08-01 02:06:47 +0000
commit3767d87107b74d121738c733ca37767494b6be9c (patch)
tree95ffee64a2a6bb54be21463f4a5864b42e15f70f /tests/test-pull-collections.sh
parent453ce83379364172206945fad78a3cbc2ae51df5 (diff)
downloadostree-3767d87107b74d121738c733ca37767494b6be9c.tar.gz
tests/gpg: fix GPG-dependent shell tests if no GPG support
Skip tests or run them without GPG-related functionality if GPGME wasn't enabled in a build time. Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com> Closes: #1889 Approved by: cgwalters
Diffstat (limited to 'tests/test-pull-collections.sh')
-rwxr-xr-xtests/test-pull-collections.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/test-pull-collections.sh b/tests/test-pull-collections.sh
index fd782af9..d1de5f88 100755
--- a/tests/test-pull-collections.sh
+++ b/tests/test-pull-collections.sh
@@ -34,7 +34,11 @@ do_commit() {
mkdir -p files
pushd files
- ${CMD_PREFIX} ostree --repo="../${repo}" commit -s "Test ${repo} commit for branch ${branch}" -b "${branch}" --gpg-homedir="${TEST_GPG_KEYHOME}" --gpg-sign="${TEST_GPG_KEYID_1}" "$@" > "../${branch}-checksum"
+ local GPG_ARGS=""
+ if has_gpgme; then
+ GPG_ARGS="--gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_1}"
+ fi
+ ${CMD_PREFIX} ostree --repo="../${repo}" commit -s "Test ${repo} commit for branch ${branch}" -b "${branch}" ${GPG_ARGS} "$@" > "../${branch}-checksum"
popd
}
@@ -42,7 +46,11 @@ do_summary() {
local repo=$1
shift 1
- ${CMD_PREFIX} ostree "--repo=${repo}" summary --update --gpg-homedir="${TEST_GPG_KEYHOME}" --gpg-sign="${TEST_GPG_KEYID_1}"
+ local GPG_ARGS=""
+ if has_gpgme; then
+ GPG_ARGS="--gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_1}"
+ fi
+ ${CMD_PREFIX} ostree "--repo=${repo}" summary --update ${GPG_ARGS}
}
do_collection_ref_show() {
@@ -96,7 +104,11 @@ do_remote_add() {
local remote_repo=$2
shift 2
- ${CMD_PREFIX} ostree "--repo=${repo}" remote add "${remote_repo}-remote" "file://$(pwd)/${remote_repo}" "$@" --gpg-import="${test_tmpdir}/gpghome/key1.asc"
+ local GPG_ARGS=""
+ if has_gpgme; then
+ GPG_ARGS="--gpg-import=${test_tmpdir}/gpghome/key1.asc"
+ fi
+ ${CMD_PREFIX} ostree "--repo=${repo}" remote add "${remote_repo}-remote" "file://$(pwd)/${remote_repo}" "$@" ${GPG_ARGS}
}
do_pull() {