salt/tests/integration/mockbin/su
Roman Imankulov bc1650a085 Add "mockbin" directory and a fake "su" wrapper for tests
While performing integration tests, the "mockbin" directory is
inserted in the beginning of the $PATH environment variable.

This effectively means that every file placed in this directory will be
executed instead of real one from the system, which opens up the
opportunity to write more complex integration tests.

At the time the only wrapper for "su" command (used in "cmdmod") is
placed there.
2012-07-26 22:14:00 +06:00

13 lines
246 B
Bash
Executable File

#!/bin/bash
# "Fake" su command
#
# Just executes the command without changing effective uid. Used in integration
# tests.
while true; do
shift
test "x$1" == "x-c" && break
test "x$1" == "x" && break
done
shift
exec /bin/bash -c "$@"