* [PATCH 1/3] vrunner: add /sbin,/usr/sbin to PATH
2026-07-27 0:21 [PATCH 0/3] Improve reliability of vcontainer-tests tim.orling
@ 2026-07-27 0:21 ` tim.orling
2026-07-27 0:21 ` [PATCH 2/3] vrunner.sh: fix daemon_stop() shutdown reliability tim.orling
2026-07-27 0:21 ` [PATCH 3/3] tests/conftest.py: memrest_stop timeout=120 tim.orling
2 siblings, 0 replies; 4+ messages in thread
From: tim.orling @ 2026-07-27 0:21 UTC (permalink / raw)
To: meta-virtualization
From: Tim Orling <tim.orling@konsulko.com>
mke2fs (state disk creation) and iptables (Xen backend port forwarding)
live in /sbin or /usr/sbin, which many non-root interactive shells (e.g.
Debian/Ubuntu) don't put on PATH. Under `set -e` a missing command here
kills the script silently (no output reaches the caller), so make sure
these are reachable regardless of the caller's PATH.
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
recipes-containers/vcontainer/files/vrunner.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/recipes-containers/vcontainer/files/vrunner.sh b/recipes-containers/vcontainer/files/vrunner.sh
index a32a005d..3de48abf 100755
--- a/recipes-containers/vcontainer/files/vrunner.sh
+++ b/recipes-containers/vcontainer/files/vrunner.sh
@@ -28,6 +28,7 @@ set -e
VERSION="3.5.0"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+PATH="$PATH:/sbin:/usr/sbin"
# Runtime selection: docker or podman
# This affects blob directory, cmdline prefix, state directory, and log prefix
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/3] vrunner.sh: fix daemon_stop() shutdown reliability
2026-07-27 0:21 [PATCH 0/3] Improve reliability of vcontainer-tests tim.orling
2026-07-27 0:21 ` [PATCH 1/3] vrunner: add /sbin,/usr/sbin to PATH tim.orling
@ 2026-07-27 0:21 ` tim.orling
2026-07-27 0:21 ` [PATCH 3/3] tests/conftest.py: memrest_stop timeout=120 tim.orling
2 siblings, 0 replies; 4+ messages in thread
From: tim.orling @ 2026-07-27 0:21 UTC (permalink / raw)
To: meta-virtualization
From: Tim Orling <tim.orling@konsulko.com>
Hold the connection open briefly after sending the kill command
so the guest's "===SHUTTING_DOWN===" ack has somewhere to land
(mirrors the ===PING===/===PONG=== handshake). A bare `echo | socat`
closes the connection the instant echo's stdin hits EOF; the
guest's write of its ack into that already-closed channel then
never returns, so it never reaches `break` and graceful_shutdown()
never runs -- every stop was silently burning the full 60s and
falling through to QMP quit / SIGKILL instead.
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
recipes-containers/vcontainer/files/vrunner.sh | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/recipes-containers/vcontainer/files/vrunner.sh b/recipes-containers/vcontainer/files/vrunner.sh
index 3de48abf..7ce71a4e 100755
--- a/recipes-containers/vcontainer/files/vrunner.sh
+++ b/recipes-containers/vcontainer/files/vrunner.sh
@@ -669,7 +669,15 @@ daemon_stop() {
# Error: reading blob sha256:<hash>: file integrity checksum
# failed for "<file>"
if [ -S "$DAEMON_SOCKET" ]; then
- echo "===SHUTDOWN===" | socat - "UNIX-CONNECT:$DAEMON_SOCKET" 2>/dev/null || true
+ # Hold the connection open briefly after sending the command so the
+ # guest's "===SHUTTING_DOWN===" ack has somewhere to land (mirrors
+ # the ===PING===/===PONG=== handshake above). A bare `echo | socat`
+ # closes the connection the instant echo's stdin hits EOF; the
+ # guest's write of its ack into that already-closed channel then
+ # never returns, so it never reaches `break` and graceful_shutdown()
+ # never runs -- every stop was silently burning the full 60s poll
+ # below and falling through to QMP quit / SIGKILL instead.
+ { echo "===SHUTDOWN==="; sleep 3; } | timeout 10 socat - "UNIX-CONNECT:$DAEMON_SOCKET" 2>/dev/null || true
# Poll up to 60s (120 * 0.5s). Generous enough to cover heavy
# ext4 journal commits; short enough that a truly hung guest
# doesn't block the caller indefinitely.
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 3/3] tests/conftest.py: memrest_stop timeout=120
2026-07-27 0:21 [PATCH 0/3] Improve reliability of vcontainer-tests tim.orling
2026-07-27 0:21 ` [PATCH 1/3] vrunner: add /sbin,/usr/sbin to PATH tim.orling
2026-07-27 0:21 ` [PATCH 2/3] vrunner.sh: fix daemon_stop() shutdown reliability tim.orling
@ 2026-07-27 0:21 ` tim.orling
2 siblings, 0 replies; 4+ messages in thread
From: tim.orling @ 2026-07-27 0:21 UTC (permalink / raw)
To: meta-virtualization
From: Tim Orling <tim.orling@konsulko.com>
Match the documented daemon_stop() worst case already used
elsewhere in test_vcontainer_daemon_lifecycle.py.
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
tests/conftest.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/conftest.py b/tests/conftest.py
index 6258611b..67718dcf 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -495,7 +495,7 @@ class VdkrRunner:
cmd, proc.returncode, stdout=output, stderr="")
return result
- def memres_stop(self, timeout=30):
+ def memres_stop(self, timeout=120):
"""Stop memory resident mode."""
return self.run("memres", "stop", timeout=timeout, check=False)
@@ -794,7 +794,7 @@ class VpdmnRunner:
cmd, proc.returncode, stdout=output, stderr="")
return result
- def memres_stop(self, timeout=30):
+ def memres_stop(self, timeout=120):
"""Stop memory resident mode."""
return self.run("memres", "stop", timeout=timeout, check=False)
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread