Skip to content

Commit 6fb379d

Browse files
committed
feat(virtio-pmem): adjust integration tests with new config options
virtio-pmem introduces new field in config structure. Adjust tests to expect it. Signed-off-by: Egor Lazarchuk <[email protected]>
1 parent 1640063 commit 6fb379d

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

tests/framework/microvm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ def add_pmem(
989989
root_device=root_device,
990990
read_only=read_only,
991991
)
992-
self.disks[id] = path_on_host
992+
self.disks[pmem_id] = path_on_host
993993

994994
def start(self):
995995
"""Start the microvm.

tests/framework/vm_config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@
3131
"logger": null,
3232
"metrics": null,
3333
"mmds-config": null,
34-
"entropy": null
34+
"entropy": null,
35+
"pmem": []
3536
}

tests/integration_tests/functional/test_api.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,21 @@ def test_get_full_config_after_restoring_snapshot(microvm_factory, uvm_nano):
11461146
}
11471147
]
11481148

1149+
uvm_nano.api.pmem.put(
1150+
id="pmem",
1151+
path_on_host="/" + uvm_nano.rootfs_file.name,
1152+
root_device=False,
1153+
read_only=False,
1154+
)
1155+
setup_cfg["pmem"] = [
1156+
{
1157+
"id": "pmem",
1158+
"path_on_host": "/" + uvm_nano.rootfs_file.name,
1159+
"root_device": False,
1160+
"read_only": False,
1161+
}
1162+
]
1163+
11491164
# Add a memory balloon device.
11501165
uvm_nano.api.balloon.put(amount_mib=1, deflate_on_oom=True)
11511166
setup_cfg["balloon"] = {
@@ -1257,6 +1272,21 @@ def test_get_full_config(uvm_plain):
12571272
}
12581273
]
12591274

1275+
test_microvm.api.pmem.put(
1276+
id="pmem",
1277+
path_on_host="/" + test_microvm.rootfs_file.name,
1278+
root_device=False,
1279+
read_only=False,
1280+
)
1281+
expected_cfg["pmem"] = [
1282+
{
1283+
"id": "pmem",
1284+
"path_on_host": "/" + test_microvm.rootfs_file.name,
1285+
"root_device": False,
1286+
"read_only": False,
1287+
}
1288+
]
1289+
12601290
# Add a memory balloon device.
12611291
test_microvm.api.balloon.put(amount_mib=1, deflate_on_oom=True)
12621292
expected_cfg["balloon"] = {

0 commit comments

Comments
 (0)