Skip to contentSkip to conversation

acl: Fix nfs ptest failure

PATCH Superseded [email protected] 3 participants 5 messages Jun 19, 2024 – Jun 24, 2024

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acl: Fix nfs ptest failure

From: Mingli Yu <[email protected]>

* The date such as "Jun 13" should take 2 columns, so the expected check item "test/sub2" should the column 9.

 # ls test/sub2 -dl
 drwxr-xr-x 2 root root 4096 Jun 13 06:01 test/sub2

Corret the check item to fix the below failure in the test/nfsacl.test.
[11] $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}' -- failed
drwxr-xr-x 07:23 != drwxr-xr-x test/sub2
-rw-r--r-- 07:23 != -rw-r--r-- test/sub2/blah

* Use the abosulte path otherwise we won't find the expected file blah.

* The calls to getgrnam_r would always fail because the size of the buffer was smaller than the minimum (170000) specified in the test implementations of getgrnam_r and getpwnam_r. Use test_get*_match directly because getpwnam and getgrnam should never fail on ERANGE.

This commit fixes the following failure in the test/nfs/nfs-dir.test test:

[16] $ su bin -- failed
su: user bin does not exist != ~

 # ./run-ptest
PASS: test/cp.test
PASS: test/getfacl-lfs.test
PASS: test/getfacl-noacl.test
PASS: test/getfacl-recursive.test
PASS: test/malformed-restore.test
PASS: test/misc.test
PASS: test/sbits-restore.test
PASS: test/setfacl-X.test
PASS: test/utf8-filenames.test
PASS: test/root/getfacl.test
PASS: test/root/permissions.test
PASS: test/root/restore.test
PASS: test/root/setfacl.test
PASS: test/nfs/nfsacl.test
PASS: test/nfs/nfs-dir.test
============================================================================
Testsuite summary for acl 2.3.2
============================================================================
 # TOTAL: 15
 # PASS:  15
 # SKIP:  0
 # XFAIL: 0
 # FAIL:  0
 # XPASS: 0
 # ERROR: 0
============================================================================
---
 .../0001-test-Unify-the-nfs-test-output.patch | 40 +++++++++++
 ...s-nfs-dir.test-Use-the-abosulte-path.patch | 46 +++++++++++++
 ...s-nfsacl.test-Correct-the-check-item.patch | 51 ++++++++++++++
 ...0001-tests-fix-getpwnam-and-getgrnam.patch | 67 +++++++++++++++++++
 meta/recipes-support/attr/acl/run-ptest       |  1 +
 meta/recipes-support/attr/acl_2.3.2.bb        |  4 ++
 6 files changed, 209 insertions(+)
 create mode 100644 meta/recipes-support/attr/acl/0001-test-Unify-the-nfs-test-output.patch
 create mode 100644 meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch
 create mode 100644 meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch
 create mode 100644 meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch
meta/recipes-support/attr/acl/0001-test-Unify-the-nfs-test-output.patch new file +40 -0
new file mode 100644
index 0000000000..723e6cdca8
@@ -0,0 +1,40 @@
+From db81973228be2b143fdba0e3d959c016122bc29e Mon Sep 17 00:00:00 2001
+From: Mingli Yu <[email protected]>
+Date: Wed, 19 Jun 2024 14:05:44 +0800
+Subject: [PATCH] test: Unify the nfs test output
+
+The nfs tests will be put into XPASS/XFAIL category as it defined in
+XFAIL_TESTS target, group all the test only in TESTS target as we prefer
+use PASS/FAIL/SKIP to indicate the result.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Mingli Yu <[email protected]>
+---
+ test/Makemodule.am | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/test/Makemodule.am b/test/Makemodule.am
+index cffe732..609953b 100644
+--- a/test/Makemodule.am
++++ b/test/Makemodule.am
+@@ -1,6 +1,3 @@
+-XFAIL_TESTS = \
+-	test/nfs/nfsacl.test \
+-	test/nfs/nfs-dir.test
+ TESTS = \
+ 	test/cp.test \
+ 	test/getfacl-lfs.test \
+@@ -15,7 +12,8 @@ TESTS = \
+ 	test/root/permissions.test \
+ 	test/root/restore.test \
+ 	test/root/setfacl.test \
+-	$(XFAIL_TESTS)
++	test/nfs/nfsacl.test \
++	test/nfs/nfs-dir.test
+ 
+ EXTRA_DIST += \
+ 	test/make-tree \
+-- 
+2.34.1
+
meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch new file +46 -0

46 lines not on this page · raw message

meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch new file +51 -0

51 lines not on this page · raw message

meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch new file +67 -0

67 lines not on this page · raw message

