File: test-console.sh

package info (click to toggle)
btrfs-progs 6.2-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 17,244 kB
  • sloc: ansic: 114,376; sh: 9,576; python: 1,242; makefile: 820
file content (25 lines) | stat: -rwxr-xr-x 612 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# 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_TOP="$TOP/tests"
INTERNAL_BIN="$TOP"
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