aboutgitcodebugslistschat
path: root/test/lib/term
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-05-12 13:27:21 +1000
committerStefano Brivio <sbrivio@redhat.com>2022-05-19 15:24:15 +0200
commitae83999b75165669ba468defa4cddced3ef2b058 (patch)
treec5c2d46fc586c0f5f3910a678cf29a6f1517f826 /test/lib/term
parent14cbbd602c82bc48df8b0a942f1198537aeced78 (diff)
downloadpasst-ae83999b75165669ba468defa4cddced3ef2b058.tar
passt-ae83999b75165669ba468defa4cddced3ef2b058.tar.gz
passt-ae83999b75165669ba468defa4cddced3ef2b058.tar.bz2
passt-ae83999b75165669ba468defa4cddced3ef2b058.tar.lz
passt-ae83999b75165669ba468defa4cddced3ef2b058.tar.xz
passt-ae83999b75165669ba468defa4cddced3ef2b058.tar.zst
passt-ae83999b75165669ba468defa4cddced3ef2b058.zip
tests: Don't globally set tmux default-shell
run_term() uses tmux set-option -g to globally set the default shell. Unfortunately this hits a chicken-and-egg problem that's common with many of tmux's session options. If there isn't already a tmux server running, we can't connect to set the option. If we attempt this after starting our session (and therefore the server), then the session will already be started with the previous default shell. In any case it's not a good idea to set tmux global options, since that might interfere with whatever else the user is doing in tmux. So, instead set the default-shell option locally to the session after starting it. To make sure we get the right shell for our initial script, explicitly invoke /bin/sh to interpret it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'test/lib/term')
-rwxr-xr-xtest/lib/term13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/lib/term b/test/lib/term
index 42b0020..7dd9826 100755
--- a/test/lib/term
+++ b/test/lib/term
@@ -542,26 +542,25 @@ pause_continue() {
# run_term() - Start tmux session, running entry point, with recording if needed
run_term() {
- export SHELL="/bin/sh"
- tmux set-option -g default-shell "/bin/sh"
-
TMUX="tmux new-session -s passt_test -ePCAP=$PCAP -eDEBUG=$DEBUG"
if [ ${CI} -eq 1 ]; then
printf '\e[8;50;240t'
- asciinema rec --overwrite ci.uncut -c "$TMUX ./ci from_term"
+ asciinema rec --overwrite ci.uncut -c "$TMUX /bin/sh -c './ci from_term'"
video_postprocess ci.uncut
elif [ ${DEMO} -eq 1 ]; then
printf '\e[8;40;130t'
- asciinema rec --overwrite demo.uncut -c "$TMUX ./run_demo from_term"
+ asciinema rec --overwrite demo.uncut -c "$TMUX /bin/sh -c './run_demo from_term'"
video_postprocess demo.uncut
else
- $TMUX ./run from_term
+ $TMUX /bin/sh -c './run from_term'
fi
}
# term() - Set up terminal window and panes for regular tests or CI
term() {
+ tmux set-option default-shell "/bin/sh"
+
tmux set status-interval 1
tmux rename-window ''
@@ -596,6 +595,8 @@ term() {
# term_demo() - Set up terminal window and panes for demo
term_demo() {
+ tmux set-option default-shell "/bin/sh"
+
tmux set status-interval 1
tmux rename-window ''