18
18
def _check_cpu_topology (
19
19
test_microvm , expected_cpu_count , expected_threads_per_core , expected_cpus_list
20
20
):
21
- expected_cpu_topology = {
22
- "CPU(s)" : str (expected_cpu_count ),
23
- "On-line CPU(s) list" : expected_cpus_list ,
24
- "Thread(s) per core" : str (expected_threads_per_core ),
25
- "Core(s) per socket" : str (int (expected_cpu_count / expected_threads_per_core )),
26
- "Socket(s)" : "1" ,
27
- "NUMA node(s)" : "1" ,
21
+ expected_lscpu_output = {}
22
+ if PLATFORM == "x86_64" :
23
+ expected_lscpu_output = {
24
+ "CPU(s)" : str (expected_cpu_count ),
25
+ "On-line CPU(s) list" : expected_cpus_list ,
26
+ "Thread(s) per core" : str (expected_threads_per_core ),
27
+ "Core(s) per socket" : str (
28
+ int (expected_cpu_count / expected_threads_per_core )
29
+ ),
30
+ "Socket(s)" : "1" ,
31
+ "NUMA node(s)" : "1" ,
32
+ }
33
+ else :
34
+ expected_lscpu_output = {
35
+ "CPU(s)" : str (expected_cpu_count ),
36
+ "On-line CPU(s) list" : expected_cpus_list ,
37
+ "Thread(s) per core" : "1" ,
38
+ "Core(s) per cluster" : str (
39
+ int (expected_cpu_count / expected_threads_per_core )
40
+ ),
41
+ "Cluster(s)" : "1" ,
42
+ "NUMA node(s)" : "1" ,
43
+ }
44
+
45
+ utils .check_guest_cpuid_output (
46
+ test_microvm , "lscpu" , None , ":" , expected_lscpu_output
47
+ )
48
+
49
+ expected_hwloc_output = {
50
+ "depth0:" : "1 Machine(type#0)" ,
51
+ "depth1:" : "1 Package(type#1)" ,
52
+ "depth2:" : "1 L3Cache(type#6)" ,
53
+ "depth3:" : f"{ expected_cpu_count } L2Cache(type#5)" ,
54
+ "depth4:" : f"{ expected_cpu_count } L1dCache(type#4)" ,
55
+ "depth5:" : f"{ expected_cpu_count } L1iCache(type#9)" ,
56
+ "depth6:" : f"{ expected_cpu_count } Core(type#2)" ,
57
+ "depth7:" : f"{ expected_cpu_count } PU(type#3)" ,
28
58
}
29
59
30
60
utils .check_guest_cpuid_output (
31
- test_microvm , "lscpu " , None , ":" , expected_cpu_topology
61
+ test_microvm , "hwloc-info " , None , ":" , expected_hwloc_output
32
62
)
33
63
34
64
@@ -115,9 +145,6 @@ def _check_cache_topology_arm(test_microvm, no_cpus):
115
145
assert guest_dict == host_dict
116
146
117
147
118
- @pytest .mark .skipif (
119
- PLATFORM != "x86_64" , reason = "Firecracker supports CPU topology only on x86_64."
120
- )
121
148
@pytest .mark .parametrize (
122
149
"num_vcpus" ,
123
150
[1 , 2 , 16 ],
@@ -132,6 +159,8 @@ def test_cpu_topology(test_microvm_with_api, network_config, num_vcpus, htt):
132
159
133
160
@type: functional
134
161
"""
162
+ if htt and PLATFORM == "aarch64" :
163
+ pytest .skip ("SMT is configurable only on x86." )
135
164
vm = test_microvm_with_api
136
165
vm .spawn ()
137
166
vm .basic_config (vcpu_count = num_vcpus , smt = htt )
0 commit comments