mirror of
https://github.com/troglobit/finit.git
synced 2026-10-08 16:34:45 +07:00
20 lines
452 B
Bash
Executable File
20 lines
452 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
TEST_DIR=$(dirname "$0")
|
|
TESTS_ROOT="$(pwd)/${TEST_DIR}/test_root"
|
|
|
|
echo "Hint: Execute './test/testenter.sh \$(pgrep -P $$) /bin/sh; reset' to enter the test namespace"
|
|
|
|
# Not supported by Busybox unshare:
|
|
# --cgroup --time
|
|
export PATH=/sbin:/bin
|
|
exec unshare \
|
|
--user --map-root-user \
|
|
--fork --pid --mount-proc \
|
|
--mount \
|
|
--mount-proc \
|
|
--uts --ipc --net \
|
|
chroot "$TESTS_ROOT" /bin/testwrapper.sh "$@"
|