From d9b9c252cd494e23056c3ec28080a88636409865 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Mon, 12 Sep 2022 20:56:18 +1000 Subject: test: Issue host commands via context for most tests Convert most of the tests to use the new-style system for issuing commands for all host commands. We leave the distro tests for now: they use the same pane for both host and guest commands which we'll need some more things to deal with. Signed-off-by: David Gibson --- test/lib/layout | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'test/lib/layout') diff --git a/test/lib/layout b/test/lib/layout index 2d6b197..09c213a 100644 --- a/test/lib/layout +++ b/test/lib/layout @@ -31,8 +31,12 @@ layout_host() { tmux send-keys -t ${PANE_INFO} -N 100 C-m tmux select-pane -t ${PANE_INFO} -T "test log" - tmux pipe-pane -O -t ${PANE_HOST} "cat >> ${LOGDIR}/pane_host.log" - tmux select-pane -t ${PANE_HOST} -T "host" + if context_exists host; then + pane_watch_contexts 0 host host + else + tmux pipe-pane -O -t ${PANE_HOST} "cat >> ${LOGDIR}/pane_host.log" + tmux select-pane -t ${PANE_HOST} -T "host" + fi info_layout "host commands only" @@ -64,8 +68,7 @@ layout_pasta() { tmux send-keys -t ${PANE_INFO} -N 100 C-m tmux select-pane -t ${PANE_INFO} -T "test log" - tmux pipe-pane -O -t ${PANE_HOST} "cat >> ${LOGDIR}/pane_host.log" - tmux select-pane -t ${PANE_HOST} -T "host" + pane_watch_contexts ${PANE_HOST} host host tmux pipe-pane -O -t ${PANE_PASST} "cat >> ${LOGDIR}/pane_passt.log" tmux select-pane -t ${PANE_PASST} -T "pasta" @@ -100,8 +103,7 @@ layout_passt() { tmux send-keys -t ${PANE_INFO} -N 100 C-m tmux select-pane -t ${PANE_INFO} -T "test log" - tmux pipe-pane -O -t ${PANE_HOST} "cat >> ${LOGDIR}/pane_host.log" - tmux select-pane -t ${PANE_HOST} -T "host" + pane_watch_contexts ${PANE_HOST} host host tmux pipe-pane -O -t ${PANE_PASST} "cat >> ${LOGDIR}/pane_passt.log" tmux select-pane -t ${PANE_PASST} -T "passt" @@ -141,8 +143,7 @@ layout_passt_in_pasta() { tmux send-keys -t ${PANE_INFO} -N 100 C-m tmux select-pane -t ${PANE_INFO} -T "test log" - tmux pipe-pane -O -t ${PANE_HOST} "cat >> ${LOGDIR}/pane_host.log" - tmux select-pane -t ${PANE_HOST} -T "host" + pane_watch_contexts ${PANE_HOST} host host tmux pipe-pane -O -t ${PANE_PASST} "cat >> ${LOGDIR}/pane_passt.log" tmux select-pane -t ${PANE_PASST} -T "passt in pasta (namespace)" @@ -189,8 +190,7 @@ layout_two_guests() { tmux send-keys -t ${PANE_INFO} -N 100 C-m tmux select-pane -t ${PANE_INFO} -T "test log" - tmux pipe-pane -O -t ${PANE_HOST} "cat >> ${LOGDIR}/pane_host.log" - tmux select-pane -t ${PANE_HOST} -T "host" + pane_watch_contexts ${PANE_HOST} host host tmux pipe-pane -O -t ${PANE_PASST_1} "cat >> ${LOGDIR}/pane_passt_1.log" tmux select-pane -t ${PANE_PASST_1} -T "passt #1 in namespace #1" -- cgit v1.2.3