From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: [PATCH 08/18] tests: Fix detection of empty 'hout' responses in passt{,_in_ns} tests Date: Fri, 15 Jul 2022 15:21:31 +1000 Message-ID: <20220715052141.890703-9-david@gibson.dropbear.id.au> In-Reply-To: <20220715052141.890703-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0007513709072823112==" --===============0007513709072823112== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The dhcp/passt and dhcp/passt_in_ns tests at least, and maybe others use 'hout' commands that need to be able to detect empty output. However, we don't set PS1, which means the screen-scraping logic which detects this may not be reliable. In addition, if the host is using a recent bash, it will have bracketed paste mode enabled which will also add escape codes which will mess up the empty output detection. Set the prompt and disable bracketed paste mode from the passt and passt_in_ns setups to avoid these problems. Signed-off-by: David Gibson --- test/lib/setup | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/lib/setup b/test/lib/setup index 0d0f3cf..adbfa9e 100755 --- a/test/lib/setup +++ b/test/lib/setup @@ -57,6 +57,13 @@ setup_passt() { " -device virtio-net-pci,netdev=3Dhostnet0,x-txburst=3D16384" \ " -netdev socket,fd=3D5,id=3Dhostnet0" pane_status GUEST + + # Set things up to reduce problems parsing host command output + pane_run HOST "PS1=3D'$ '" + pane_wait HOST + # Non-bash shells will fail this, but also don't need it, so ignore errors + pane_run HOST "bind 'set enable-bracketed-paste off'" + pane_wait HOST } =20 # setup_pasta() - Create a network and user namespace, connect pasta to it @@ -168,6 +175,13 @@ setup_passt_in_ns() { " -device virtio-net-pci,netdev=3Dhostnet0,x-txburst=3D524288" \ " -netdev socket,fd=3D5,id=3Dhostnet0" pane_status GUEST + + # Set things up to reduce problems parsing host command output + pane_run HOST "PS1=3D'$ '" + pane_wait HOST + # Non-bash shells will fail this, but also don't need it, so ignore errors + pane_run HOST "bind 'set enable-bracketed-paste off'" + pane_wait HOST } =20 # setup_two_guests() - Set up two namespace, run qemu and passt in both of t= hem --=20 2.36.1 --===============0007513709072823112==--