diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-forkoff-env_i.sh | 30 | ||||
-rwxr-xr-x | test/test-forkoff.sh | 18 |
2 files changed, 48 insertions, 0 deletions
diff --git a/test/test-forkoff-env_i.sh b/test/test-forkoff-env_i.sh new file mode 100755 index 0000000..1e679aa --- /dev/null +++ b/test/test-forkoff-env_i.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Verify normal operation... +uid=`env -i id -u` +gid=`env -i id -g` +if [ $uid -ne 0 -o $gid -ne 0 ]; then + exit 1 +fi + +export PSEUDO_DISABLED=1 +# Verify we dropped OUT of pseudo control, even with env -i +# This checks that env -i replacement functionality still works +# as expected +uid=`env -i id -u` +gid=`env -i id -g` +if [ $uid -eq 0 -o $gid -eq 0 ]; then + exit 1 +fi + +export PSEUDO_DISABLED=1 +# Verify we can change PSEUDO_DISABLED, even with env -i +# This checks that env -i replacement functionality still works +# as expected +uid=`env -i PSEUDO_DISABLED=0 id -u` +gid=`env -i PSEUDO_DISABLED=0 id -g` +if [ $uid -ne 0 -o $gid -ne 0 ]; then + exit 1 +fi + +exit 0 diff --git a/test/test-forkoff.sh b/test/test-forkoff.sh new file mode 100755 index 0000000..13a42a4 --- /dev/null +++ b/test/test-forkoff.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Verify normal operation... +uid=`id -u` +gid=`id -g` +if [ $uid -ne 0 -o $gid -ne 0 ]; then + exit 1 +fi + +export PSEUDO_DISABLED=1 +# Verify we dropped OUT of pseudo control +uid=`id -u` +gid=`id -g` +if [ $uid -eq 0 -o $gid -eq 0 ]; then + exit 1 +fi + +exit 0 |