Skip to contentSkip to conversation

fstests: modify user name beginning with non-digit

PATCH Superseded Yong Sun 3 participants 5 messages Jun 3, 2020 – Jun 4, 2020

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Yong Sun

author
#0 lore raw

PATCH 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.

---
 README            | 1 +
 tests/generic/597 | 4 ++--
 tests/generic/598 | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)
README +1 -0
index 094a7742..cffa0bc6 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 fsgqa-123456 test user ("sudo useradd fsgqa-123456")
 
 ______________________
 USING THE FSQA SUITE
tests/generic/597 +2 -2
index 1d87a23a..c4d524b7 100755
@@ -43,11 +43,11 @@ _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 fsgqa-123456 >/dev/null 2>&1
 # Do this SECOND so that qa_user is fsgqa, and _user_do uses that account
 _require_user fsgqa
 
-OWNER=123456-fsgqa
+OWNER=fsgqa-123456
 OTHER=fsgqa
 
 # Save current system state to reset when done
tests/generic/598 +2 -2
index 998b62cf..1cf9a3d1 100755
@@ -43,11 +43,11 @@ _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 fsgqa-123456 >/dev/null 2>&1
 # Do this SECOND so that qa_user is fsgqa, and _user_do uses that account
 _require_user fsgqa
 
-USER1=123456-fsgqa
+USER1=fsgqa-123456
 USER2=fsgqa
 
 # Save current system state to reset when done
Signature · 1 line
2.26.2
#1 lore raw

Hi Sero,

Quoted 18 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 begin with non-digit in this case.

---
 README            | 1 +
 tests/generic/597 | 4 ++--
 tests/generic/598 | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)
README +0 -0
index 094a7742..cffa0bc6 100644

README _______________________ · line 24

Quoted 3 lines
README +0 -0
@@ -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")

I thought fsgqa-123456 is replacement for 123456-fsgqa. Thus I'd delete this line.

README _______________________ · line 25

Quoted 1 line
README +1 -0
+- create fsgqa-123456 test user ("sudo useradd fsgqa-123456")

Also test tests/generic/381 still uses 123456-fsgqa. Shouldn't be replaced as well?

tests/generic/597 _require_sysctl_variable fs.protected_symlinks · line 46

Quoted 12 lines
README +0 -0
 ______________________
 USING THE FSQA SUITE
tests/generic/597 +1 -1
index 1d87a23a..c4d524b7 100755
@@ -43,11 +43,11 @@ _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 fsgqa-123456 >/dev/null 2>&1

I that redirection to /dev/null was due errors caused by starting with digits. As other _require_user calls don't have it, I'd remove the redirection. + remove that comment "su in _require_user prints warnings about user name starts with a digit," ... which is now useless/invalid.

Eric, was there a reson to use user name which starts with digit?

Quoted 16 lines
tests/generic/597 +1 -1
 # Do this SECOND so that qa_user is fsgqa, and _user_do uses that account
 _require_user fsgqa
 
-OWNER=123456-fsgqa
+OWNER=fsgqa-123456
 OTHER=fsgqa
 
 # Save current system state to reset when done
tests/generic/598 +0 -0
index 998b62cf..1cf9a3d1 100755
@@ -43,11 +43,11 @@ _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

tests/generic/598 _require_sysctl_variable fs.protected_regular · line 53

Quoted 10 lines
tests/generic/598 +2 -2
-_require_user 123456-fsgqa >/dev/null 2>&1
+_require_user fsgqa-123456 >/dev/null 2>&1
 # Do this SECOND so that qa_user is fsgqa, and _user_do uses that account
 _require_user fsgqa
 
-USER1=123456-fsgqa
+USER1=fsgqa-123456
 USER2=fsgqa
 
 # Save current system state to reset when done

Kind regards,
Petr

#2 lore raw
Quoted 25 lines · Petr Vorel

Hi Sero,

Quoted 18 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 begin with non-digit in this case.

---
 README            | 1 +
 tests/generic/597 | 4 ++--
 tests/generic/598 | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)
README +0 -0
index 094a7742..cffa0bc6 100644

README _______________________ · line 24

Quoted 3 lines
README +0 -0
@@ -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")

I thought fsgqa-123456 is replacement for 123456-fsgqa. Thus I'd delete this line.

Quoted 4 lines

README _______________________ · line 25

Quoted 1 line
README +1 -0
+- create fsgqa-123456 test user ("sudo useradd fsgqa-123456")

Also test tests/generic/381 still uses 123456-fsgqa. Shouldn't be replaced as well?

I don't know why this case need user '123456-fsgqa', but the generic/381 need the 123456-fsgqa necessarily. It cover a bug about how xfs_quota deal with user name begin with digits.

Thanks,
Zorro

Quoted 50 lines

