From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: Re: [PATCH v2 03/11] test: Allow a tmux pane to watch commands executed in contexts Date: Sat, 10 Sep 2022 16:36:13 +1000 Message-ID: In-Reply-To: <20220909171843.7275f488@elisabeth> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4099687253925835472==" --===============4099687253925835472== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Fri, Sep 09, 2022 at 05:18:43PM +0200, Stefano Brivio wrote: > Nit: >=20 > On Thu, 8 Sep 2022 11:49:12 +1000 > David Gibson wrote: >=20 > > 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 cont= ext(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" >=20 > Mixed tab and spaces. Oops, fixed. I finally got around to changing my emacs config to change sh-basic-offset to 8 by default, so this should be less likely to happen in future. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --===============4099687253925835472== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSXpCQUVCQ0FBZEZpRUVvVUx4V3U0L1dz MGRCK1h0Z3lwWTRnRXdZU0lGQW1NY01FY0FDZ2tRZ3lwWTRnRXcKWVNJYWZnLy9kdzk0c0FnNzBz RnJOTUM0Ui85MytKbGZCUWpvNjE5aVd3WmJvaTk5bXpuK2E5SHkrOENpaStDMAplbWRQWEQwZ0pV WlFOMk5nYXdhQ3I4aEdIYnArRy9NS2p0S2ZJUVhIc1d0cTNjQm5lOGNXblZKUzUzQVFhT3hRCk43 OWZGbmlES1IrZnBRYkt5Y1orVUpVcVY1dHVlR2JFVlJlTUJSVmdrM056a3BjQ2l3TXMrZ2t1N1NN M0prWFEKNnFMVERBYWFZR2hPMkdqOTdRWmxjK0U3T2NvSVRqa3JPM1ZvbVl0bldybEN0ejlPa0M1 UlU2L3FMczkxZXhIOQpWUGpJbm5MYlZ3YjlRSWhxQWkwdWNKMDlKMlV0L1dPTFlrKzJyR3oyU0I2 TVhmM04wL0lqUXMwSXZLNnJuY1ZLCll0Q0ZjbS9lbUxTUTZOdFl5MGdmQVQ4QmZ6OTdVQnZWZ1Yw ekQvWjhZZkZienRTY2VSV1dZMEVsN0w1NkFSeFoKODdDZDAwSXppTk1EdWc5UE13dC85V2NxVGJu Wm1sZ1hZUGJMNklibnFFSHN1MGl4K3lqSTFwVEI0N01tQUlDdwpBc2V6TnJsUEI4Wmt5cStacW5i bmNQSk9MVG9KWkpzWVd4eTJQM3I2cTZjTzFYcHlvWjJvNzJjVzhGUkI4eU4vCkxSd0NwNmlkVXZJ Yll1S3dtdElmTW84STBGeXNCelRsNmRDdkRjWm5wdXREc1p2bFBhNWNKdHhySDYzbC95V0UKczF3 em5ESXF6QXg5Zk14eW9NTHM3Umxkbi8rNnhyV3hKbjBpZlp2Y0IwWEhicUhDWHRZUitRcVorUVZS eHRTQgpyOUlzK0V6MW1jUWo3RU1Ca1cwSXZEYVRDREQrYVM0WStWd2NVRVNEenZJQ1p4SjFManc9 Cj1vUTRWCi0tLS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0tLQo= --===============4099687253925835472==--