From 3abb6a6a1e485b3bc899b64b0a1b7dc2db25a9c2 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 15 Dec 2015 17:20:26 +0100 Subject: tests: support spaces in path and TMPDIR This doesn't allow all tests to run cleanly, but it at least allows to write tests which could run successfully in such environments. Git-Dch: Ignore --- test/integration/framework | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index d52fcdf87..07b1f3236 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -169,11 +169,11 @@ runapt() { msgdebug "Executing: ${CCMD}$*${CDEBUG} " local CMD="$1" shift - case $CMD in + case "$CMD" in sh|aptitude|*/*|command) ;; *) CMD="${BUILDDIRECTORY}/$CMD";; esac - MALLOC_PERTURB_=21 MALLOC_CHECK_=2 APT_CONFIG="$(getaptconfig)" LD_LIBRARY_PATH=${LIBRARYPATH} $CMD "$@" + MALLOC_PERTURB_=21 MALLOC_CHECK_=2 APT_CONFIG="$(getaptconfig)" LD_LIBRARY_PATH=${LIBRARYPATH} "$CMD" "$@" } aptconfig() { runapt apt-config "$@"; } aptcache() { runapt apt-cache "$@"; } @@ -307,10 +307,8 @@ setupenvironment() { if [ -f "${TESTDIRECTORY}/${SOURCESSFILE}" ]; then cp "${TESTDIRECTORY}/${SOURCESSFILE}" aptarchive/Sources fi - for key in $(find "$TESTDIRECTORY" -name '*.pub' -o -name '*.sec'); do - cp "$key" keys/ - chmod 644 "$key" - done + find "$TESTDIRECTORY" \( -name '*.pub' -o -name '*.sec' \) -exec cp '{}' keys/ \; + chmod 644 keys/* ln -s "${TMPWORKINGDIRECTORY}/keys/joesixpack.pub" rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg echo "Dir \"${TMPWORKINGDIRECTORY}/rootdir\";" > aptconfig.conf @@ -330,11 +328,11 @@ setupenvironment() { cat > "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg" <> "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg" <> "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/gdb-dpkg" <$LOG 2>&1 ; then - cat $LOG + cat "$LOG" false fi waitforpidfile aptwebserver.pid -- cgit v1.2.3