fstests: Make the use of "--badname" conditional
PATCH 1/1 fstests: Make the use of "--badname" conditional
From: Chuck Lever <[email protected]>
RHEL 8 does not implement "useradd --badname". Use the --badname option conditionally, based on OS family.
Reported-by Scott Mayhew <[email protected]>
Fixes 08f095cf74f1 ("fstests: Enable creation of group "123456-fsgqa" on SuSE")
Signed-off-by Chuck Lever <[email protected]>
--- playbooks/roles/fstests/defaults/main.yml | 1 + playbooks/roles/fstests/tasks/install-deps/suse/main.yml | 4 ++++ playbooks/roles/fstests/tasks/main.yml | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-)
playbooks/roles/fstests/defaults/main.yml +1 -0
@@ -12,6 +12,7 @@ infer_uid_and_group: False oscheck_extra_args: "" limit_tests: "" dynamic_limit_tests: +badname_arg: "" fstests_start_after: False fstests_start_after_test: ""
playbooks/roles/fstests/tasks/install-deps/suse/main.yml +4 -0
@@ -247,3 +247,7 @@ when: - repos_present|bool - fstests_fstyp == "cifs" + +- name: Set the "--badname" arg + ansible.builtin.set_fact: + badname_arg: "--badname"
playbooks/roles/fstests/tasks/main.yml +1 -1
@@ -882,7 +882,7 @@ become: yes become_flags: 'su - -c' become_method: sudo - ansible.builtin.command: "useradd --badname -d /home/{{ item }} -U {{ item }}" + ansible.builtin.command: "useradd {{ badname_arg }} -d /home/{{ item }} -U {{ item }}" with_items: - 123456-fsgqa - fsgqa
base-commit: 1599e4587893efc07569f97adf7430935b6cf31c
Signature · 1 line
2.44.0
Quoted 8 lines · On Sun, 21 Apr 2024, [email protected] wrote:
From: Chuck Lever <[email protected]>
RHEL 8 does not implement "useradd --badname". Use the --badname option conditionally, based on OS family.
Reported-by Scott Mayhew <[email protected]>Fixes 08f095cf74f1 ("fstests: Enable creation of group "123456-fsgqa" on SuSE")Signed-off-by Chuck Lever <[email protected]>
Thanks, that fixes the issue on RHEL8 for me.
Acked-by Scott Mayhew <[email protected]>
-Scott
Quoted 49 lines
--- playbooks/roles/fstests/defaults/main.yml | 1 + playbooks/roles/fstests/tasks/install-deps/suse/main.yml | 4 ++++ playbooks/roles/fstests/tasks/main.yml | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-)playbooks/roles/fstests/defaults/main.yml +1
-0@@ -12,6 +12,7 @@ infer_uid_and_group: False oscheck_extra_args: "" limit_tests: "" dynamic_limit_tests: +badname_arg: "" fstests_start_after: False fstests_start_after_test: ""playbooks/roles/fstests/tasks/install-deps/suse/main.yml +4
-0@@ -247,3 +247,7 @@ when: - repos_present|bool - fstests_fstyp == "cifs" + +- name: Set the "--badname" arg + ansible.builtin.set_fact: + badname_arg: "--badname"playbooks/roles/fstests/tasks/main.yml +1
-1@@ -882,7 +882,7 @@ become: yes become_flags: 'su - -c' become_method: sudo - ansible.builtin.command: "useradd --badname -d /home/{{ item }} -U {{ item }}" + ansible.builtin.command: "useradd {{ badname_arg }} -d /home/{{ item }} -U {{ item }}" with_items: - 123456-fsgqa - fsgqabase-commit:
1599e4587893efc07569f97adf7430935b6cf31cSignature · 1 line
2.44.0