public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] fstests: Make the use of "--badname" conditional
@ 2024-04-21 20:50 cel
  2024-04-22  1:11 ` Scott Mayhew
  0 siblings, 1 reply; 2+ messages in thread
From: cel @ 2024-04-21 20:50 UTC (permalink / raw)
  To: kdevops; +Cc: Chuck Lever, Scott Mayhew

From: Chuck Lever <chuck.lever@oracle.com>

RHEL 8 does not implement "useradd --badname". Use the --badname
option conditionally, based on OS family.

Reported-by: Scott Mayhew <smayhew@redhat.com>
Fixes: 08f095cf74f1 ("fstests: Enable creation of group "123456-fsgqa" on SuSE")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 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(-)

diff --git a/playbooks/roles/fstests/defaults/main.yml b/playbooks/roles/fstests/defaults/main.yml
index 72100e934c39..302341420b58 100644
--- a/playbooks/roles/fstests/defaults/main.yml
+++ b/playbooks/roles/fstests/defaults/main.yml
@@ -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: ""
diff --git a/playbooks/roles/fstests/tasks/install-deps/suse/main.yml b/playbooks/roles/fstests/tasks/install-deps/suse/main.yml
index 4520451dffbd..c4df15b9d677 100644
--- a/playbooks/roles/fstests/tasks/install-deps/suse/main.yml
+++ b/playbooks/roles/fstests/tasks/install-deps/suse/main.yml
@@ -247,3 +247,7 @@
   when:
     - repos_present|bool
     - fstests_fstyp == "cifs"
+
+- name: Set the "--badname" arg
+  ansible.builtin.set_fact:
+    badname_arg: "--badname"
diff --git a/playbooks/roles/fstests/tasks/main.yml b/playbooks/roles/fstests/tasks/main.yml
index 6a78ff0938de..68f94fe8ed3e 100644
--- a/playbooks/roles/fstests/tasks/main.yml
+++ b/playbooks/roles/fstests/tasks/main.yml
@@ -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
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-22  1:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-21 20:50 [PATCH] fstests: Make the use of "--badname" conditional cel
2024-04-22  1:11 ` Scott Mayhew

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox