aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xaux/tests-lib.sh8
-rwxr-xr-xtests/install-uninstall.sh2
-rwxr-xr-xtests/remotes.sh4
3 files changed, 11 insertions, 3 deletions
diff --git a/aux/tests-lib.sh b/aux/tests-lib.sh
index 0be4e6f..007282a 100755
--- a/aux/tests-lib.sh
+++ b/aux/tests-lib.sh
@@ -102,3 +102,11 @@ test_ok() {
# shellcheck disable=2059
printf " ${green}OK${end}.\n" >&2
}
+
+uuid() {
+ # Taken from:
+ # https://serverfault.com/a/799198
+ od -xN20 /dev/urandom | \
+ head -1 | \
+ awk '{OFS="-"; print $2$3,$4,$5,$6,$7$8$9}'
+}
diff --git a/tests/install-uninstall.sh b/tests/install-uninstall.sh
index f4340e2..c0b402a 100755
--- a/tests/install-uninstall.sh
+++ b/tests/install-uninstall.sh
@@ -3,7 +3,7 @@ set -u
. aux/tests-lib.sh
-TEST_DESTDIR="$PWD/tests/destdirs/$(uuidgen)"
+TEST_DESTDIR="$PWD/tests/destdirs/$(uuid)"
PATH="$TEST_DESTDIR/usr/local/bin:$PATH"
test_install_uninstall_targets() {
diff --git a/tests/remotes.sh b/tests/remotes.sh
index 06d3fdc..0b52513 100755
--- a/tests/remotes.sh
+++ b/tests/remotes.sh
@@ -3,12 +3,12 @@ set -u
. aux/tests-lib.sh
-TEST_PREFIX="$PWD/tests/prefix/$(uuidgen)"
+TEST_PREFIX="$PWD/tests/prefix/$(uuid)"
make PREFIX="$TEST_PREFIX" install 1>/dev/null
PATH="$PWD/tests:$TEST_PREFIX/bin:$PATH"
new_repo() {
- REPO="$PWD/tests/remotes/$(uuidgen)"
+ REPO="$PWD/tests/remotes/$(uuid)"
mkdir -p "$REPO"
cd "$REPO" || exit 1
git init > /dev/null