diff --git a/usr/share/lib/img_proof/tests/SLES/EC2/test_sles_ec2_dracut_conf.py b/usr/share/lib/img_proof/tests/SLES/EC2/test_sles_ec2_dracut_conf.py new file mode 100644 index 00000000..6b6f8403 --- /dev/null +++ b/usr/share/lib/img_proof/tests/SLES/EC2/test_sles_ec2_dracut_conf.py @@ -0,0 +1,31 @@ +import pytest + + +def test_sles_ec2_dracut_conf(host, get_release_value, determine_architecture): + if determine_architecture() != 'X86_64': + pytest.skip('Only x86_64 architecture is tested.') + + needed_drivers = ( + 'ena', + 'nvme', + 'nvme-core', + 'virtio', + 'virtio_scsi', + 'xen-blkfront', + 'xen-netfront' + ) + version = get_release_value('VERSION') + assert version + + dracut_conf = host.file('/etc/dracut.conf.d/07-aws-type-switch.conf') + + assert dracut_conf.exists + assert dracut_conf.is_file + + for driver in needed_drivers: + if ( + driver.startswith('virtio') and + (version.startswith('15') or version == '12-SP5') + ): + continue + assert dracut_conf.contains(driver) diff --git a/usr/share/lib/img_proof/tests/SLES/EC2/test_sles_ec2_x86_64_dracut_conf.py b/usr/share/lib/img_proof/tests/SLES/EC2/test_sles_ec2_x86_64_dracut_conf.py deleted file mode 100644 index 6d318c43..00000000 --- a/usr/share/lib/img_proof/tests/SLES/EC2/test_sles_ec2_x86_64_dracut_conf.py +++ /dev/null @@ -1,18 +0,0 @@ -def test_sles_ec2_x86_64_dracut_conf(host): - needed_drivers = ( - 'ena', - 'nvme', - 'nvme-core', - 'virtio', - 'virtio_scsi', - 'xen-blkfront', - 'xen-netfront' - ) - - dracut_conf = host.file('/etc/dracut.conf.d/07-aws-type-switch.conf') - - assert dracut_conf.exists - assert dracut_conf.is_file - - for driver in needed_drivers: - assert dracut_conf.contains(driver)