Skip to content

Commit c42de07

Browse files
committed
Remove network_overrides if empty for backcompat
Passing in the new flag breaks tests that compare behavior to main. Signed-off-by: Andrew Laucius <[email protected]>
1 parent 4ac480b commit c42de07

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

tests/framework/microvm.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,12 +1007,20 @@ def restore_from_snapshot(
10071007
for k, v in rename_interfaces.items()
10081008
]
10091009

1010+
optional_kwargs = {}
1011+
if iface_overrides:
1012+
# For backwards compatibility ab testing we want to avoid adding
1013+
# new parameters until we have a release baseline with the new
1014+
# parameter. Once the release baseline has moved, this assignment
1015+
# can be inline in the snapshot_load command below
1016+
optional_kwargs["network_overrides"] = iface_overrides
1017+
10101018
self.api.snapshot_load.put(
10111019
mem_backend=mem_backend,
10121020
snapshot_path=str(jailed_vmstate),
10131021
enable_diff_snapshots=snapshot.is_diff,
10141022
resume_vm=resume,
1015-
network_overrides=iface_overrides,
1023+
**optional_kwargs,
10161024
)
10171025
# This is not a "wait for boot", but rather a "VM still works after restoration"
10181026
if snapshot.net_ifaces and resume:

tests/integration_tests/functional/test_snapshot_basic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,3 +631,4 @@ def test_snapshot_rename_interface(uvm_nano, microvm_factory):
631631
snapshot, rename_interfaces={base_iface.dev_name: "tap2"}
632632
)
633633
restored_vm.resume()
634+
restored_vm.wait_for_ssh_up()

0 commit comments

Comments
 (0)