Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_boot_fipsenabled: updated the steps to enable fips in RHEL-10 #477

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion os_tests/tests/test_cloud_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -3723,7 +3723,7 @@ def test_cloudinit_clean_configs(self):
test_type:
functional
test_level:
Component
component
maintainer:
[email protected]
description: |
Expand Down
4 changes: 2 additions & 2 deletions os_tests/tests/test_general_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def test_imds_tracer(self):
test_type:
functional
test_level:
Component
component
maintainer:
xiliang
description: |
Expand Down Expand Up @@ -988,7 +988,7 @@ def test_sys_read_capability(self):
test_type:
functional
test_level:
Component
component
maintainer:
[email protected]
description: |
Expand Down
2 changes: 1 addition & 1 deletion os_tests/tests/test_image_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_build_rhel_bootc_image(self):
test_type:
functional
test_level:
Component
component
maintainer:
[email protected]
description: |
Expand Down
25 changes: 18 additions & 7 deletions os_tests/tests/test_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_boot_debugkernel(self):
test_type:
functional
test_level:
Component
component
maintainer:
[email protected]
description: |
Expand Down Expand Up @@ -265,7 +265,7 @@ def test_boot_fipsenabled(self):
utils_lib.run_cmd(self, 'sudo dmesg', msg='save dmesg')
cmd = 'sudo grubby --update-kernel=ALL --remove-args="fips=1"'
utils_lib.run_cmd(self, cmd, msg='Disable fips!')
else:
elif 'el8' in output or 'el9' in output:
fips_enable_cmd = 'sudo fips-mode-setup --enable'
out = utils_lib.run_cmd(self, fips_enable_cmd, msg='Enable fips!', timeout=600)
if 'No space left' in out:
Expand All @@ -289,6 +289,17 @@ def test_boot_fipsenabled(self):
utils_lib.run_cmd(self, 'sudo dmesg', msg='save dmesg')
cmd = 'sudo fips-mode-setup --disable'
utils_lib.run_cmd(self, cmd, msg='Disable fips!')
else:
# RHEL-65652 Remove fips-mode-setup, below steps are only for test purpose
boot_partition = utils_lib.run_cmd(self, 'findmnt --first --noheadings -o SOURCE /boot', msg='find boot partition')
boot_uuid = utils_lib.run_cmd(self, 'sudo blkid --output value --match-tag UUID {}'.format(boot_partition.strip('\n')),expect_ret=0,msg='find boot partition uuid')
fips_enable_cmd = 'sudo grubby --update-kernel=ALL --args="fips=1 boot=UUID={}"'.format(boot_uuid.strip('\n'))
out = utils_lib.run_cmd(self, fips_enable_cmd, msg='Enable fips!', timeout=600)
utils_lib.run_cmd(self, 'sudo reboot', msg='reboot system under test')
time.sleep(10)
utils_lib.init_connection(self, timeout=self.ssh_timeout)
utils_lib.run_cmd(self, 'cat /proc/cmdline', expect_kw='fips=1')
utils_lib.run_cmd(self, 'sudo dmesg', expect_kw="fips mode: enabled", msg='save dmesg')

def test_boot_hpet_mmap_enabled(self):
"""
Expand Down Expand Up @@ -325,7 +336,7 @@ def test_boot_hpet_mmap_enabled(self):
test_type:
functional
test_level:
Component
component
maintainer:
[email protected]
description: |
Expand Down Expand Up @@ -432,7 +443,7 @@ def test_boot_sev_snp(self):
test_type:
functional
test_level:
Component
component
maintainer:
[email protected]
description: |
Expand Down Expand Up @@ -494,7 +505,7 @@ def test_boot_mem_encrypt_on(self):
test_type:
functional
test_level:
Component
component
maintainer:
[email protected]
description: |
Expand Down Expand Up @@ -778,7 +789,7 @@ def test_launch_pingable(self):
test_type:
functional
test_level:
Component
component
maintainer:
[email protected]
description: |
Expand Down Expand Up @@ -1678,7 +1689,7 @@ def tearDown(self):
utils_lib.finish_case(self)
reboot_require = False
addon_args = ["hpet_mmap=1", "mitigations=auto,nosmt", "usbcore.quirks=quirks=0781:5580:bk,0a5c:5834:gij",
"nr_cpus=1","nr_cpus=2", "nr_cpus=4", "nr_cpus=5", "intel_iommu=on", "fips=1","mem_encrypt=on"]
"nr_cpus=1","nr_cpus=2", "nr_cpus=4", "nr_cpus=5", "intel_iommu=on", "fips=1","mem_encrypt=on","boot"]
cmdline = utils_lib.run_cmd(self, 'cat /proc/cmdline')
if cmdline:
for arg in addon_args:
Expand Down
6 changes: 3 additions & 3 deletions os_tests/tests/test_network_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ def test_tcp_checksum_offload(self):
test_type:
functional
test_level:
Component
component
maintainer:
[email protected]
description: |
Expand Down Expand Up @@ -1878,7 +1878,7 @@ def test_second_ip_hotplug_multi(self):
test_type:
functional
test_level:
Component
component
maintainer:
[email protected]
description: |
Expand Down Expand Up @@ -2107,7 +2107,7 @@ def test_veth_nic_rx(self):
test_type:
functional
test_level:
Component
component
maintainer:
[email protected]
description: |
Expand Down
2 changes: 1 addition & 1 deletion os_tests/tests/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_dnf_update(self):
test_type:
functional
test_level:
Component
component
maintainer:
[email protected]
description: |
Expand Down
2 changes: 1 addition & 1 deletion os_tests/tests/test_vtpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def test_tpm2_gettime(self):
test_type:
functional
test_level:
Component
component
maintainer:
[email protected]
description: |
Expand Down
Loading