nixos/test-driver: deduplicate VLANs
Naively deduplicate VLANs in the python driver for NixOS tests. The current implementation accidentally works, since the VLan class mutates the environment. On construction it sets QEMU_VDE_SOCKET_${id} and this environment variable gets overwritten once a second VLAN with the same id is constructed. Because the NIC flags passed to qemu just use the QEMU_VDE_SOCKET_${id} environment variable, this implicitly chooses a single vde_switch process for each VLAN. However, this leads to unusable vde_switch processes being spawned in each test run and as a side effect makes it impossible to access the correct VLan objects in the interactive test driver. It also makes it remarkably hard to understand why the current implementation ever worked.
This commit is contained in:
parent
34919ae092
commit
6d766ae8b7
1 changed files with 1 additions and 0 deletions
|
@ -55,6 +55,7 @@ class Driver:
|
|||
tmp_dir = get_tmp_dir()
|
||||
|
||||
with rootlog.nested("start all VLans"):
|
||||
vlans = list(set(vlans))
|
||||
self.vlans = [VLan(nr, tmp_dir) for nr in vlans]
|
||||
|
||||
def cmd(scripts: List[str]) -> Iterator[NixStartScript]:
|
||||
|
|
Loading…
Reference in a new issue