From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Brivio To: passt-dev@passt.top Subject: Re: [PATCH v2 03/11] test: Allow a tmux pane to watch commands executed in contexts Date: Fri, 09 Sep 2022 17:18:43 +0200 Message-ID: <20220909171843.7275f488@elisabeth> In-Reply-To: <20220908014920.1474597-4-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7003904071974878834==" --===============7003904071974878834== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Nit: On Thu, 8 Sep 2022 11:49:12 +1000 David Gibson wrote: > We're moving to a new way of the tests dispatching commands to running in > contexts (host, guest, namespace, etc.). As we make this transition, > though, we still want the user to be able to watch the commands running > in a context, as they previously could from the commands issued in the > pane. >=20 > Add a helper to set up a pane to watch a context's log to allow this. In > some cases we currently issue commands from several different logical > contexts in the same pane, so allow a pane to watch several contexts at > once. Also use tail's --retry option to allow starting the watch before > we've initialized the context which will be useful in some cases. >=20 > Signed-off-by: David Gibson > --- > test/lib/term | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) >=20 > diff --git a/test/lib/term b/test/lib/term > index ddabf8d..fa34873 100755 > --- a/test/lib/term > +++ b/test/lib/term > @@ -241,6 +241,24 @@ pane_status() { > return ${__status} > } > =20 > +# pane_watch_context() - Set up pane to watch commands executing in contex= t(s) > +# $1: Pane number > +# $2: Description (for pane label) > +# $@: Context name or names > +pane_watch_contexts() { > + __pane_number=3D"${1}" > + __desc=3D"${2}" > + shift 2 > + __name=3D"${2}" > + > + tmux select-pane -t ${__pane_number} -T "${__desc}" > + __cmd=3D"tail -f --retry" > + for c; do > + __cmd=3D"${__cmd} ${LOGDIR}/context_${c}.log" Mixed tab and spaces. --=20 Stefano --===============7003904071974878834==--