mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-17 20:05:24 +00:00
btrfs-progs: tests: add test console
Add a wrapper that sets up environment the same way a test would use it. Use it for quick prototyping or testing, the commands and output is logged. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
329ff544a4
commit
ac1e484a0a
1
.gitignore
vendored
1
.gitignore
vendored
@ -43,6 +43,7 @@ library-test
|
||||
library-test-static
|
||||
|
||||
/tests/*-tests-results.txt
|
||||
/tests/test-console.txt
|
||||
/tests/test.img
|
||||
|
||||
aclocal.m4
|
||||
|
23
tests/test-console.sh
Executable file
23
tests/test-console.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# a shell with test environment set up, logged commands and output
|
||||
|
||||
LANG=C
|
||||
SCRIPT_DIR=$(dirname $(readlink -f $0))
|
||||
TOP=$(readlink -f $SCRIPT_DIR/../)
|
||||
TEST_DEV=${TEST_DEV:-}
|
||||
RESULTS="$TOP/tests/test-console.txt"
|
||||
IMAGE="$TOP/tests/test.img"
|
||||
|
||||
source common
|
||||
source common.convert
|
||||
|
||||
setup_root_helper
|
||||
|
||||
echo "Eval loop in test environment (log: $RESULTS)"
|
||||
echo -e " ---------------------\nStarting session, `date`" >> "$RESULTS"
|
||||
echo -n "`pwd`> "
|
||||
while read x; do
|
||||
echo "COMMAND: $x" >> "$RESULTS"
|
||||
{ eval $x; } 2>&1 | tee -a "$RESULTS"
|
||||
echo -n "`pwd`> "
|
||||
done
|
Loading…
Reference in New Issue
Block a user