diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-01-08 13:08:19 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-01-08 15:40:01 +0100 |
commit | 896f0ae857b693782658145e16e21a3054dd5280 (patch) | |
tree | 5ff11972ebd41dd1176cfe68c796f5cc8f226cf5 /test | |
parent | abec2980ef1ff051be14c26097a76b6429b3b7bc (diff) |
tests: limit autotest-functionname generation to sane characters
Some (older) versions of bash seem to be allergic to a method named
"aptautotest_grep_^apt" (note the caret). Unlikely that we are going to
write autotests for such commands so we could just skip those, but lets
instead just use "normal" characters in the names and strip the rest as
we already did with the (arguable more common) '-'.
Diffstat (limited to 'test')
-rw-r--r-- | test/integration/framework | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/integration/framework b/test/integration/framework index 430ee552d..c547032c2 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -95,7 +95,7 @@ msgfail() { if [ $# -gt 0 ] && [ -n "$1" ]; then printf "${CFAIL}FAIL: $*${CNORMAL}\n" >&2; else printf "${CFAIL}FAIL${CNORMAL}\n" >&2; fi if [ -n "$APT_DEBUG_TESTS" ]; then - APT_CONFIG="$(getaptconfig)" LD_LIBRARY_PATH="${LIBRARYPATH}:${LD_LIBRARY_PATH}" $SHELL + runapt $SHELL fi EXIT_CODE=$((EXIT_CODE+1)); } @@ -173,7 +173,7 @@ runapt() { 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}:${LD_LIBRARY_PATH}" "$CMD" "$@" } aptconfig() { runapt apt-config "$@"; } aptcache() { runapt apt-cache "$@"; } @@ -1842,7 +1842,7 @@ aptautotest() { local TESTCALL="$1" local CMD="$2" local FIRSTOPT="$3" - local AUTOTEST="aptautotest_$(echo "${CMD##*/}_${FIRSTOPT}" | tr -d '-')" + local AUTOTEST="aptautotest_$(echo "${CMD##*/}_${FIRSTOPT}" | tr -d -c 'A-za-z0-9')" if command -v $AUTOTEST >/dev/null; then shift 3 # save and restore the *.output files from other tests |