@@ -372,33 +372,15 @@ def test_json_static_templates(
372
372
cpu_template_helper .template_verify (custom_cpu_template_path )
373
373
374
374
375
- def test_consecutive_cpu_config_consistency (cpu_template_helper , tmp_path ):
375
+ def test_consecutive_fingerprint_consistency (cpu_template_helper , tmp_path ):
376
376
"""
377
- Verify that two dumped guest CPU configs obtained consecutively are
378
- consistent. The dumped guest CPU config should not change without
379
- any environmental changes (firecracker, kernel, microcode updates).
377
+ Verify that two fingerprints obtained consecutively are consisttent.
380
378
"""
381
- # Dump CPU config with the helper tool.
382
- cpu_config_1 = tmp_path / "cpu_config_1.json"
383
- cpu_template_helper .template_dump (cpu_config_1 )
384
- cpu_config_2 = tmp_path / "cpu_config_2.json"
385
- cpu_template_helper .template_dump (cpu_config_2 )
386
-
387
- # Strip common entries.
388
- cpu_template_helper .template_strip ([cpu_config_1 , cpu_config_2 ])
389
-
390
- # Check the stripped result is empty.
391
- if PLATFORM == "x86_64" :
392
- empty_cpu_config = {
393
- "cpuid_modifiers" : [],
394
- "kvm_capabilities" : [],
395
- "msr_modifiers" : [],
396
- }
397
- elif PLATFORM == "aarch64" :
398
- empty_cpu_config = {
399
- "kvm_capabilities" : [],
400
- "reg_modifiers" : [],
401
- "vcpu_features" : [],
402
- }
403
- assert json .loads (cpu_config_1 .read_text (encoding = "utf-8" )) == empty_cpu_config
404
- assert json .loads (cpu_config_2 .read_text (encoding = "utf-8" )) == empty_cpu_config
379
+ # Dump fingerprints with the helper tool.
380
+ fingerprint_1 = tmp_path / "fingerprint_1.json"
381
+ cpu_template_helper .fingerprint_dump (fingerprint_1 )
382
+ fingerprint_2 = tmp_path / "fingerprint_2.json"
383
+ cpu_template_helper .fingerprint_dump (fingerprint_2 )
384
+
385
+ # Compare them.
386
+ cpu_template_helper .fingerprint_compare (fingerprint_1 , fingerprint_2 )
0 commit comments