meta/recipes-support/attr/acl/run-ptest +1 -0
index 3af75c84fe..7d88cc8484 100644
@@ -6,6 +6,7 @@
 
 mkdir -p /tmp/acl-ptest/test
 cp test/test.* /tmp/acl-ptest/test
+export EXPORT_PATH="/tmp/acl-ptest/test"
 
 set +e
 make test-suite.log
meta/recipes-support/attr/acl_2.3.2.bb +4 -0
index 6178473873..536ad27de7 100644
@@ -19,6 +19,10 @@ SRC_URI = "${SAVANNAH_GNU_MIRROR}/acl/${BP}.tar.gz \
            file://run-ptest \
            file://0001-tests-do-not-hardcode-the-build-path-into-a-helper-l.patch \
            file://0001-test-patch-out-failing-bits.patch \
+           file://0001-test-nfs-nfsacl.test-Correct-the-check-item.patch \
+           file://0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch \
+           file://0001-tests-fix-getpwnam-and-getgrnam.patch \
+           file://0001-test-Unify-the-nfs-test-output.patch \
            "
 
 SRC_URI[sha256sum] = "5f2bdbad629707aa7d85c623f994aa8a1d2dec55a73de5205bac0bf6058a2f7c"
Signature · 1 line
2.34.1
#1 lore raw

meta/recipes-support/attr/acl/0001-test-Unify-the-nfs-test-output.patch line 8

Quoted 3 lines · Mingli via lists.openembedded.org
meta/recipes-support/attr/acl/0001-test-Unify-the-nfs-test-output.patch new file +3 -0
+The nfs tests will be put into XPASS/XFAIL category as it defined in
+XFAIL_TESTS target, group all the test only in TESTS target as we prefer
+use PASS/FAIL/SKIP to indicate the result.

XPASS/XFAIL is fine, we don’t need to change the tests.

Quoted 7 lines
meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch new file +1 -0
new file mode 100644
index 0000000000..f990ca4a31
@@ -0,0 +1,51 @@
+From dfc6328f02821f9c6703f764ec6f53cf81daaab6 Mon Sep 17 00:00:00 2001

meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch line 11

Quoted 10 lines
meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch new file +10 -0
+From: Mingli Yu <[email protected]>
+Date: Mon, 17 Jun 2024 11:00:43 +0800
+Subject: [PATCH] test/nfs/nfsacl.test: Correct the check item
+
+The date such as "Jun 13" should take 2 columns, so the expected check
+item "test/sub2" should the column 9.
+ # ls test/sub2 -dl
+drwxr-xr-x 2 root root 4096 Jun 13 06:01 test/sub2
+
+Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/acl-devel/2024-06/msg00002.html]

What this why the test is an XFAIL? In which case the previous patch should make it clear that we’re not removing XFAIL because we don’t like it, but because the tests are now fixed.

Quoted 9 lines
meta/recipes-support/attr/acl/run-ptest +0 -0
index 3af75c84fe..7d88cc8484 100644
@@ -6,6 +6,7 @@
 

mkdir -p /tmp/acl-ptest/test
cp test/test.* /tmp/acl-ptest/test
+export EXPORT_PATH="/tmp/acl-ptest/test”

Whilst you’re here, this looks fragile. Can you use mktemp -d to make a fresh directory for each run?

Ross

#3 lore raw
In reply to [email protected]

Hello,

Quoted 52 lines · Mingli

From: Mingli Yu<[email protected]>

* The date such as "Jun 13" should take 2 columns, so the expected check item "test/sub2" should the column 9.

  # ls test/sub2 -dl
  drwxr-xr-x 2 root root 4096 Jun 13 06:01 test/sub2
   Corret the check item to fix the below failure in the test/nfsacl.test.
   [11] $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}' -- failed
   drwxr-xr-x 07:23                      != drwxr-xr-x test/sub2
   -rw-r--r-- 07:23                      != -rw-r--r-- test/sub2/blah

* Use the abosulte path otherwise we won't find the expected file blah.

* The calls to getgrnam_r would always fail because the size of the buffer was smaller than the minimum (170000) specified in the test implementations of getgrnam_r and getpwnam_r. Use test_get*_match directly because getpwnam and getgrnam should never fail on ERANGE.

This commit fixes the following failure in the test/nfs/nfs-dir.test test:

[16] $ su bin -- failed
su: user bin does not exist != ~

  # ./run-ptest
PASS: test/cp.test
PASS: test/getfacl-lfs.test
PASS: test/getfacl-noacl.test
PASS: test/getfacl-recursive.test
PASS: test/malformed-restore.test
PASS: test/misc.test
PASS: test/sbits-restore.test
PASS: test/setfacl-X.test
PASS: test/utf8-filenames.test
PASS: test/root/getfacl.test
PASS: test/root/permissions.test
PASS: test/root/restore.test
PASS: test/root/setfacl.test
PASS: test/nfs/nfsacl.test
PASS: test/nfs/nfs-dir.test
============================================================================
Testsuite summary for acl 2.3.2
============================================================================
  # TOTAL: 15
  # PASS:  15
  # SKIP:  0
  # XFAIL: 0
  # FAIL:  0
  # XPASS: 0
  # ERROR: 0
