1
0
mirror of https://passt.top/passt synced 2024-07-01 23:42:41 +00:00

tests: Remove unnecessary ^D in passt_in_ns teardown

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 <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2022-07-15 15:21:35 +10:00 committed by Stefano Brivio
parent 1aaa2bd189
commit d078a1113f

View File

@ -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