From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH 04/12] tests: Don't use tmux update-environment Date: Tue, 17 May 2022 14:36:06 +0200 Message-ID: <20220517123614.1892316-5-sbrivio@redhat.com> In-Reply-To: <20220517123614.1892316-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1307635613808155373==" --===============1307635613808155373== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: David Gibson The semantics of tmux's update-environment option are a bit confusing. It says it means the given variables are copied into the session environment from the source environment, but it's not entirely clear what the "source" environment means. >From my experimentation it appeast to be the environment from which the tmux *server* is launched, not the one issuing the 'new-session' command. That makes it pretty much useles, certainly in our case where we have no way of knowing if the user has pre-existing tmux sessions. Instead use the new-session -e option to explicitly pass in the variables we want to propagate. Signed-off-by: David Gibson --- test/lib/term | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/lib/term b/test/lib/term index c9f5be3..42b0020 100755 --- a/test/lib/term +++ b/test/lib/term @@ -544,18 +544,19 @@ pause_continue() { run_term() { export SHELL=3D"/bin/sh" tmux set-option -g default-shell "/bin/sh" - tmux set-option -g update-environment "PCAP DEBUG" + + TMUX=3D"tmux new-session -s passt_test -ePCAP=3D$PCAP -eDEBUG=3D$DEBUG" =20 if [ ${CI} -eq 1 ]; then printf '\e[8;50;240t' - asciinema rec --overwrite ci.uncut -c 'tmux new-session -s passt_test ./ci= from_term' + asciinema rec --overwrite ci.uncut -c "$TMUX ./ci from_term" video_postprocess ci.uncut elif [ ${DEMO} -eq 1 ]; then printf '\e[8;40;130t' - asciinema rec --overwrite demo.uncut -c 'tmux new-session -s passt_test ./= run_demo from_term' + asciinema rec --overwrite demo.uncut -c "$TMUX ./run_demo from_term" video_postprocess demo.uncut else - tmux new-session -s passt_test ./run from_term + $TMUX ./run from_term fi } =20 --=20 2.35.1 --===============1307635613808155373==--