run-unit-test-docker.sh: Use mktemp for temporary directories
Don't try to hand-roll the equivalent.
Tested: Ran /bin/bash -n on the script, parsed without failure.
Change-Id: Idb5bcd1300b4158e1cc22964003792f9658de47e
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/run-unit-test-docker.sh b/run-unit-test-docker.sh
index 3d354e8..0a2ed9c 100755
--- a/run-unit-test-docker.sh
+++ b/run-unit-test-docker.sh
@@ -12,7 +12,7 @@
# Default variables
DOCKER_IMG_NAME="openbmc/ubuntu-unit-test"
DISTRO=${DISTRO:-ubuntu:latest}
-WORKSPACE=${WORKSPACE:-${TMP}/unit-test${RANDOM}}
+WORKSPACE=${WORKSPACE:-$(mktemp -d --tmpdir unit-test.XXXXXX)}
OBMC_BUILD_SCRIPTS="openbmc-build-scripts"
UNIT_TEST_PY_DIR="scripts"
UNIT_TEST_PY="unit-test.py"