mirror of
https://github.com/troglobit/finit.git
synced 2026-10-22 11:36:07 +00:00
test: Add testenv_enter.sh to ease debugging testenv
The script testenv_enter.sh, by default, runs /bin/sh in the environment currently setup. A bit easier than copy pasting the old hint text printed before test run. Signed-off-by: Magnus Malm <magnusmalm@gmail.com>
This commit is contained in:
1 parent
4480010d4a
commit
3d01728d2e
3 files changed
+26
-1
No files matched your search
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
cmd=""
|
||||
if [ "$#" -lt 1 ]; then
|
||||
cmd="/bin/sh"
|
||||
else
|
||||
cmd=$1
|
||||
shift
|
||||
fi
|
||||
|
||||
PID_FILE=$(dirname "$0")/running_test.pid
|
||||
|
||||
if [ -f "$PID_FILE" ] ; then
|
||||
target=$(cat "$PID_FILE")
|
||||
target=$(pgrep -P "$target")
|
||||
else
|
||||
echo "No test running!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"$(dirname "$0")"/testenv_exec.sh "$target" "$cmd" "$@"
|
||||
Reference in new issue
Block a user