tests/generic/597 _require_sysctl_variable fs.protected_symlinks · line 46

Quoted 13 lines
README +0 -0
 ______________________
 USING THE FSQA SUITE
tests/generic/597 +1 -1
index 1d87a23a..c4d524b7 100755
@@ -43,11 +43,11 @@ _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 fsgqa-123456 >/dev/null 2>&1

I that redirection to /dev/null was due errors caused by starting with digits. As other _require_user calls don't have it, I'd remove the redirection. + remove that comment "su in _require_user prints warnings about user name starts with a digit," ... which is now useless/invalid.

Eric, was there a reson to use user name which starts with digit?

Quoted 16 lines
tests/generic/597 +1 -1
 # Do this SECOND so that qa_user is fsgqa, and _user_do uses that account
 _require_user fsgqa
 
-OWNER=123456-fsgqa
+OWNER=fsgqa-123456
 OTHER=fsgqa
 
 # Save current system state to reset when done
tests/generic/598 +0 -0
index 998b62cf..1cf9a3d1 100755
@@ -43,11 +43,11 @@ _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

tests/generic/598 _require_sysctl_variable fs.protected_regular · line 53

Quoted 10 lines
tests/generic/598 +2 -2
-_require_user 123456-fsgqa >/dev/null 2>&1
+_require_user fsgqa-123456 >/dev/null 2>&1
 # Do this SECOND so that qa_user is fsgqa, and _user_do uses that account
 _require_user fsgqa
 
-USER1=123456-fsgqa
+USER1=fsgqa-123456
 USER2=fsgqa
 
 # Save current system state to reset when done

Kind regards,
Petr

#3 lore raw

Hi Zorro,

Quoted 6 lines
Quoted 2 lines

Also test tests/generic/381 still uses 123456-fsgqa. Shouldn't be replaced as well?

I don't know why this case need user '123456-fsgqa', but the generic/381 need the 123456-fsgqa necessarily. It cover a bug about how xfs_quota deal with user name begin with digits.

Thanks for a quick clarification, sorry for overlooking the test description.

Kind regards,
Petr

author
#4 lore raw
In reply to Petr Vorel
Quoted 26 lines · Petr Vorel <[email protected]> 于2020年6月4日周四 下午4:30写道:

Hi Sero,

Quoted 18 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 begin with non-digit in this case.

---
 README            | 1 +
 tests/generic/597 | 4 ++--
 tests/generic/598 | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)
README +0 -0
index 094a7742..cffa0bc6 100644

README _______________________ · line 24

Quoted 3 lines
README +0 -0
@@ -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")

I thought fsgqa-123456 is replacement for 123456-fsgqa. Thus I'd delete this line.

Quoted 4 lines

README _______________________ · line 25

Quoted 1 line
README +1 -0
+- create fsgqa-123456 test user ("sudo useradd fsgqa-123456")

Also test tests/generic/381 still uses 123456-fsgqa. Shouldn't be replaced as well?

As Zorro said, generic/381 is purpose to test digital started username, modify it will make that test meaningless. So better leave it skip when system don't support digital started username.

Quoted 17 lines

tests/generic/597 _require_sysctl_variable fs.protected_symlinks · line 46

Quoted 13 lines
README +0 -0
 ______________________
 USING THE FSQA SUITE
tests/generic/597 +1 -1
index 1d87a23a..c4d524b7 100755
@@ -43,11 +43,11 @@ _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 fsgqa-123456 >/dev/null 2>&1

I that redirection to /dev/null was due errors caused by starting with digits. As other _require_user calls don't have it, I'd remove the redirection. + remove that comment "su in _require_user prints warnings about user name starts with a digit," ... which is now useless/invalid.

Nice catch, then no need to redirection and comments also invalid. I'll modify it in v2.

Quoted 24 lines

Eric, was there a reson to use user name which starts with digit?

Quoted 20 lines
tests/generic/597 +1 -1
 # Do this SECOND so that qa_user is fsgqa, and _user_do uses that account
 _require_user fsgqa
 
-OWNER=123456-fsgqa
+OWNER=fsgqa-123456
 OTHER=fsgqa
 
 # Save current system state to reset when done
tests/generic/598 +1 -1
index 998b62cf..1cf9a3d1 100755
@@ -43,11 +43,11 @@ _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 fsgqa-123456 >/dev/null 2>&1
 # Do this SECOND so that qa_user is fsgqa, and _user_do uses that account
 _require_user fsgqa
Quoted 8 lines

tests/generic/598 _require_sysctl_variable fs.protected_regular · line 53

Quoted 5 lines
tests/generic/598 +1 -1
-USER1=123456-fsgqa
+USER1=fsgqa-123456
 USER2=fsgqa
 
 # Save current system state to reset when done

Kind regards,
Petr

Thanks,
Sero