============================================================================
Quoted 2 lines

---

The patch is intended to fix a ptest failure, but could it be causing this nfsacl.test failure?

Please, check the following output:

https://autobuilder.yoctoproject.org/typhoon/#/builders/81/builds/6734/steps/13/logs/stdio

and from the autobuilder logs:

FAIL: test/nfs/nfsacl
=====================

[6] $ umask 022 -- ok
[7] $ mkdir -p test/sub -- ok
[8] $ echo blah > test/sub/blah -- ok
[10] $ cp -rp test/sub test/sub2 -- ok
[11] $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}' -- ok
[15] $ rm -rf test/sub2 -- ok
[17] $ setfacl -m u:daemon:rwx test/sub -- ok
[18] $ setfacl -dm u:daemon:rwx test/sub -- ok
[19] $ getfattr -m- test/sub -- failed
Can't exec "getfattr": No such file or directory at ./test/run line 369, <TEST_FILE> line 24. != # file: test/sub
getfattr: No such file or directory   != system.posix_acl_access
~                                     != system.posix_acl_default
~                                     !=
[25] $ cp -rp test/sub test/sub2 -- ok
[26] $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}' -- ok
[30] $ rm -rf test/sub2 -- ok
[32] $ setfacl -m u:daemon:rw test/sub/blah -- ok
[33] $ cp -rp test/sub test/sub2 -- ok
[34] $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}' -- ok
[38] $ rm -rf test/sub2 -- ok
[42] $ rm -rf test -- ok
17 commands (16 passed, 1 failed)
FAIL test/nfs/nfsacl.test (exit status: 1)

Signature · 2 lines
Best regards,
João Marcos Costa
author
#4 lore raw
Quoted 73 lines · Joao Marcos Costa via lists.openembedded.org

**
*CAUTION: This email comes from a non Wind River email account!*
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Hello,

Quoted 52 lines · Mingli

From: Mingli Yu<[email protected]>

* The date such as "Jun 13" should take 2 columns, so the expected check item "test/sub2" should the column 9.

  # ls test/sub2 -dl
  drwxr-xr-x 2 root root 4096 Jun 13 06:01 test/sub2
   Corret the check item to fix the below failure in the test/nfsacl.test.
   [11] $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}' -- failed
   drwxr-xr-x 07:23                      != drwxr-xr-x test/sub2
   -rw-r--r-- 07:23                      != -rw-r--r-- test/sub2/blah

* Use the abosulte path otherwise we won't find the expected file blah.

* The calls to getgrnam_r would always fail because the size of the buffer was smaller than the minimum (170000) specified in the test implementations of getgrnam_r and getpwnam_r. Use test_get*_match directly because getpwnam and getgrnam should never fail on ERANGE.

This commit fixes the following failure in the test/nfs/nfs-dir.test test:

[16] $ su bin -- failed
su: user bin does not exist != ~

  # ./run-ptest
PASS: test/cp.test
PASS: test/getfacl-lfs.test
PASS: test/getfacl-noacl.test
PASS: test/getfacl-recursive.test
PASS: test/malformed-restore.test
PASS: test/misc.test
PASS: test/sbits-restore.test
PASS: test/setfacl-X.test
PASS: test/utf8-filenames.test
PASS: test/root/getfacl.test
PASS: test/root/permissions.test
PASS: test/root/restore.test
PASS: test/root/setfacl.test
PASS: test/nfs/nfsacl.test
PASS: test/nfs/nfs-dir.test
============================================================================
Testsuite summary for acl 2.3.2
============================================================================
  # TOTAL: 15
  # PASS:  15
  # SKIP:  0
  # XFAIL: 0
  # FAIL:  0
  # XPASS: 0
  # ERROR: 0
============================================================================
Quoted 2 lines

---

The patch is intended to fix a ptest failure, but could it be causing this nfsacl.test failure?

Please, check the following output:

https://autobuilder.yoctoproject.org/typhoon/#/builders/81/builds/6734/steps/13/logs/stdio

and from the autobuilder logs:

FAIL: test/nfs/nfsacl
=====================

Quoted 12 lines

[6] $ umask 022 -- ok
[7] $ mkdir -p test/sub -- ok
[8] $ echo blah > test/sub/blah -- ok
[10] $ cp -rp test/sub test/sub2 -- ok
[11] $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}' -- ok
[15] $ rm -rf test/sub2 -- ok
[17] $ setfacl -m u:daemon:rwx test/sub -- ok
[18] $ setfacl -dm u:daemon:rwx test/sub -- ok
[19] $ getfattr -m- test/sub -- failed
Can't exec "getfattr": No such file or directory at ./test/run line 369, <TEST_FILE> line 24. != # file: test/sub
getfattr: No such file or directory   != system.posix_acl_access
~                                     != system.posix_acl_default

