@@ -45,16 +45,28 @@ def _check_cpu_topology(
4545 test_microvm , "lscpu" , None , ":" , expected_lscpu_output
4646 )
4747
48- expected_hwloc_output = {
49- "depth 0" : "1 Machine (type #0)" ,
50- "depth 1" : "1 Package (type #1)" ,
51- "depth 2" : "1 L3Cache (type #6)" ,
52- "depth 3" : f"{ expected_cpu_count } L2Cache (type #5)" ,
53- "depth 4" : f"{ expected_cpu_count } L1dCache (type #4)" ,
54- "depth 5" : f"{ expected_cpu_count } L1iCache (type #9)" ,
55- "depth 6" : f"{ expected_cpu_count } Core (type #2)" ,
56- "depth 7" : f"{ expected_cpu_count } PU (type #3)" ,
57- }
48+ if PLATFORM == "x86_64" :
49+ expected_hwloc_output = {
50+ "depth 0" : "1 Machine (type #0)" ,
51+ "depth 1" : "1 Package (type #1)" ,
52+ "depth 2" : "1 L3Cache (type #6)" ,
53+ "depth 3" : f"{ int (expected_cpu_count / expected_threads_per_core )} L2Cache (type #5)" ,
54+ "depth 4" : f"{ int (expected_cpu_count / expected_threads_per_core )} L1dCache (type #4)" ,
55+ "depth 5" : f"{ int (expected_cpu_count / expected_threads_per_core )} L1iCache (type #9)" ,
56+ "depth 6" : f"{ int (expected_cpu_count / expected_threads_per_core )} Core (type #2)" ,
57+ "depth 7" : f"{ expected_cpu_count } PU (type #3)" ,
58+ }
59+ else :
60+ expected_hwloc_output = {
61+ "depth 0" : "1 Machine (type #0)" ,
62+ "depth 1" : "1 Package (type #1)" ,
63+ "depth 2" : "1 L3Cache (type #6)" ,
64+ "depth 3" : f"{ expected_cpu_count } L2Cache (type #5)" ,
65+ "depth 4" : f"{ expected_cpu_count } L1dCache (type #4)" ,
66+ "depth 5" : f"{ expected_cpu_count } L1iCache (type #9)" ,
67+ "depth 6" : f"{ expected_cpu_count } Core (type #2)" ,
68+ "depth 7" : f"{ expected_cpu_count } PU (type #3)" ,
69+ }
5870
5971 utils .check_guest_cpuid_output (
6072 test_microvm , "hwloc-info" , None , ":" , expected_hwloc_output
@@ -179,7 +191,7 @@ def _check_cache_topology_arm(test_microvm, no_cpus, kernel_version_tpl):
179191
180192
181193@pytest .mark .parametrize ("num_vcpus" , [1 , 2 , 16 ])
182- @pytest .mark .parametrize ("htt" , [True , False ])
194+ @pytest .mark .parametrize ("htt" , [True , False ], ids = [ "HTT_ON" , "HTT_OFF" ] )
183195def test_cpu_topology (uvm_plain_any , num_vcpus , htt ):
184196 """
185197 Check the CPU topology for a microvm with the specified config.
@@ -198,7 +210,7 @@ def test_cpu_topology(uvm_plain_any, num_vcpus, htt):
198210
199211
200212@pytest .mark .parametrize ("num_vcpus" , [1 , 2 , 16 ])
201- @pytest .mark .parametrize ("htt" , [True , False ])
213+ @pytest .mark .parametrize ("htt" , [True , False ], ids = [ "HTT_ON" , "HTT_OFF" ] )
202214def test_cache_topology (uvm_plain_any , num_vcpus , htt ):
203215 """
204216 Check the cache topology for a microvm with the specified config.
0 commit comments