Skip to content

Commit 6aac531

Browse files
committed
Add an option to disable resetting the terminal
1 parent 0ab5c33 commit 6aac531

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

testing/run.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ Usage: $0 [options]
1717
-v Set type of qemu display to use
1818
-D Set test directory
1919
-i Write SSH config include
20+
-n Do not reset the controlling terminal after the VM exits
2021
EOF
2122
}
2223

23-
CMDOPTS="D:A:a:d:fsv:hi"
24+
CMDOPTS="D:A:a:d:fsv:hin"
2425

2526
# First-pass option parsing just looks for test directory
2627
while getopts "${CMDOPTS}" opt; do
@@ -83,6 +84,7 @@ CREATE=0
8384
SERIAL=0
8485
DISPLAY_TYPE=
8586
SSH_INCLUDE=0
87+
RESET=1
8688

8789
# Override any default variables
8890
#shellcheck disable=SC1091
@@ -120,6 +122,9 @@ while getopts "${CMDOPTS}" opt; do
120122
i)
121123
SSH_INCLUDE=1
122124
;;
125+
n)
126+
RESET=0
127+
;;
123128
*)
124129
;;
125130
esac
@@ -241,6 +246,6 @@ fi
241246
-netdev user,id=n1,hostfwd=tcp::${SSH_PORT}-:22 -device virtio-net-pci,netdev=n1 \
242247
-append "${APPEND}" || exit 1
243248

244-
if ((SERIAL)); then
249+
if ((SERIAL)) && ((RESET)); then
245250
reset
246251
fi

0 commit comments

Comments
 (0)