@@ -66,6 +66,16 @@ def fingerprint_compare(
66
66
cmd += f" --filters { ' ' .join (filters )} "
67
67
utils .run_cmd (cmd )
68
68
69
+ def fingerprint_verify (self , baseline_path , output_path , filters ):
70
+ """Verify the given baseline fingerprint."""
71
+ cmd = (
72
+ f"{ self .binary } fingerprint verify"
73
+ f"--baseline { baseline_path } --output { output_path } "
74
+ )
75
+ if filters :
76
+ cmd += f" --filters { ' ' .join (filters )} "
77
+ utils .run_cmd (cmd )
78
+
69
79
70
80
@pytest .fixture (scope = "session" , name = "cpu_template_helper" )
71
81
def cpu_template_helper_fixture ():
@@ -320,12 +330,15 @@ def test_cpu_config_dump_vs_actual(
320
330
), f"Mismatched MSR for { key :#010x} : { actual = :#066b} vs. { dump = :#066b} "
321
331
322
332
323
- def detect_fingerprint_change (
324
- results_dir , cpu_template_helper , filters = None
325
- ):
333
+ @pytest .mark .no_block_pr
334
+ @pytest .mark .skipif (
335
+ global_props .host_linux_version not in SUPPORTED_HOST_KERNELS ,
336
+ reason = f"Supported kernels are { SUPPORTED_HOST_KERNELS } " ,
337
+ )
338
+ def test_guest_cpu_config_change (results_dir , cpu_template_helper ):
326
339
"""
327
- Compare fingerprint files with filters between one taken at the moment and
328
- a baseline file taken in a specific point in time .
340
+ Verify that the guest CPU config has not changed since the baseline
341
+ fingerprint was gathered .
329
342
"""
330
343
fname = f"fingerprint_{ global_props .cpu_codename } _{ global_props .host_linux_version } host.json"
331
344
@@ -336,27 +349,10 @@ def detect_fingerprint_change(
336
349
# Baseline fingerprint.
337
350
baseline_path = TEST_RESOURCES_DIR / fname
338
351
339
- # Compare with baseline
340
- cpu_template_helper .fingerprint_compare (
352
+ # Verify the baseline fingerprint.
353
+ cpu_template_helper .fingerprint_verify (
341
354
baseline_path ,
342
355
fingerprint_path ,
343
- filters ,
344
- )
345
-
346
-
347
- @pytest .mark .no_block_pr
348
- @pytest .mark .skipif (
349
- global_props .host_linux_version not in SUPPORTED_HOST_KERNELS ,
350
- reason = f"Supported kernels are { SUPPORTED_HOST_KERNELS } " ,
351
- )
352
- def test_guest_cpu_config_change (results_dir , cpu_template_helper ):
353
- """
354
- Verify that the guest CPU config has not changed since the baseline
355
- fingerprint was gathered.
356
- """
357
- detect_fingerprint_change (
358
- results_dir ,
359
- cpu_template_helper ,
360
356
["guest_cpu_config" ],
361
357
)
362
358
0 commit comments