Skip to content

Commit

Permalink
Remove network_overrides if empty for backcompat
Browse files Browse the repository at this point in the history
Passing in the new flag breaks tests that compare behavior to main.

Signed-off-by: Andrew Laucius <[email protected]>
  • Loading branch information
andrewla committed Jan 16, 2025
1 parent 837e744 commit ff7fabd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/framework/microvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,12 +1004,20 @@ def restore_from_snapshot(
for k, v in rename_interfaces.items()
]

optional_kwargs = {}
if iface_overrides:
# For backwards compatibility ab testing we want to avoid adding
# new parameters until we have a release baseline with the new
# parameter. Once the release baseline has moved, this assignment
# can be inline in the snapshot_load command below
optional_kwargs["network_overrides"] = iface_overrides

self.api.snapshot_load.put(
mem_backend=mem_backend,
snapshot_path=str(jailed_vmstate),
enable_diff_snapshots=snapshot.is_diff,
resume_vm=resume,
network_overrides=iface_overrides,
**optional_kwargs,
)
# This is not a "wait for boot", but rather a "VM still works after restoration"
if snapshot.net_ifaces and resume:
Expand Down
1 change: 1 addition & 0 deletions tests/integration_tests/functional/test_snapshot_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,3 +574,4 @@ def test_snapshot_rename_interface(uvm_nano, microvm_factory):
snapshot, rename_interfaces={base_iface.dev_name: "tap2"}
)
restored_vm.resume()
restored_vm.wait_for_ssh_up()

0 comments on commit ff7fabd

Please sign in to comment.