@@ -30,13 +30,17 @@ def test_not_x86_64_passes(monkeypatch, arch):
3030
3131
3232@pytest .mark .parametrize (
33- ('target_ver' , 'cpu_flags' ),
33+ ('target_ver' , 'cpu_flags' , 'dst_distro' ),
3434 [
35- ('9.0' , ENTIRE_V2_FLAG_SET ),
36- ('10.0' , ENTIRE_V3_FLAG_SET )
35+ ('9.0' , ENTIRE_V2_FLAG_SET , 'rhel' ),
36+ ('10.0' , ENTIRE_V3_FLAG_SET , 'rhel' ),
37+ ('9.0' , ENTIRE_V2_FLAG_SET , 'almalinux' ),
38+ # AlmaLinux 10 is built for x86-64-v2 as well, so v2 flags are enough
39+ ('10.0' , ENTIRE_V2_FLAG_SET , 'almalinux' ),
40+ ('10.0' , ENTIRE_V3_FLAG_SET , 'almalinux' ),
3741 ]
3842)
39- def test_valid_microarchitecture (monkeypatch , target_ver , cpu_flags ):
43+ def test_valid_microarchitecture (monkeypatch , target_ver , cpu_flags , dst_distro ):
4044 """
4145 Test no report is generated on a valid microarchitecture
4246 """
@@ -45,6 +49,7 @@ def test_valid_microarchitecture(monkeypatch, target_ver, cpu_flags):
4549 monkeypatch .setattr (api , 'current_logger' , logger_mocked ())
4650
4751 monkeypatch .setattr (api , 'current_actor' , CurrentActorMocked (arch = ARCH_X86_64 , dst_ver = target_ver ,
52+ dst_distro = dst_distro ,
4853 msgs = [CPUInfo (flags = cpu_flags )]))
4954
5055 checkmicroarchitecture .process ()
@@ -54,21 +59,25 @@ def test_valid_microarchitecture(monkeypatch, target_ver, cpu_flags):
5459
5560
5661@pytest .mark .parametrize (
57- ('target_ver' , 'cpu_flags' ),
62+ ('target_ver' , 'cpu_flags' , 'dst_distro' ),
5863 (
59- ('9.0' , checkmicroarchitecture .X86_64_BASELINE_FLAGS ),
60- ('10.0' , ENTIRE_V2_FLAG_SET ),
64+ ('9.0' , checkmicroarchitecture .X86_64_BASELINE_FLAGS , 'rhel' ),
65+ ('10.0' , ENTIRE_V2_FLAG_SET , 'rhel' ),
66+ ('9.0' , checkmicroarchitecture .X86_64_BASELINE_FLAGS , 'almalinux' ),
67+ # AlmaLinux 10 still requires v2 as the baseline
68+ ('10.0' , checkmicroarchitecture .X86_64_BASELINE_FLAGS , 'almalinux' ),
6169 )
6270)
63- def test_invalid_microarchitecture (monkeypatch , target_ver , cpu_flags ):
71+ def test_invalid_microarchitecture (monkeypatch , target_ver , cpu_flags , dst_distro ):
6472 """
6573 Test report is generated on x86-64 architecture with invalid microarchitecture and the upgrade is inhibited
6674 """
6775 cpu_info = CPUInfo (flags = cpu_flags )
6876 monkeypatch .setattr (reporting , "create_report" , create_report_mocked ())
6977 monkeypatch .setattr (api , 'current_logger' , logger_mocked ())
7078 monkeypatch .setattr (api , 'current_actor' ,
71- CurrentActorMocked (arch = ARCH_X86_64 , msgs = [cpu_info ], dst_ver = target_ver ))
79+ CurrentActorMocked (arch = ARCH_X86_64 , msgs = [cpu_info ], dst_ver = target_ver ,
80+ dst_distro = dst_distro ))
7281
7382 checkmicroarchitecture .process ()
7483
0 commit comments