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

tests: Do not 'fips-mode-setup' to enable FIPS on RHEL 10 #489

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
21 changes: 19 additions & 2 deletions tests/tests_luks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,28 @@
tags:
- tests::lvm
tasks:
- name: Enable FIPS mode
- name: Enable FIPS mode (RHEL 10 and newer)
when:
- lookup("env", "SYSTEM_ROLES_TEST_FIPS") == "true"
- ansible_facts["os_family"] == "RedHat"
- ansible_facts["distribution_major_version"] | int > 9
block:
- name: Enable FIPS mode
changed_when: false
shell: |
set -euxo pipefail
kernel=$(grubby --default-kernel)
grubby --update-kernel=$kernel --args=fips=1

- name: Reboot
reboot:
test_command: grep 1 /proc/sys/crypto/fips_enabled
- name: Enable FIPS mode (RHEL 8 and 9)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline

Suggested change
- name: Enable FIPS mode (RHEL 8 and 9)
- name: Enable FIPS mode (RHEL 8 and 9)

when:
- lookup("env", "SYSTEM_ROLES_TEST_FIPS") == "true"
- ansible_facts["os_family"] == "RedHat"
- ansible_facts["distribution_major_version"] | int > 7
- ansible_facts["distribution_major_version"] | int < 10
block:
- name: Enable FIPS mode
command: fips-mode-setup --enable
Expand All @@ -26,7 +43,7 @@
reboot:
test_command: fips-mode-setup --check

- name: Enable FIPS mode
- name: Enable FIPS mode (RHEL 7)
when:
- lookup("env", "SYSTEM_ROLES_TEST_FIPS") == "true"
- ansible_facts["os_family"] == "RedHat"
Expand Down