diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-09-13 22:16:32 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-09-14 15:22:19 +0200 |
commit | fecfbf2e4cbb71d20364306baf6aa7886c5f3ecd (patch) | |
tree | a8d2e078c7359e36895bbe6430fab1dccb7b0206 /test/integration/test-apt-key | |
parent | c5ede4cac6e6496ce19ccea3313ac6b49ba5e8d6 (diff) |
deal with spaces in path, command and filepaths in apt-key
Filenames we get could include spaces, but also the tmpdir we work in
and the failures we print in return a very generic and unhelpful…
Properly supporting spaces is a bit painful as we constructed gpg
command before, which is now moved to (multilevel) calls to temporary
scripts instead.
Diffstat (limited to 'test/integration/test-apt-key')
-rwxr-xr-x | test/integration/test-apt-key | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/test/integration/test-apt-key b/test/integration/test-apt-key index a1a0d883d..dbe01c153 100755 --- a/test/integration/test-apt-key +++ b/test/integration/test-apt-key @@ -47,7 +47,7 @@ APT::Key::RemovedKeys "./keys/rexexpired.pub";' > rootdir/etc/apt/apt.conf.d/apt testrun() { cleanplate - ln -sf ${TMPWORKINGDIRECTORY}/keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg + ln -sf "${TMPWORKINGDIRECTORY}/keys/joesixpack.pub" rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg msgtest 'Check that paths in list output are not' 'double-slashed' aptkey list 2>&1 | grep -q '//' && msgfail || msgpass @@ -125,7 +125,7 @@ gpg: unchanged: 1' aptkey --fakeroot update msgtest 'Test key removal with' 'single key in softlink' cleanplate - ln -s $(readlink -f ./keys/joesixpack.pub) rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg + ln -s "$(readlink -f ./keys/joesixpack.pub)" rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg testsuccess --nomsg aptkey --fakeroot del DBAC8DAE testempty aptkey list testfailure test -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg @@ -133,7 +133,8 @@ gpg: unchanged: 1' aptkey --fakeroot update cleanplate testsuccess aptkey --fakeroot add ./keys/joesixpack.pub - testsuccess aptkey --fakeroot add ./keys/marvinparanoid.pub + ln -sf "$(readlink -f ./keys/marvinparanoid.pub)" "./keys/marvin paránöid.pub" + testsuccess aptkey --fakeroot add "./keys/marvin paránöid.pub" testaptkeys 'Joe Sixpack' 'Marvin Paranoid' cp -a rootdir/etc/apt/trusted.gpg keys/testcase-multikey.pub # store for reuse @@ -146,7 +147,7 @@ gpg: unchanged: 1' aptkey --fakeroot update msgtest 'Test key removal with' 'multi key in softlink' cleanplate - ln -s $(readlink -f ./keys/testcase-multikey.pub) rootdir/etc/apt/trusted.gpg.d/multikey.gpg + ln -s "$(readlink -f ./keys/testcase-multikey.pub)" rootdir/etc/apt/trusted.gpg.d/multikey.gpg testsuccess --nomsg aptkey --fakeroot del DBAC8DAE testaptkeys 'Marvin Paranoid' testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~ @@ -225,13 +226,13 @@ setupgpgcommand() { msgmsg 'Force tests to be run with' "$1" testsuccess aptkey --readonly adv --version cp rootdir/tmp/testsuccess.output aptkey.version - testsuccess grep "^Executing: $1 --" aptkey.version + testsuccess grep "^gpg (GnuPG) $2\." aptkey.version } # run with default (whatever this is) testrun # run with … -setupgpgcommand 'gpg' +setupgpgcommand 'gpg' '1' testrun -setupgpgcommand 'gpg2' +setupgpgcommand 'gpg2' '2' testrun |