File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
tests/integration_tests/functional Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """Tests for verifying the virtio-mem is working correctly"""
5
+
6
+
7
+ def test_virtio_mem_detected (uvm_plain_6_1 ):
8
+ """
9
+ Check that the guest kernel has enabled PV steal time.
10
+ """
11
+ uvm = uvm_plain_6_1
12
+ uvm .spawn ()
13
+ uvm .memory_monitor = None
14
+ uvm .basic_config (
15
+ boot_args = "console=ttyS0 reboot=k panic=1 memhp_default_state=online_movable"
16
+ )
17
+ uvm .add_net_iface ()
18
+ uvm .api .memory_hotplug .put (total_size_mib = 1024 )
19
+ uvm .start ()
20
+
21
+ _ , stdout , _ = uvm .ssh .check_output ("dmesg | grep 'virtio_mem'" )
22
+ for line in stdout .splitlines ():
23
+ _ , key , value = line .strip ().split (":" )
24
+ key = key .strip ()
25
+ value = int (value .strip (), base = 0 )
26
+ match key :
27
+ case "start address" :
28
+ assert value == (512 << 30 ), "start address doesn't match"
29
+ case "region size" :
30
+ assert value == 1024 << 20 , "region size doesn't match"
31
+ case "device block size" :
32
+ assert value == 2 << 20 , "block size doesn't match"
33
+ case "plugged size" :
34
+ assert value == 0 , "plugged size doesn't match"
35
+ case "requested size" :
36
+ assert value == 0 , "requested size doesn't match"
37
+ case _:
38
+ continue
You can’t perform that action at this time.
0 commit comments