Skip to content

Commit ff7fabd

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 837e744 commit ff7fabd

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
@@ -1004,12 +1004,20 @@ def restore_from_snapshot(
10041004
for k, v in rename_interfaces.items()
10051005
]
10061006

1007+
optional_kwargs = {}
1008+
if iface_overrides:
1009+
# For backwards compatibility ab testing we want to avoid adding
1010+
# new parameters until we have a release baseline with the new
1011+
# parameter. Once the release baseline has moved, this assignment
1012+
# can be inline in the snapshot_load command below
1013+
optional_kwargs["network_overrides"] = iface_overrides
1014+
10071015
self.api.snapshot_load.put(
10081016
mem_backend=mem_backend,
10091017
snapshot_path=str(jailed_vmstate),
10101018
enable_diff_snapshots=snapshot.is_diff,
10111019
resume_vm=resume,
1012-
network_overrides=iface_overrides,
1020+
**optional_kwargs,
10131021
)
10141022
# This is not a "wait for boot", but rather a "VM still works after restoration"
10151023
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
@@ -574,3 +574,4 @@ def test_snapshot_rename_interface(uvm_nano, microvm_factory):
574574
snapshot, rename_interfaces={base_iface.dev_name: "tap2"}
575575
)
576576
restored_vm.resume()
577+
restored_vm.wait_for_ssh_up()

0 commit comments

Comments
 (0)