diff --git a/bin/tests/system/get_algorithms.py b/bin/tests/system/get_algorithms.py index 5429649758..9cd07d4857 100755 --- a/bin/tests/system/get_algorithms.py +++ b/bin/tests/system/get_algorithms.py @@ -111,7 +111,10 @@ def is_supported(alg: Algorithm) -> bool: f"{TESTCRYPTO} -q {alg.name}", shell=True, check=True, - env={"KEYGEN": KEYGEN}, + env={ + "KEYGEN": KEYGEN, + "TMPDIR": os.getenv("TMPDIR", "/tmp"), + }, stdout=subprocess.DEVNULL, ) except subprocess.CalledProcessError as exc: diff --git a/bin/tests/system/testcrypto.sh b/bin/tests/system/testcrypto.sh index 2be22f3652..ceaaf3726a 100755 --- a/bin/tests/system/testcrypto.sh +++ b/bin/tests/system/testcrypto.sh @@ -14,6 +14,7 @@ prog=$0 args="" quiet=0 +dir="" msg="cryptography" if test -z "$KEYGEN"; then @@ -74,9 +75,18 @@ if test -z "$alg"; then exit 1 fi +if test -n "$TMPDIR"; then + dir=$(mktemp -d "$TMPDIR/XXXXXX") + args="$args -K $dir" +fi + if $KEYGEN $args $alg foo > /dev/null 2>&1 then - rm -f Kfoo* + if test -z "$dir"; then + rm -f Kfoo* + else + rm -rf "$dir" + fi else if test $quiet -eq 0; then echo_i "This test requires support for $msg" >&2