test: Move test support files to separate dir and keep tests in /test

Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
Jacques de Laval committed 2021-02-27 14:50:49 +01:00
1 parent 4aa17a84ab
commit 7fe1189f7b
15 files changed
+62 -65

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
#!/bin/sh
set -eu
TEST_DIR=$(dirname "$0"../)
TENV_ROOT="${TENV_ROOT:-$(pwd)/${TEST_DIR}/tenv-root}"
unshare=$(command -v unshare)
chroot=$(command -v chroot)
export PS1='\w \$ '
export PS2='> '
export PS3='#? '
export PS4='+ '
PATH="$TESTENV_PATH"
export PATH
# Not supported by Busybox unshare:
# --cgroup --time
exec "$unshare" \
--user --map-root-user \
--fork --pid --mount-proc \
--mount \
--mount-proc \
--uts --ipc --net \
"$chroot" "$TENV_ROOT" /bin/chrootsetup.sh "$@"