From 1f94a59b1b04626e14a02dbd4bcbbdf3b79fefd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Barb=C3=A1chano?= Date: Fri, 6 Dec 2024 11:24:30 +0100 Subject: [PATCH] fix(tests): save snapshot metadata when saving to disk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We missed saving metadata when saving to disk Fixes: 426790e4001ac7315554f876637298fb37fb85a8 Signed-off-by: Pablo Barbáchano --- tests/framework/microvm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/framework/microvm.py b/tests/framework/microvm.py index 572437c758b..91b88cc4c28 100644 --- a/tests/framework/microvm.py +++ b/tests/framework/microvm.py @@ -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)) @@ -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), }, ) @@ -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,