| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
test: only remove test env if its directory exists Problem: Running test when env doesn't exist shows noisy error: Error: Environment does not exist: 'test-isolation-modes' Solution: Check if ~/.epkg/envs/$TEST_ENV directory exists before attempting removal. Only show removal message when actually removing. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
qemu: fix VM reuse for vm-keep-timeout mode Root Cause Analysis: 1. Process group issue: QEMU and virtiofsd were killed when parent exited - Parent's process group sends SIGTERM to all children on exit - setsid() creates new session to detach from parent's group - virtiofsd also needs setsid() (was missing) 2. Idle timeout race condition in guest daemon: - accept_vsock_with_timeout() uses 100ms poll when connections active - When connection thread finishes, it decrements active_connections - If 100ms poll expires after active becomes 0, code incorrectly assumed idle timeout expired and powered off - Fix: check accept_timeout_ms > ACTIVE_POLL_INTERVAL_MS before power off 3. Session daemon_pid was namespace child's PID: - Session registered with std::process::id() (namespace child) - When child exits, session discovery saw daemon dead, cleaned up - Fix: use QEMU's PID (qemu_child.id()) as daemon_pid Solution: - Add reuse_session parameter to start_virtiofsd_at() and spawn_qemu() - Call setsid() via pre_exec when reuse_session=true for both processes - Fix idle timeout logic to distinguish short poll from real idle timeout - Use QEMU's PID for daemon_pid in session registration Fixes: VM reuse tests showing 'VM2 output mismatch' and VM dying after first command Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
tests: fix VM lifecycle tests by specifying timeout=0 Problem: - Test VM-1 and VM-10 failed because VM shutdown immediately after the first command completed - Root Cause: vm start without -s timeout=N uses default timeout=None - vm_keep_timeout_secs=None triggers vm-daemon to return Shutdown disposition, causing immediate VM shutdown after command completes Analysis (from VM log): [ 1.030578] run_vsock_server thread: Shutdown disposition [ 1.109159] run_vsock_server: shutdown requested, exiting [ 1.115629] sysrq: Power Off - VM shutdown at 1.1s after echo ready command in wait_for_guest_ready() - Test VM-2/VM-3 passed incorrectly because zombie daemon process was still detected as "alive" by is_process_alive() - Test VM-4 failed connecting to already-shutdown VM Solution: - Add -s timeout=0 to Test VM-1 and VM-10 vm start commands - timeout=0 means "never auto-shutdown", keeping VM alive for reuse Fixes: ./test-vm-sandbox.sh --vmm=qemu Test VM-4 error "Expected 'reuse test', got ' src/vm/client.rs:135'" Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
tests: add test-vm-su.sh for VM filesystem and user mapping Test cases: 1. Non-root user can execute command via su (root inode mode 755 fix) 2. VM root shows environment directories (virtiofs mount verification) 3. Non-root user can traverse root directory (key fix verification) 4. Host UID appears as root in VM (idmap verification) This test verifies the virtiofs passthrough fixes: - Root inode mode override to 755 for VM traversal - Host UID/GID mapping in VM namespace Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 3 个月前 | ||
| 3 个月前 | ||
| 3 个月前 | ||
| 3 个月前 |