From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH] test/lib/setup: Unshare PID namespace in pasta_setup() Date: Wed, 02 Mar 2022 10:28:06 +0100 Message-ID: <20220302092806.1390007-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6782942341542975147==" --===============6782942341542975147== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable ...otherwise, we'll leave processes (dhclient) around. Signed-off-by: Stefano Brivio --- test/lib/setup | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/lib/setup b/test/lib/setup index b076eff..f04949e 100755 --- a/test/lib/setup +++ b/test/lib/setup @@ -69,12 +69,16 @@ setup_pasta() { =20 layout_pasta =20 - pane_run NS "unshare -rUn /bin/sh " + pane_run NS 'echo $$' pane_wait NS + __tty_pid=3D"$(pane_parse NS)" =20 - pane_run NS 'echo $$' + pane_run NS "unshare -rUnpf /bin/sh" pane_wait NS - __pasta_pid=3D"$(pane_parse NS)" + + pane_run PASST "pstree -p ${__tty_pid} | sed -n 's/.*(\([0-9].*\))$/\1/p'" + pane_wait PASST + __target_pid=3D"$(pane_parse PASST)" =20 # Ports: # @@ -87,7 +91,7 @@ setup_pasta() { [ ${PCAP} -eq 1 ] && __opts=3D"${__opts} -p /tmp/pasta.pcap" [ ${DEBUG} -eq 1 ] && __opts=3D"${__opts} -d" =20 - pane_run PASST "./pasta ${__opts} -f -t 10002 -T 10003 -u 10002 -U 10003 ${= __pasta_pid}" + pane_run PASST "./pasta ${__opts} -f -t 10002 -T 10003 -u 10002 -U 10003 ${= __target_pid}" sleep 1 } =20 --=20 2.34.1 --===============6782942341542975147==--