diff options
author | Fabian Groffen <grobian@gentoo.org> | 2019-06-13 13:24:22 +0200 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2019-06-13 13:24:22 +0200 |
commit | bcbcec8baad9790b8df4da526ad2d0cdd9f13fd1 (patch) | |
tree | bb70c99a8b63f400ad696a4ee306e420dec462bf /tests | |
parent | main: disable word wrapping when stdout is not a terminal (diff) | |
download | portage-utils-bcbcec8baad9790b8df4da526ad2d0cdd9f13fd1.tar.gz portage-utils-bcbcec8baad9790b8df4da526ad2d0cdd9f13fd1.tar.bz2 portage-utils-bcbcec8baad9790b8df4da526ad2d0cdd9f13fd1.zip |
tests/qmanifest: skip sign test if importing key fails
gnupg's socket path may be too long due to T being somewhere too deep,
so simply skip the signing test in that case
Bug: https://bugs.gentoo.org/687982
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/qmanifest/dotest | 21 | ||||
-rw-r--r-- | tests/qmanifest/manifest01.good | 8 |
2 files changed, 14 insertions, 15 deletions
diff --git a/tests/qmanifest/dotest b/tests/qmanifest/dotest index 525dc8b9..0770ed13 100755 --- a/tests/qmanifest/dotest +++ b/tests/qmanifest/dotest @@ -42,15 +42,11 @@ test 04 1 "qmanifest -d not_a_tree" # overlay test test 05 1 "qmanifest -o notatree" -# Travis uses old Ubuntu, and Ubuntu uses prehistoric gpg, which just -# won't work. Too bad, really. -if [[ ${TRAVIS_OS_NAME} != linux ]] ; then - # generate a valid tree rm -Rf testtree cp -r "${ROOT}/simpletree" testtree || echo try it anyway -export HOME=$(mktemp -d) # for gnupg home -mkdir "${HOME}"/.gnupg +export HOME=${PWD} # for gpgme/gnupg home +mkdir -p "${HOME}"/.gnupg # silence gpg warnings chmod -R og-rwx "${HOME}"/.gnupg @@ -68,8 +64,12 @@ gpg_import() { echo "${pass}" | gpg "${args[@]}" } -# import key -gpg_import "${as}"/key.gpg qmanifest +# import key, if this fails, skip the test, couple of reasons why this +# could fail: +# - Ubuntu uses old/ancient gnupg which doesn't grok arguments and key (Travis) +# - HOME (T) may be too long to hold a socket, especially on Linux this +# pathlength is very short, Portage's T may be too long by default +if gpg_import "${as}"/key.gpg qmanifest ; then # make it a fully valid tree rm testtree/my-cat/mypackage/unrecorded-file @@ -85,11 +85,10 @@ test 06 0 "echo ${KEYPASS} | qmanifest -g -s ${SIGNAS} -p testtree" rm -f gpgme.log test 07 0 "qmanifest testtree | sed -e '/Manifest timestamp/d' -e 's/made .* UTC by/made by/'" +fi # gpgimport + # shut down agents and whatnot gpgconf --kill all -rm -Rf "${HOME}" - -fi # TRAVIS_OS_NAME==Linux cleantmpdir diff --git a/tests/qmanifest/manifest01.good b/tests/qmanifest/manifest01.good index a9a087aa..f97ccedd 100644 --- a/tests/qmanifest/manifest01.good +++ b/tests/qmanifest/manifest01.good @@ -8,12 +8,12 @@ my-cat/mypackage/Manifest::mypackage-1.ebuild: expected: 237 my-cat/mypackage/Manifest::mypackage-2.ebuild: - BLAKE2B hash mismatch - computed: '2bcad0952735a0a5bf631fe1c65b...ea81babd2a90f3076daa1e6e62ecf042a0b' - Manifest: '2410d545e7441e6402c32ca3ce7e...9fb575bd6f74e7cd92e125181af722500a3' + computed: '2bcad0952735a0a5bf631fe1c65bc6eb96eb5511f52850e55a8ad9b80480a37ea4a4b01fc6f4f7ccd94942536be3cea81babd2a90f3076daa1e6e62ecf042a0b' + Manifest: '2410d545e7441e6402c32ca3ce7e80d6eda82306db1c7d9732ed35d273a20f0983a4a40b02492fbad4145cc776f249fb575bd6f74e7cd92e125181af722500a3' my-cat/mypackage/Manifest::mypackage-2.ebuild: - SHA512 hash mismatch - computed: 'baf9a3bf09b590997d77db13d171...548c3403ac9b2dc22cb78a3112305a68889' - Manifest: 'b22f73bd10773a7b01456a237b52...62307fba13d8b04988c5aeb417f2e286d61' + computed: 'baf9a3bf09b590997d77db13d171e9b104e8acd3687b5be9a8734f0d4680bc4c34f5d0612ba11c6f5d2d34e9b659f548c3403ac9b2dc22cb78a3112305a68889' + Manifest: 'b22f73bd10773a7b01456a237b5224226c4178cc0755d0e84c8b8597071683b148f3b9f56d8b5c7fb8e58f7e618fd62307fba13d8b04988c5aeb417f2e286d61' my-cat/mypackage/Manifest::mypackage-3.ebuild: - DATA file listed in Manifest, but not found my-cat/mypackage/Manifest: |