WIP: Unshare/Chroot test wrapper script

This commit is contained in:
Jacques de Laval
2021-02-17 16:20:17 +01:00
parent 352ffb1582
commit aa9a5fbb99
2 changed files with 24 additions and 0 deletions
Executable
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
set -eux
TEST_DIR=$(dirname "$0")
TESTS_ROOT="${TEST_DIR}/test_root"
cp "${TEST_DIR}/testwrapper.sh" "${TESTS_ROOT}/usr/local/bin/"
unshare \
--user --map-root-user \
--fork --pid --mount-proc \
--mount \
--mount-proc \
chroot "$TESTS_ROOT" /usr/local/bin/testwrapper.sh "$@"
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
set -eux
export PATH=/sbin:/bin
mount -t proc none /proc
exec "$@"