From 874eb351a6cbff978ea18dca3a1214655c66e0cc Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Thu, 7 Jan 2021 15:06:27 -0500 Subject: [PATCH 1/2] - Make content check fro dracut config version specific + Only kernels prior to 12 SP5 have a virtio module. Further with the 12 SP5 and later kernels virtio modules of any kind are no longer needed in the initrd for instance type portability. --- .../tests/SLES/EC2/test_sles_ec2_x86_64_dracut_conf.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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 index 6d318c43..e49a0647 100644 --- 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 @@ -1,3 +1,5 @@ +import pytest + def test_sles_ec2_x86_64_dracut_conf(host): needed_drivers = ( 'ena', @@ -8,6 +10,8 @@ def test_sles_ec2_x86_64_dracut_conf(host): 'xen-blkfront', 'xen-netfront' ) + version = get_release_value('VERSION') + assert version dracut_conf = host.file('/etc/dracut.conf.d/07-aws-type-switch.conf') @@ -15,4 +19,9 @@ def test_sles_ec2_x86_64_dracut_conf(host): 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) From d7caaf38ccfca44ffdc8f97966ec9e5504051252 Mon Sep 17 00:00:00 2001 From: Sean Marlow Date: Tue, 12 Jan 2021 16:54:20 -0600 Subject: [PATCH 2/2] Skip test if arch not x86_64. Rename test to be generic. And fix fixture imports. --- ...2_x86_64_dracut_conf.py => test_sles_ec2_dracut_conf.py} | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) rename usr/share/lib/img_proof/tests/SLES/EC2/{test_sles_ec2_x86_64_dracut_conf.py => test_sles_ec2_dracut_conf.py} (76%) 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_dracut_conf.py similarity index 76% rename from usr/share/lib/img_proof/tests/SLES/EC2/test_sles_ec2_x86_64_dracut_conf.py rename to usr/share/lib/img_proof/tests/SLES/EC2/test_sles_ec2_dracut_conf.py index e49a0647..6b6f8403 100644 --- 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_dracut_conf.py @@ -1,6 +1,10 @@ import pytest -def test_sles_ec2_x86_64_dracut_conf(host): + +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',