Skip to content

Commit

Permalink
fix(tests): save snapshot metadata when saving to disk
Browse files Browse the repository at this point in the history
We missed saving metadata when saving to disk

Fixes: 426790e

Signed-off-by: Pablo Barbáchano <[email protected]>
  • Loading branch information
pb8o committed Dec 6, 2024
1 parent d7734e2 commit 7ca8221
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/framework/microvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def save_to(self, dst: Path):
"disks": new_disks,
"ssh_key": self.ssh_key.name,
"snapshot_type": self.snapshot_type.value,
"meta": self.meta,
}
snap_json = dst / "snapshot.json"
snap_json.write_text(json.dumps(obj))
Expand Down Expand Up @@ -937,7 +938,7 @@ def make_snapshot(
ssh_key=self.ssh_key,
snapshot_type=snapshot_type,
meta={
"kernel_file": self.kernel_file,
"kernel_file": str(self.kernel_file),
},
)

Expand Down Expand Up @@ -978,6 +979,8 @@ def restore_from_snapshot(

for key, value in snapshot.meta.items():
setattr(self, key, value)
# Adjust things just in case
self.kernel_file = Path(self.kernel_file)

self.api.snapshot_load.put(
mem_backend=mem_backend,
Expand Down

0 comments on commit 7ca8221

Please sign in to comment.