diff options
author | Denis Pynkin <denis.pynkin@collabora.com> | 2019-07-30 02:16:57 +0300 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2019-08-01 02:06:47 +0000 |
commit | 453ce83379364172206945fad78a3cbc2ae51df5 (patch) | |
tree | f8be3da5c00be005bd42144d7d234ab0a119de73 /tests/libtest.sh | |
parent | 8322e77a88d65f894698651caa7757cfd5c6edfa (diff) | |
download | ostree-453ce83379364172206945fad78a3cbc2ae51df5.tar.gz |
tests/gpg: fix the check of GPG support
Shell function `has_gpgme` shouldn't exit if GPG support is not detected
since it stop any test with error.
Added function `skip_without_gpgme` to skip the whole test if it is
useless without GPG support
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
Closes: #1889
Approved by: cgwalters
Diffstat (limited to 'tests/libtest.sh')
-rwxr-xr-x | tests/libtest.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/libtest.sh b/tests/libtest.sh index 632ccee8..8832e63c 100755 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -605,10 +605,18 @@ skip_without_experimental () { } has_gpgme () { + local ret ${CMD_PREFIX} ostree --version > version.txt - assert_file_has_content version.txt '- gpgme' + grep -q -e '- gpgme' version.txt + ret=$? rm -f version.txt - true + return ${ret} +} + +skip_without_gpgme() { + if ! has_gpgme; then + skip "no gpg support compiled in" + fi } # Find an appropriate gpg program to use. We want one that has the |