From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: [PATCH 12/18] tests: Remove unnecessary ^D in passt_in_ns teardown Date: Fri, 15 Jul 2022 15:21:35 +1000 Message-ID: <20220715052141.890703-13-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="===============4562680243447814675==" --===============4562680243447814675== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit teardown_passt_in_ns() sends a ^D to the NS pane, which appears to be intended to terminate the nsenter running there, leaving the namespace. However, we've also sent a ^D to the PASST pane which will exit the pasta instance which created the namespace. With the namespace destroyed the nsenter in the NS pane will be killed, so it does not need to be exited explicitly. In fact sending the extra ^D can be harmful, since it will exit the shell in which the nsenter was run, causing the whole pane to be closed. That can then mean that the "pane_wait NS" hangs indefinitely. I believe this will sometimes work, because there's a race between the various options here, but it should be more reliable without the extra ^D. Signed-off-by: David Gibson --- test/lib/setup | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/lib/setup b/test/lib/setup index adbfa9e..752469c 100755 --- a/test/lib/setup +++ b/test/lib/setup @@ -306,8 +306,6 @@ teardown_passt_in_ns() { [ ${VALGRIND} -eq 0 ] && pane_status GUEST tmux send-keys -t ${PANE_PASST} "C-d" - tmux send-keys -t ${PANE_NS} "C-d" - pane_wait GUEST pane_wait NS pane_wait PASST -- 2.36.1 --===============4562680243447814675==--