summaryrefslogtreecommitdiff
path: root/automated/linux
diff options
context:
space:
mode:
authorDaniel Díaz <daniel.diaz@linaro.org>2017-02-15 18:56:15 -0600
committerDaniel Díaz <daniel.diaz@linaro.org>2017-02-18 11:42:44 -0600
commit6f49a1bbb11e50165dd17c4f67f49d8f10c01144 (patch)
tree187cc518529689b3bed0c284f9fe7b7de1d22a6c /automated/linux
parent2dbdbea604bb139a8e5ad279bbe0d8d3e924fb22 (diff)
automated: use create_out_dir where appropriate
Change-Id: I10181a7d1ebc53491085d80d67f0cd8f9e43071d Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Diffstat (limited to 'automated/linux')
-rwxr-xr-xautomated/linux/apache-apache-bench/apache-bench.sh3
-rwxr-xr-xautomated/linux/blogbench/blogbench.sh3
-rwxr-xr-xautomated/linux/busybox/busybox.sh3
-rwxr-xr-xautomated/linux/cyclictest/cyclictest.sh3
-rwxr-xr-xautomated/linux/dd-wr-speed/dd-wr-speed.sh3
-rwxr-xr-xautomated/linux/device-read-perf/device-read-perf.sh3
-rwxr-xr-xautomated/linux/device-tree/device-tree.sh3
-rwxr-xr-xautomated/linux/disk/disk-partitioning.sh3
-rwxr-xr-xautomated/linux/docker/docker.sh3
-rwxr-xr-xautomated/linux/dsdbench/dsdbench.sh2
-rwxr-xr-xautomated/linux/ethernet/ethernet.sh3
-rwxr-xr-xautomated/linux/fio-test/fio-test.sh3
-rwxr-xr-xautomated/linux/hackbench/hackbench.sh3
-rwxr-xr-xautomated/linux/iperf/iperf.sh3
-rwxr-xr-xautomated/linux/isolate-task/isolate-task-verify.sh3
-rwxr-xr-xautomated/linux/kernel-compilation/kernel-compilation.sh3
-rwxr-xr-xautomated/linux/lamp/lamp.sh3
-rwxr-xr-xautomated/linux/lemp/lemp.sh3
-rwxr-xr-xautomated/linux/libhugetlbfs/libhugetlbfs.sh3
-rwxr-xr-xautomated/linux/linpack/linpack.sh3
-rwxr-xr-xautomated/linux/lmbench/lmbench-memory.sh3
-rwxr-xr-xautomated/linux/lshw/lshw.sh3
-rwxr-xr-xautomated/linux/ltp-realtime/ltp-realtime.sh3
-rwxr-xr-xautomated/linux/ltp/ltp.sh3
-rwxr-xr-xautomated/linux/mmc/mmc-test.sh3
-rwxr-xr-xautomated/linux/network-basic/network-basic.sh3
-rwxr-xr-xautomated/linux/nginx-apache-bench/apache-bench.sh3
-rwxr-xr-xautomated/linux/openjdk/openjdk-smoke.sh3
-rwxr-xr-xautomated/linux/openssh/openssh-debian.sh3
-rwxr-xr-xautomated/linux/openssl/openssl-speed.sh3
-rwxr-xr-xautomated/linux/optee/optee-xtest.sh3
-rwxr-xr-xautomated/linux/pi-stress/pi-stress.sh3
-rwxr-xr-xautomated/linux/pointer-tagging/pointer-tagging-tests.sh3
-rwxr-xr-xautomated/linux/rt-migrate-test/rt-migrate-test.sh3
-rwxr-xr-xautomated/linux/signaltest/signaltest.sh3
-rwxr-xr-xautomated/linux/smoke/smoke.sh3
-rwxr-xr-xautomated/linux/stream/stream-uniprocessor.sh3
-rwxr-xr-xautomated/linux/sysbench/sysbench.sh3
-rwxr-xr-xautomated/linux/toolchain-smoke/toolchain-smoke.sh3
-rwxr-xr-xautomated/linux/ui-browser-test/ui-browser-test.sh3
-rwxr-xr-xautomated/linux/unixbench/unixbench.sh3
-rwxr-xr-xautomated/linux/usb-smoke/usb-smoke-test.sh3
42 files changed, 42 insertions, 83 deletions
diff --git a/automated/linux/apache-apache-bench/apache-bench.sh b/automated/linux/apache-apache-bench/apache-bench.sh
index 2395efc..22d66a1 100755
--- a/automated/linux/apache-apache-bench/apache-bench.sh
+++ b/automated/linux/apache-apache-bench/apache-bench.sh
@@ -23,8 +23,7 @@ while getopts "s:n:c:" o; do
done
! check_root && error_msg "This script must be run as root"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
# Install apache and use systemctl for service management. Tested on Ubuntu 16.04,
# Debian 8, CentOS 7 and Fedora 24. systemctl should available on newer releases
diff --git a/automated/linux/blogbench/blogbench.sh b/automated/linux/blogbench/blogbench.sh
index b07d9f9..a09e750 100755
--- a/automated/linux/blogbench/blogbench.sh
+++ b/automated/linux/blogbench/blogbench.sh
@@ -21,8 +21,7 @@ while getopts "i:p:h" o; do
done
! check_root && error_msg "You need to be root to run this script."
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
# Set the directory for blogbench test.
if [ -n "${PARTITION}" ]; then
diff --git a/automated/linux/busybox/busybox.sh b/automated/linux/busybox/busybox.sh
index a34a636..a11b2c0 100755
--- a/automated/linux/busybox/busybox.sh
+++ b/automated/linux/busybox/busybox.sh
@@ -8,8 +8,7 @@ OUTPUT="$(pwd)/output"
RESULT_FILE="${OUTPUT}/result.txt"
export RESULT_FILE
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
cd "${OUTPUT}" || exit 1
busybox
diff --git a/automated/linux/cyclictest/cyclictest.sh b/automated/linux/cyclictest/cyclictest.sh
index 7586a84..20caa2e 100755
--- a/automated/linux/cyclictest/cyclictest.sh
+++ b/automated/linux/cyclictest/cyclictest.sh
@@ -31,8 +31,7 @@ while getopts ":p:i:t:l:" opt; do
done
! check_root && error_msg "Please run this script as root."
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
# Run cyclictest.
detect_abi
diff --git a/automated/linux/dd-wr-speed/dd-wr-speed.sh b/automated/linux/dd-wr-speed/dd-wr-speed.sh
index d3e4946..4995f1e 100755
--- a/automated/linux/dd-wr-speed/dd-wr-speed.sh
+++ b/automated/linux/dd-wr-speed/dd-wr-speed.sh
@@ -137,8 +137,7 @@ parse_output() {
# Test run.
! check_root && error_msg "This script must be run as root"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
info_msg "About to run dd test..."
info_msg "Output directory: ${OUTPUT}"
diff --git a/automated/linux/device-read-perf/device-read-perf.sh b/automated/linux/device-read-perf/device-read-perf.sh
index dd00a2d..17b072f 100755
--- a/automated/linux/device-read-perf/device-read-perf.sh
+++ b/automated/linux/device-read-perf/device-read-perf.sh
@@ -19,8 +19,7 @@ while getopts "d:s:" o; do
done
! check_root && error_msg "You need to be root to run this script."
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
install_deps "hdparm" "${SKIP_INSTALL}"
diff --git a/automated/linux/device-tree/device-tree.sh b/automated/linux/device-tree/device-tree.sh
index f2deea2..5f4e15a 100755
--- a/automated/linux/device-tree/device-tree.sh
+++ b/automated/linux/device-tree/device-tree.sh
@@ -53,8 +53,7 @@ device_tree_property() {
# Test run.
! check_root && error_msg "This script must be run as root"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
if [ -f /proc/config.gz ]
then
diff --git a/automated/linux/disk/disk-partitioning.sh b/automated/linux/disk/disk-partitioning.sh
index 92b7934..e0c7033 100755
--- a/automated/linux/disk/disk-partitioning.sh
+++ b/automated/linux/disk/disk-partitioning.sh
@@ -79,8 +79,7 @@ disk_mount() {
# Test run.
[ -b "${DEVICE}" ] || error_msg "Please specify a block device with '-d'"
! check_root && error_msg "You need to be root to run this script."
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
pkgs="parted e2fsprogs dosfstools"
install_deps "${pkgs}" "${SKIP_INSTALL}"
diff --git a/automated/linux/docker/docker.sh b/automated/linux/docker/docker.sh
index bebf482..e656bb0 100755
--- a/automated/linux/docker/docker.sh
+++ b/automated/linux/docker/docker.sh
@@ -20,8 +20,7 @@ while getopts "i:h" o; do
done
! check_root && error_msg "You need to be root to run this script."
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
dist_name
# shellcheck disable=SC2154
diff --git a/automated/linux/dsdbench/dsdbench.sh b/automated/linux/dsdbench/dsdbench.sh
index 4b8f4cf..155bc1d 100755
--- a/automated/linux/dsdbench/dsdbench.sh
+++ b/automated/linux/dsdbench/dsdbench.sh
@@ -32,7 +32,7 @@ esac
install_deps "${pkgs}" "${SKIP_INSTALL}"
! check_root && error_msg "You need to be root to run this script."
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
+create_out_dir "${OUTPUT}"
mkdir -p "${OUTPUT}/golang"
cd "${OUTPUT}"
export GOPATH="${OUTPUT}/golang"
diff --git a/automated/linux/ethernet/ethernet.sh b/automated/linux/ethernet/ethernet.sh
index 67f7e28..181fa9c 100755
--- a/automated/linux/ethernet/ethernet.sh
+++ b/automated/linux/ethernet/ethernet.sh
@@ -26,8 +26,7 @@ done
# Test run.
! check_root && error_msg "This script must be run as root"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
pkgs="net-tools"
install_deps "${pkgs}" "${SKIP_INSTALL}"
diff --git a/automated/linux/fio-test/fio-test.sh b/automated/linux/fio-test/fio-test.sh
index 4a70756..fa91af2 100755
--- a/automated/linux/fio-test/fio-test.sh
+++ b/automated/linux/fio-test/fio-test.sh
@@ -81,8 +81,7 @@ fio_test() {
# Config test.
! check_root && error_msg "This script must be run as root"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
# Enter test directory.
if [ -n "${PARTITION}" ]; then
diff --git a/automated/linux/hackbench/hackbench.sh b/automated/linux/hackbench/hackbench.sh
index 80eb1e8..48ded0f 100755
--- a/automated/linux/hackbench/hackbench.sh
+++ b/automated/linux/hackbench/hackbench.sh
@@ -32,8 +32,7 @@ while getopts "i:t:s:l:g:f:p:T:h" o; do
esac
done
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
TEST_LOG="${OUTPUT}/hackbench-output-${TARGET}.txt"
# Determine hackbench test options.
diff --git a/automated/linux/iperf/iperf.sh b/automated/linux/iperf/iperf.sh
index 0dd230f..1abc8e1 100755
--- a/automated/linux/iperf/iperf.sh
+++ b/automated/linux/iperf/iperf.sh
@@ -32,8 +32,7 @@ while getopts "c:t:p:v:s:h" o; do
esac
done
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
cd "${OUTPUT}"
if [ "${SKIP_INSTALL}" = "true" ] || [ "${SKIP_INSTALL}" = "True" ]; then
diff --git a/automated/linux/isolate-task/isolate-task-verify.sh b/automated/linux/isolate-task/isolate-task-verify.sh
index 91e4619..2b3b10c 100755
--- a/automated/linux/isolate-task/isolate-task-verify.sh
+++ b/automated/linux/isolate-task/isolate-task-verify.sh
@@ -29,8 +29,7 @@ OUTPUT="$(pwd)/output"
RESULT_FILE="${OUTPUT}/result.txt"
TEST_LOG="${OUTPUT}/isolation-test-output.txt"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
if [ "${SKIP_INSTALL}" = "false" ] || [ "${SKIP_INSTALL}" = "False" ]; then
install_deps "git stress cpuset gzip"
diff --git a/automated/linux/kernel-compilation/kernel-compilation.sh b/automated/linux/kernel-compilation/kernel-compilation.sh
index b9b8d2a..5e5586e 100755
--- a/automated/linux/kernel-compilation/kernel-compilation.sh
+++ b/automated/linux/kernel-compilation/kernel-compilation.sh
@@ -33,8 +33,7 @@ esac
# It will skip package installation on other distributions by default.
install_deps "${pkgs}" "${SKIP_INSTALL}"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
cd "${OUTPUT}"
# Download and extract Kernel tarball.
diff --git a/automated/linux/lamp/lamp.sh b/automated/linux/lamp/lamp.sh
index f2197a1..32d7af5 100755
--- a/automated/linux/lamp/lamp.sh
+++ b/automated/linux/lamp/lamp.sh
@@ -19,8 +19,7 @@ while getopts "s:" o; do
done
! check_root && error_msg "This script must be run as root"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
# Install lamp and use systemctl for service management. Tested on Ubuntu 16.04,
# Debian 8, CentOS 7 and Fedora 24. systemctl should available on newer releases
diff --git a/automated/linux/lemp/lemp.sh b/automated/linux/lemp/lemp.sh
index 06be62f..11d9840 100755
--- a/automated/linux/lemp/lemp.sh
+++ b/automated/linux/lemp/lemp.sh
@@ -10,8 +10,7 @@ TEST_LIST="test-nginx-server mysql-show-databases test-phpinfo
php-select-record php-delete-record"
! check_root && error_msg "This script must be run as root"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
dist_name
# Install and configure LEMP.
diff --git a/automated/linux/libhugetlbfs/libhugetlbfs.sh b/automated/linux/libhugetlbfs/libhugetlbfs.sh
index 9d6db37..ad09407 100755
--- a/automated/linux/libhugetlbfs/libhugetlbfs.sh
+++ b/automated/linux/libhugetlbfs/libhugetlbfs.sh
@@ -97,8 +97,7 @@ install() {
# Test run.
! check_root && error_msg "This script must be run as root"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
# shellcheck disable=SC2164
cd "${OUTPUT}"
diff --git a/automated/linux/linpack/linpack.sh b/automated/linux/linpack/linpack.sh
index d99af91..128240b 100755
--- a/automated/linux/linpack/linpack.sh
+++ b/automated/linux/linpack/linpack.sh
@@ -18,8 +18,7 @@ while getopts "a:" o; do
esac
done
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
# Run Test.
info_msg "Running linpack with array size ${ARRAY_SIZE}..."
diff --git a/automated/linux/lmbench/lmbench-memory.sh b/automated/linux/lmbench/lmbench-memory.sh
index e8cf121..b251643 100755
--- a/automated/linux/lmbench/lmbench-memory.sh
+++ b/automated/linux/lmbench/lmbench-memory.sh
@@ -41,8 +41,7 @@ latency_test() {
}
# Test run.
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
detect_abi
bandwidth_test
diff --git a/automated/linux/lshw/lshw.sh b/automated/linux/lshw/lshw.sh
index 4017488..dcc4114 100755
--- a/automated/linux/lshw/lshw.sh
+++ b/automated/linux/lshw/lshw.sh
@@ -26,8 +26,7 @@ while getopts ':s:c:' opt; do
done
! check_root && error_msg "lshw must be run as super user or it will only report partial information."
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
install_deps "lshw" "${SKIP_INSTALL}"
diff --git a/automated/linux/ltp-realtime/ltp-realtime.sh b/automated/linux/ltp-realtime/ltp-realtime.sh
index fda708a..f670ef0 100755
--- a/automated/linux/ltp-realtime/ltp-realtime.sh
+++ b/automated/linux/ltp-realtime/ltp-realtime.sh
@@ -61,8 +61,7 @@ run_ltp_realtime() {
# Test run.
! check_root && error_msg "This script must be run as root"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
info_msg "About to run ltp realtime test..."
info_msg "Output directory: ${OUTPUT}"
diff --git a/automated/linux/ltp/ltp.sh b/automated/linux/ltp/ltp.sh
index 7788d81..44ed94d 100755
--- a/automated/linux/ltp/ltp.sh
+++ b/automated/linux/ltp/ltp.sh
@@ -80,8 +80,7 @@ run_ltp() {
# Test run.
! check_root && error_msg "This script must be run as root"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
info_msg "About to run ltp test..."
info_msg "Output directory: ${OUTPUT}"
diff --git a/automated/linux/mmc/mmc-test.sh b/automated/linux/mmc/mmc-test.sh
index 2461e20..6736056 100755
--- a/automated/linux/mmc/mmc-test.sh
+++ b/automated/linux/mmc/mmc-test.sh
@@ -36,8 +36,7 @@ list_all_mmc_devices() {
# Test run.
! check_root && error_msg "This script must be run as root"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
info_msg "About to run MMC test..."
info_msg "Output directory: ${OUTPUT}"
diff --git a/automated/linux/network-basic/network-basic.sh b/automated/linux/network-basic/network-basic.sh
index 25b6204..b17a92c 100755
--- a/automated/linux/network-basic/network-basic.sh
+++ b/automated/linux/network-basic/network-basic.sh
@@ -36,8 +36,7 @@ run() {
}
# Test run.
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
install
diff --git a/automated/linux/nginx-apache-bench/apache-bench.sh b/automated/linux/nginx-apache-bench/apache-bench.sh
index 88752e6..3bdccfc 100755
--- a/automated/linux/nginx-apache-bench/apache-bench.sh
+++ b/automated/linux/nginx-apache-bench/apache-bench.sh
@@ -24,8 +24,7 @@ while getopts "s:n:c:" o; do
done
! check_root && error_msg "This script must be run as root"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
dist_name
# Install and configure LEMP.
diff --git a/automated/linux/openjdk/openjdk-smoke.sh b/automated/linux/openjdk/openjdk-smoke.sh
index 2489198..3aa91ff 100755
--- a/automated/linux/openjdk/openjdk-smoke.sh
+++ b/automated/linux/openjdk/openjdk-smoke.sh
@@ -20,8 +20,7 @@ while getopts "v:s:" o; do
done
! check_root && error_msg "You need to be root to run this script."
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
if [ "${SKIP_INSTALL}" = "True" ] || [ "${SKIP_INSTALL}" = "true" ]; then
info_msg "JDK package installation skipped"
diff --git a/automated/linux/openssh/openssh-debian.sh b/automated/linux/openssh/openssh-debian.sh
index 8a031ec..0053118 100755
--- a/automated/linux/openssh/openssh-debian.sh
+++ b/automated/linux/openssh/openssh-debian.sh
@@ -28,8 +28,7 @@ done
# Test run.
! check_root && error_msg "This script must be run as root"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
pkgs="build-essential"
install_deps "${pkgs}" "${SKIP_INSTALL}"
diff --git a/automated/linux/openssl/openssl-speed.sh b/automated/linux/openssl/openssl-speed.sh
index 431ab97..a70db1b 100755
--- a/automated/linux/openssl/openssl-speed.sh
+++ b/automated/linux/openssl/openssl-speed.sh
@@ -17,8 +17,7 @@ while getopts "s:" o; do
done
! check_root && error_msg "You need to be root to run this script."
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
pkgs="openssl"
install_deps "${pkgs}" "${SKIP_INSTALL}"
diff --git a/automated/linux/optee/optee-xtest.sh b/automated/linux/optee/optee-xtest.sh
index f84afe4..03ed02f 100755
--- a/automated/linux/optee/optee-xtest.sh
+++ b/automated/linux/optee/optee-xtest.sh
@@ -46,8 +46,7 @@ parser() {
}
# Test run.
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
command -v tee-supplicant && command -v xtest
exit_on_fail "xtest-existence-check"
diff --git a/automated/linux/pi-stress/pi-stress.sh b/automated/linux/pi-stress/pi-stress.sh
index ed99e7c..390ffdc 100755
--- a/automated/linux/pi-stress/pi-stress.sh
+++ b/automated/linux/pi-stress/pi-stress.sh
@@ -29,8 +29,7 @@ while getopts ":d:m:r:" opt; do
done
! check_root && error_msg "Please run this script as root."
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
if "${MLOCKALL}"; then
MLOCKALL="--mlockall"
diff --git a/automated/linux/pointer-tagging/pointer-tagging-tests.sh b/automated/linux/pointer-tagging/pointer-tagging-tests.sh
index 51c30b5..310cc54 100755
--- a/automated/linux/pointer-tagging/pointer-tagging-tests.sh
+++ b/automated/linux/pointer-tagging/pointer-tagging-tests.sh
@@ -34,8 +34,7 @@ pointer_tagging_build_test() {
# Test run.
! check_root && error_msg "This script must be run as root"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
info_msg "About to run pointer-tagging-tests test..."
info_msg "Output directory: ${OUTPUT}"
diff --git a/automated/linux/rt-migrate-test/rt-migrate-test.sh b/automated/linux/rt-migrate-test/rt-migrate-test.sh
index aec379e..1c4ae68 100755
--- a/automated/linux/rt-migrate-test/rt-migrate-test.sh
+++ b/automated/linux/rt-migrate-test/rt-migrate-test.sh
@@ -22,8 +22,7 @@ while getopts ":l:" opt; do
done
! check_root && error_msg "Please run this script as root."
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
# Run rt-migrate-test.
detect_abi
diff --git a/automated/linux/signaltest/signaltest.sh b/automated/linux/signaltest/signaltest.sh
index b3b8b1a..0e49c2f 100755
--- a/automated/linux/signaltest/signaltest.sh
+++ b/automated/linux/signaltest/signaltest.sh
@@ -27,8 +27,7 @@ while getopts ":p:t:l:" opt; do
done
! check_root && error_msg "Please run this script as root."
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
# Run signaltest.
detect_abi
diff --git a/automated/linux/smoke/smoke.sh b/automated/linux/smoke/smoke.sh
index d25dbb5..39548c7 100755
--- a/automated/linux/smoke/smoke.sh
+++ b/automated/linux/smoke/smoke.sh
@@ -39,8 +39,7 @@ run() {
}
# Test run.
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
install
run "pwd"
diff --git a/automated/linux/stream/stream-uniprocessor.sh b/automated/linux/stream/stream-uniprocessor.sh
index 3b0edab..b728c16 100755
--- a/automated/linux/stream/stream-uniprocessor.sh
+++ b/automated/linux/stream/stream-uniprocessor.sh
@@ -5,8 +5,7 @@ OUTPUT="$(pwd)/output"
RESULT_FILE="${OUTPUT}/result.txt"
TEST_LOG="${OUTPUT}/stream-output.txt"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
# Run Test.
detect_abi
diff --git a/automated/linux/sysbench/sysbench.sh b/automated/linux/sysbench/sysbench.sh
index 9b88969..8a00613 100755
--- a/automated/linux/sysbench/sysbench.sh
+++ b/automated/linux/sysbench/sysbench.sh
@@ -50,8 +50,7 @@ install_sysbench() {
}
! check_root && error_msg "Please run this script as root."
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
cd "${OUTPUT}"
# Test installation.
diff --git a/automated/linux/toolchain-smoke/toolchain-smoke.sh b/automated/linux/toolchain-smoke/toolchain-smoke.sh
index 7cdead1..4a045a6 100755
--- a/automated/linux/toolchain-smoke/toolchain-smoke.sh
+++ b/automated/linux/toolchain-smoke/toolchain-smoke.sh
@@ -31,8 +31,7 @@ install() {
}
! check_root && error_msg "You need to be root to run this script."
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
cd "${OUTPUT}"
install
diff --git a/automated/linux/ui-browser-test/ui-browser-test.sh b/automated/linux/ui-browser-test/ui-browser-test.sh
index f40cbf9..ad47f5c 100755
--- a/automated/linux/ui-browser-test/ui-browser-test.sh
+++ b/automated/linux/ui-browser-test/ui-browser-test.sh
@@ -55,8 +55,7 @@ fi
pkgs="python2.7 python-pip python-lxml"
install_deps "${pkgs}" "${SKIP_INSTALL}"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
dist_name
# shellcheck disable=SC2154
diff --git a/automated/linux/unixbench/unixbench.sh b/automated/linux/unixbench/unixbench.sh
index e81aa52..75af832 100755
--- a/automated/linux/unixbench/unixbench.sh
+++ b/automated/linux/unixbench/unixbench.sh
@@ -17,8 +17,7 @@ while getopts 's:h' opt; do
done
! check_root && error_msg "Please run this script as root."
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
cd "${OUTPUT}"
install_deps "git gcc perl" "${SKIP_INSTALL}"
diff --git a/automated/linux/usb-smoke/usb-smoke-test.sh b/automated/linux/usb-smoke/usb-smoke-test.sh
index 4a1efea..bca780e 100755
--- a/automated/linux/usb-smoke/usb-smoke-test.sh
+++ b/automated/linux/usb-smoke/usb-smoke-test.sh
@@ -96,8 +96,7 @@ print_supported_usb_speeds() {
# Test run.
! check_root && error_msg "This script must be run as root"
-[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
-mkdir -p "${OUTPUT}"
+create_out_dir "${OUTPUT}"
info_msg "About to run USB test..."
info_msg "Output directory: ${OUTPUT}"