Skip to contentSkip to conversation

fstests: modify user name beginning with non-digit

PATCH In review Yong Sun 2 participants 2 messages Jun 5, 2020

lore
Share & tools
lore

Yong Sun

author
#0 lore raw

PATCH v3 1/1 fstests: modify user name beginning with non-digit

openSUSE and SLE don't support username begin with digit, so it will skip test generic/597 and generic/598 by lack of 123456-fsgqa user. generic/597 and 598 are not test username begin with digit on purpose (different with generic/381). It's will be helpful to use an username begin with non-digit in this case.

---
v2: Remove invalid comments after change
v3: Add relevant comment back and choose a better username

---
 README            | 1 +
 tests/generic/597 | 6 ++----
 tests/generic/598 | 6 ++----
 3 files changed, 5 insertions(+), 8 deletions(-)
README +1 -0
index 094a7742..f1fac399 100644
@@ -22,6 +22,7 @@ _______________________
 - create fsgqa test user ("sudo useradd -m fsgqa")
 - create fsgqa group ("sudo groupadd fsgqa")
 - create 123456-fsgqa test user ("sudo useradd 123456-fsgqa")
+- create fsgqa2 test user ("sudo useradd fsgqa2")
 
 ______________________
 USING THE FSQA SUITE
tests/generic/597 +2 -4
index 1d87a23a..df6911a1 100755
@@ -41,13 +41,11 @@ _supported_os Linux
 _require_test
 _require_sysctl_variable fs.protected_symlinks
 _require_sysctl_variable fs.protected_hardlinks
-# su in _require_user prints warnings about user name starts with a digit,
-# discard the warning
-_require_user 123456-fsgqa >/dev/null 2>&1
+_require_user fsgqa2
 # Do this SECOND so that qa_user is fsgqa, and _user_do uses that account
 _require_user fsgqa
 
-OWNER=123456-fsgqa
+OWNER=fsgqa2
 OTHER=fsgqa
 
 # Save current system state to reset when done
tests/generic/598 +2 -4
index 998b62cf..119d5644 100755
@@ -41,13 +41,11 @@ _supported_os Linux
 _require_test
 _require_sysctl_variable fs.protected_regular
 _require_sysctl_variable fs.protected_fifos
-# su in _require_user prints warnings about user name starts with a digit,
-# discard the warning
-_require_user 123456-fsgqa >/dev/null 2>&1
+_require_user fsgqa2
 # Do this SECOND so that qa_user is fsgqa, and _user_do uses that account
 _require_user fsgqa
 
-USER1=123456-fsgqa
+USER1=fsgqa2
 USER2=fsgqa
 
 # Save current system state to reset when done
Signature · 1 line
2.26.2
Reviewed-by on v3 1/1
#1 lore raw

Hi Sero,

Quoted 4 lines

openSUSE and SLE don't support username begin with digit, so it will skip test generic/597 and generic/598 by lack of 123456-fsgqa user. generic/597 and 598 are not test username begin with digit on purpose (different with generic/381). It's will be helpful to use an username

nit: "It's will": maybe typo, do you mean "it would be"?

Quoted 1 line

begin with non-digit in this case.

Quoted 4 lines

+++ b/tests/generic/597

tests/generic/597 +0 -0
@@ -41,13 +41,11 @@ _supported_os Linux
 _require_test
 _require_sysctl_variable fs.protected_symlinks

tests/generic/597 _supported_os Linux · line 48

Quoted 10 lines
tests/generic/597 +2 -4
 _require_sysctl_variable fs.protected_hardlinks
-# su in _require_user prints warnings about user name starts with a digit,
-# discard the warning
-_require_user 123456-fsgqa >/dev/null 2>&1
+_require_user fsgqa2
 # Do this SECOND so that qa_user is fsgqa, and _user_do uses that account
 _require_user fsgqa
-OWNER=123456-fsgqa
+OWNER=fsgqa2
 OTHER=fsgqa

BTW fsgqa is default parameter for _require_user, it wouldn't have to be specified on second call, but that's not important, I'd personally reduce duplicity a bit, but up to you (tiny detail, current patch is perfectly ok):

* tests/generic/598

USER1=fsgqa2
USER2=fsgqa

_require_user $USER1
# Do this SECOND so that qa_user is fsgqa, and _user_do uses that account _require_user $USER2

* tests/generic/597

OWNER=fsgqa2
OTHER=fsgqa

_require_user $OWNER
# Do this SECOND so that qa_user is fsgqa, and _user_do uses that account _require_user $OTHER

Kind regards,
Petr