From fef7853d5368568e17f4f35eef4d254febba7669 Mon Sep 17 00:00:00 2001 From: Anushree Mathur Date: Tue, 24 Nov 2026 21:13:58 +0530 Subject: [PATCH] pci_passthrough: add vlan_nic variant to run VLAN test on passthrough NIC The tp-libvirt libvirt_pci_passthrough test gained a vlan_nic variant that creates an 802.1Q VLAN sub-interface on the passthrough NIC inside the guest, verifies its address, UP state, VLAN protocol and VLAN id for ids 1, 100 and 4094, and removes it again. Add a vlan_nic entry to pci_passthrough.cfg so the new test is picked up when this suite is run. It selects libvirt_pci_passthrough.vlan_nic and declares the only two parameters the test needs: vlan_ip IP address assigned to the VLAN sub-interface vlan_prefix prefix length of that address Following the convention used by the other user-specific values in this file, both are set to "ENTER.YOUR.*" placeholders with an example in the comment (20.20.20.1 and 24), so the user knows what to fill in. No physical connectivity on the VLAN is required, so any unused private address works. The remaining parameters the test uses (libvirt_pci_net_dev_label, libvirt_pci_net_ip, ...) are already defined at the top of this file. The variant is placed before guest_remove, since guest_remove deletes the guest that the test needs. Depends on the tp-libvirt change "passthrough/pci: add 802.1Q VLAN test on passthrough NIC". Signed-off-by: Anushree Mathur --- config/tests/guest/libvirt/pci_passthrough.cfg | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config/tests/guest/libvirt/pci_passthrough.cfg b/config/tests/guest/libvirt/pci_passthrough.cfg index 5f59324f..b043d212 100644 --- a/config/tests/guest/libvirt/pci_passthrough.cfg +++ b/config/tests/guest/libvirt/pci_passthrough.cfg @@ -90,5 +90,18 @@ variants: - pci_passthrough_eeh: only libvirt_pci_passthrough_eeh + - vlan_nic: + only libvirt_pci_passthrough.vlan_nic + # Creates an 802.1Q VLAN sub-interface on the passthrough NIC in the + # guest (vlan ids 1, 100 and 4094) and verifies it. + # No physical connectivity on the VLAN is required, so any unused + # private IP and prefix length can be used. + # IP address to assign to the VLAN sub-interface + # Eg: 20.20.20.1 + vlan_ip = "ENTER.YOUR.VLAN.IP" + # Prefix length of the above IP address + # Eg: 24 + vlan_prefix = "ENTER.YOUR.VLAN.PREFIX" + - guest_remove: only remove_guest.without_disk