Skip to content

Commit 6b3aa05

Browse files
ckyrouaccgwalters
authored andcommitted
tests: Add integration tests for port forwarding
Add comprehensive integration tests for the libvirt port forwarding feature: 1. test_libvirt_port_forward_parsing: Validates CLI argument parsing for various valid port forwarding formats (--port 8080:80, -p 80:80, etc.) 2. test_libvirt_port_forward_invalid: Tests error handling for invalid port formats (missing port, invalid numbers, out of range, etc.) 3. test_libvirt_port_forward_xml: Verifies that port forwarding is correctly configured in the libvirt domain XML with QEMU hostfwd args 4. test_libvirt_port_forward_connectivity: End-to-end test that creates a VM with port forwarding, starts an HTTP server inside the VM, and verifies connectivity from the host through the forwarded port The tests follow the existing integration test patterns using the distributed slice mechanism for test registration and include proper cleanup of test VMs. Assisted-by: Claude Code Signed-off-by: ckyrouac <[email protected]>
1 parent 181efce commit 6b3aa05

File tree

2 files changed

+532
-0
lines changed

2 files changed

+532
-0
lines changed

crates/integration-tests/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use linkme::distributed_slice;
1717

1818
mod tests {
1919
pub mod libvirt_base_disks;
20+
pub mod libvirt_port_forward;
2021
pub mod libvirt_upload_disk;
2122
pub mod libvirt_verb;
2223
pub mod mount_feature;

0 commit comments

Comments
 (0)