mirror of
https://github.com/troglobit/finit.git
synced 2026-10-31 13:00:32 +00:00
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:
1 parent
4aa17a84ab
commit
7fe1189f7b
15 files changed
+62
-65
No files matched your search
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
if [ "$#" -lt 2 ]; then
|
||||
echo "Usage:"
|
||||
echo " $0 [target-pid] [command [arguments]]"
|
||||
exit 1
|
||||
fi
|
||||
target="$1"
|
||||
shift
|
||||
|
||||
TEST_DIR=$(dirname "$0"../)
|
||||
TENV_ROOT="${TENV_ROOT:-$(pwd)/${TEST_DIR}/tenv-root}"
|
||||
|
||||
nsenter=$(command -v nsenter)
|
||||
chroot=$(command -v chroot)
|
||||
|
||||
export PS1='\w \$ '
|
||||
export PS2='> '
|
||||
export PS3='#? '
|
||||
export PS4='+ '
|
||||
|
||||
PATH="$TESTENV_PATH"
|
||||
export PATH
|
||||
|
||||
"$nsenter" \
|
||||
--preserve-credentials \
|
||||
--user \
|
||||
--mount \
|
||||
--uts \
|
||||
--ipc \
|
||||
--net \
|
||||
--pid \
|
||||
-w -t "$target" \
|
||||
"$chroot" "$TENV_ROOT" "$@"
|
||||
Reference in new issue
Block a user