mirror of
https://github.com/troglobit/finit.git
synced 2026-10-30 12:50:34 +00:00
WIP: Unshare/Chroot test wrapper script
This commit is contained in:
1 parent
352ffb1582
commit
aa9a5fbb99
2 files changed
+24
No files matched your search
Executable
+15
@@ -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 "$@"
|
||||||
Executable
+9
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
export PATH=/sbin:/bin
|
||||||
|
|
||||||
|
mount -t proc none /proc
|
||||||
|
|
||||||
|
exec "$@"
|
||||||
Reference in new issue
Block a user