I didn't reproduce this failure in my environment.
XPASS: test/nfs/nfsacl
======================

[6] $ umask 022 -- ok
[7] $ mkdir -p test/sub -- ok
[8] $ echo blah > test/sub/blah -- ok
[10] $ cp -rp test/sub test/sub2 -- ok
[11] $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}' -- ok
[15] $ rm -rf test/sub2 -- ok
[17] $ setfacl -m u:daemon:rwx test/sub -- ok
[18] $ setfacl -dm u:daemon:rwx test/sub -- ok
[19] $ getfattr -m- test/sub -- ok
[25] $ cp -rp test/sub test/sub2 -- ok
[26] $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}' -- ok
[30] $ rm -rf test/sub2 -- ok
[32] $ setfacl -m u:daemon:rw test/sub/blah -- ok
[33] $ cp -rp test/sub test/sub2 -- ok
[34] $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}' -- ok
[38] $ rm -rf test/sub2 -- ok
[42] $ rm -rf test -- ok
17 commands (17 passed, 0 failed)
XPASS test/nfs/nfsacl.test (exit status: 0)

Thanks,

Quoted 26 lines

~                                     !=
[25] $ cp -rp test/sub test/sub2 -- ok
[26] $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}' -- ok
[30] $ rm -rf test/sub2 -- ok
[32] $ setfacl -m u:daemon:rw test/sub/blah -- ok
[33] $ cp -rp test/sub test/sub2 -- ok
[34] $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}' -- ok
[38] $ rm -rf test/sub2 -- ok
[42] $ rm -rf test -- ok
17 commands (16 passed, 1 failed)
FAIL test/nfs/nfsacl.test (exit status: 1)

Signature · 12 lines
Best regards,
João Marcos Costa



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#201005): https://lists.openembedded.org/g/openembedded-core/message/201005
Mute This Topic: https://lists.openembedded.org/mt/106757200/3618448
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
author
#2 lore raw
In reply to Ross Burton
Quoted 9 lines · Ross Burton

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

meta/recipes-support/attr/acl/0001-test-Unify-the-nfs-test-output.patch line 8

Quoted 3 lines · Mingli via lists.openembedded.org
meta/recipes-support/attr/acl/0001-test-Unify-the-nfs-test-output.patch new file +3 -0
+The nfs tests will be put into XPASS/XFAIL category as it defined in
+XFAIL_TESTS target, group all the test only in TESTS target as we prefer
+use PASS/FAIL/SKIP to indicate the result.

XPASS/XFAIL is fine, we don’t need to change the tests.

Okay, I will move back these two cases to XPASS/XFAIL.

Quoted 12 lines
Quoted 12 lines
meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch new file +5 -0
new file mode 100644
index 0000000000..f990ca4a31
@@ -0,0 +1,51 @@
+From dfc6328f02821f9c6703f764ec6f53cf81daaab6 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <[email protected]>
+Date: Mon, 17 Jun 2024 11:00:43 +0800
+Subject: [PATCH] test/nfs/nfsacl.test: Correct the check item
+
Quoted 8 lines

meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch line 11

Quoted 6 lines
meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch new file +6 -0
+The date such as "Jun 13" should take 2 columns, so the expected check
+item "test/sub2" should the column 9.
+ # ls test/sub2 -dl
+drwxr-xr-x 2 root root 4096 Jun 13 06:01 test/sub2
+
+Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/acl-devel/2024-06/msg00002.html]

What this why the test is an XFAIL? In which case the previous patch should make it clear that we’re not removing XFAIL because we don’t like it, but because the tests are now fixed.

That's okay, will move back these two cases to XPASS/XFAIL.

Quoted 7 lines
Quoted 7 lines
meta/recipes-support/attr/acl/run-ptest +0 -0
index 3af75c84fe..7d88cc8484 100644
@@ -6,6 +6,7 @@
 
Quoted 5 lines
Quoted 3 lines

mkdir -p /tmp/acl-ptest/test
cp test/test.* /tmp/acl-ptest/test
+export EXPORT_PATH="/tmp/acl-ptest/test”

Whilst you’re here, this looks fragile. Can you use mktemp -d to make a fresh directory for each run?

The directory which used to include not only the test file, but also the file used for test such as test.passwd and test.group, and this directory is preconfigured during build as
https://git.openembedded.org/openembedded-core/tree/meta/recipes-support/attr/acl/0001-tests-do-not-hardcode-the-build-path-into-a-helper-l.patch.

Thanks,

Quoted 3 lines

Ross