mirror of
https://github.com/troglobit/finit.git
synced 2026-11-29 21:08:21 +00:00
test: Only mess with PATH inside test environment
This commit is contained in:
1 parent
3ebac3dece
commit
70964ccb35
4 files changed
+11
-2
No files matched your search
+2
-2
@@ -14,12 +14,12 @@ if [ ! -f "$srcdir"/../config.status ]; then
|
|||||||
cp "${srcdir}/test-root/Makefile" test-root/
|
cp "${srcdir}/test-root/Makefile" test-root/
|
||||||
make -C test-root/
|
make -C test-root/
|
||||||
config_h='./config.h'
|
config_h='./config.h'
|
||||||
echo "export PATH=/bin:/sbin" > test.env
|
echo "export TESTENV_PATH=/bin:/sbin" > test.env
|
||||||
else
|
else
|
||||||
make -C ../ DESTDIR="$(pwd)/test-root/" install
|
make -C ../ DESTDIR="$(pwd)/test-root/" install
|
||||||
FINITBIN=../../src/finit make -C test-root/
|
FINITBIN=../../src/finit make -C test-root/
|
||||||
config_h='../config.h'
|
config_h='../config.h'
|
||||||
echo "export PATH=/bin:/sbin:$PREFIX/sbin:$PREFIX/bin" > test.env
|
echo "export TESTENV_PATH=/bin:/sbin:$PREFIX/sbin:$PREFIX/bin" > test.env
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "export FINIT_CONF=$(grep FINIT_CONF $config_h | cut -d' ' -f3 | cut -d'"' -f2)" >> test.env
|
echo "export FINIT_CONF=$(grep FINIT_CONF $config_h | cut -d' ' -f3 | cut -d'"' -f2)" >> test.env
|
||||||
|
|||||||
@@ -20,4 +20,7 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
PATH="$TESTENV_PATH"
|
||||||
|
export PATH
|
||||||
|
|
||||||
"$(dirname "$0")"/testenv_exec.sh "$target" "$cmd" "$@"
|
"$(dirname "$0")"/testenv_exec.sh "$target" "$cmd" "$@"
|
||||||
@@ -21,6 +21,9 @@ export PS2='> '
|
|||||||
export PS3='#? '
|
export PS3='#? '
|
||||||
export PS4='+ '
|
export PS4='+ '
|
||||||
|
|
||||||
|
PATH="$TESTENV_PATH"
|
||||||
|
export PATH
|
||||||
|
|
||||||
"$nsenter" \
|
"$nsenter" \
|
||||||
--preserve-credentials \
|
--preserve-credentials \
|
||||||
--user \
|
--user \
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ export PS2='> '
|
|||||||
export PS3='#? '
|
export PS3='#? '
|
||||||
export PS4='+ '
|
export PS4='+ '
|
||||||
|
|
||||||
|
PATH="$TESTENV_PATH"
|
||||||
|
export PATH
|
||||||
|
|
||||||
# Not supported by Busybox unshare:
|
# Not supported by Busybox unshare:
|
||||||
# --cgroup --time
|
# --cgroup --time
|
||||||
exec "$unshare" \
|
exec "$unshare" \
|
||||||
|
|||||||
Reference in new issue
Block a user