From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: [PATCH 06/12] test: Move passt_test_log_pipe to state directory Date: Wed, 07 Sep 2022 23:03:01 +1000 Message-ID: <20220907130307.1166467-7-david@gibson.dropbear.id.au> In-Reply-To: <20220907130307.1166467-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9100945403888362871==" --===============9100945403888362871== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable We use this fifo to send messages to the information pane. Put it in the state directory so it doesn't need its own cleanup. Signed-off-by: David Gibson --- test/lib/layout | 16 ++++++++-------- test/lib/term | 12 ++++++------ test/run | 7 ++----- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/test/lib/layout b/test/lib/layout index ea71ad5..f3a0873 100644 --- a/test/lib/layout +++ b/test/lib/layout @@ -27,7 +27,7 @@ layout_host() { =20 get_info_cols =20 - tmux send-keys -l -t ${PANE_INFO} 'while cat /tmp/.passt_test_log_pipe; do = :; done' + tmux send-keys -l -t ${PANE_INFO} 'while cat '"$STATEBASE/log_pipe"'; do :;= done' tmux send-keys -t ${PANE_INFO} -N 100 C-m tmux select-pane -t ${PANE_INFO} -T "test log" =20 @@ -61,7 +61,7 @@ layout_pasta() { =20 get_info_cols =20 - tmux send-keys -l -t ${PANE_INFO} 'while cat /tmp/.passt_test_log_pipe; do = :; done' + tmux send-keys -l -t ${PANE_INFO} 'while cat '"$STATEBASE/log_pipe"'; do :;= done' tmux send-keys -t ${PANE_INFO} -N 100 C-m tmux select-pane -t ${PANE_INFO} -T "test log" =20 @@ -95,7 +95,7 @@ layout_passt() { tmux pipe-pane -O -t ${PANE_GUEST} "cat >> ${LOGDIR}/pane_guest.log" tmux select-pane -t ${PANE_GUEST} -T "guest" =20 - tmux send-keys -l -t ${PANE_INFO} 'while cat /tmp/.passt_test_log_pipe; do = :; done' + tmux send-keys -l -t ${PANE_INFO} 'while cat '"$STATEBASE/log_pipe"'; do :;= done' tmux send-keys -t ${PANE_INFO} -N 100 C-m tmux select-pane -t ${PANE_INFO} -T "test log" =20 @@ -131,7 +131,7 @@ layout_passt_in_pasta() { pane_watch_contexts ${PANE_GUEST} "guest" qemu guest pane_watch_contexts ${PANE_NS} "namespace" ns =20 - tmux send-keys -l -t ${PANE_INFO} 'while cat /tmp/.passt_test_log_pipe; do = :; done' + tmux send-keys -l -t ${PANE_INFO} 'while cat '"$STATEBASE/log_pipe"'; do :;= done' tmux send-keys -t ${PANE_INFO} -N 100 C-m tmux select-pane -t ${PANE_INFO} -T "test log" =20 @@ -174,7 +174,7 @@ layout_two_guests() { pane_watch_contexts ${PANE_GUEST_1} "guest #1 in namespace #1" qemu_1 guest= _1 pane_watch_contexts ${PANE_GUEST_2} "guest #2 in namespace #2" qemu_2 guest= _2 =20 - tmux send-keys -l -t ${PANE_INFO} 'while cat /tmp/.passt_test_log_pipe; do = :; done' + tmux send-keys -l -t ${PANE_INFO} 'while cat '"$STATEBASE/log_pipe"'; do :;= done' tmux send-keys -t ${PANE_INFO} -N 100 C-m tmux select-pane -t ${PANE_INFO} -T "test log" =20 @@ -210,7 +210,7 @@ layout_demo_pasta() { tmux pipe-pane -O -t ${PANE_NS} "cat >> ${LOGDIR}/pane_ns.log" tmux select-pane -t ${PANE_NS} -T "namespace" =20 - tmux send-keys -l -t ${PANE_INFO} 'while cat /tmp/.passt_test_log_pipe; do = :; done' + tmux send-keys -l -t ${PANE_INFO} 'while cat '"$STATEBASE/log_pipe"'; do :;= done' tmux send-keys -t ${PANE_INFO} -N 100 C-m tmux select-pane -t ${PANE_INFO} -T "" =20 @@ -246,7 +246,7 @@ layout_demo_passt() { tmux pipe-pane -O -t ${PANE_GUEST} "cat >> ${LOGDIR}/pane_guest.log" tmux select-pane -t ${PANE_GUEST} -T "guest" =20 - tmux send-keys -l -t ${PANE_INFO} 'while cat /tmp/.passt_test_log_pipe; do = :; done' + tmux send-keys -l -t ${PANE_INFO} 'while cat '"$STATEBASE/log_pipe"'; do :;= done' tmux send-keys -t ${PANE_INFO} -N 100 C-m tmux select-pane -t ${PANE_INFO} -T "" =20 @@ -285,7 +285,7 @@ layout_demo_podman() { tmux pipe-pane -O -t ${PANE_NS2} "cat >> ${LOGDIR}/pane_ns2.log" tmux select-pane -t ${PANE_NS2} -T "Podman with pasta" =20 - tmux send-keys -l -t ${PANE_INFO} 'while cat /tmp/.passt_test_log_pipe; do = :; done' + tmux send-keys -l -t ${PANE_INFO} 'while cat '"$STATEBASE/log_pipe"'; do :;= done' tmux send-keys -t ${PANE_INFO} -N 100 C-m tmux select-pane -t ${PANE_INFO} -T "" =20 diff --git a/test/lib/term b/test/lib/term index b2a45e4..2321664 100755 --- a/test/lib/term +++ b/test/lib/term @@ -31,7 +31,7 @@ PR_DELAY_INIT=3D100 # ms # $@: Message to print info() { tmux select-pane -t ${PANE_INFO} - echo "${@}" >> /tmp/.passt_test_log_pipe + echo "${@}" >> $STATEBASE/log_pipe echo "${@}" >> "${LOGFILE}" } =20 @@ -39,7 +39,7 @@ info() { # $@: Message to print info_n() { tmux select-pane -t ${PANE_INFO} - printf "${@}" >> /tmp/.passt_test_log_pipe + printf "${@}" >> $STATEBASE/log_pipe printf "${@}" >> "${LOGFILE}" } =20 @@ -47,7 +47,7 @@ info_n() { # $@: Message to print info_nolog() { tmux select-pane -t ${PANE_INFO} - echo "${@}" >> /tmp/.passt_test_log_pipe + echo "${@}" >> $STATEBASE/log_pipe } =20 # info_nolog() - Print message to log file @@ -365,7 +365,7 @@ status_test_start() { info_check() { switch_pane ${PANE_INFO} =20 - printf "${PR_YELLOW}?${PR_NC} ${@}" >> /tmp/.passt_test_log_pipe + printf "${PR_YELLOW}?${PR_NC} ${@}" >> $STATEBASE/log_pipe printf "? ${@}" >> "${LOGFILE}" } =20 @@ -373,7 +373,7 @@ info_check() { info_check_passed() { switch_pane ${PANE_INFO} =20 - printf "\n" >> /tmp/.passt_test_log_pipe + printf "\n" >> $STATEBASE/log_pipe printf "\n" >> ${LOGFILE} } =20 @@ -381,7 +381,7 @@ info_check_passed() { info_check_failed() { switch_pane ${PANE_INFO} =20 - printf " ${PR_RED}!${PR_NC}\n" >> /tmp/.passt_test_log_pipe + printf " ${PR_RED}!${PR_NC}\n" >> $STATEBASE/log_pipe printf " < failed.\n" >> "${LOGFILE}" } =20 diff --git a/test/run b/test/run index 58d9b49..4bb9cd8 100755 --- a/test/run +++ b/test/run @@ -49,13 +49,11 @@ COMMIT=3D"$(git log --oneline --no-decorate -1)" # cleanup() - Remove temporary files cleanup() { [ ${DEBUG} -eq 1 ] || rm -rf "${STATEBASE}" - rm -f /tmp/.passt_test_log_pipe } =20 # run() - Call setup functions, run tests, handle exit from test session run() { - rm -f /tmp/.passt_test_log_pipe - mkfifo /tmp/.passt_test_log_pipe + mkfifo $STATEBASE/log_pipe =20 term perf_init @@ -131,8 +129,7 @@ run() { =20 # demo() - Simpler path for demo purposes demo() { - rm -f /tmp/.passt_test_log_pipe - mkfifo /tmp/.passt_test_log_pipe + mkfifo $STATEBASE/log_pipe =20 FAST=3D0 =20 --=20 2.37.3 --===============9100945403888362871==--