Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v2] acl: Fix nfs ptest failure
@ 2024-06-26  5:56 mingli.yu
  2024-06-26 23:09 ` [OE-core] " Alexandre Belloni
  0 siblings, 1 reply; 8+ messages in thread
From: mingli.yu @ 2024-06-26  5:56 UTC (permalink / raw)
  To: openembedded-core, Ross.Burton

From: Mingli Yu <mingli.yu@windriver.com>

* 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           != ~

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 ...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       |  2 +
 meta/recipes-support/attr/acl_2.3.2.bb        |  3 +
 5 files changed, 169 insertions(+)
 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

diff --git a/meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch b/meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch
new file mode 100644
index 0000000000..c48ee9f820
--- /dev/null
+++ b/meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch
@@ -0,0 +1,46 @@
+From e87562e4e03450e380bd1ce8e11c561e8f9653d2 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Mon, 17 Jun 2024 11:22:21 +0800
+Subject: [PATCH] test/nfs/nfs-dir.test: Use the abosulte path
+
+Use the abosulte path otherwise we won't find the expected file blah.
+
+Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/acl-devel/2024-06/msg00001.html]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ test/nfs/nfs-dir.test | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/test/nfs/nfs-dir.test b/test/nfs/nfs-dir.test
+index 33e5f5f..7216a6e 100644
+--- a/test/nfs/nfs-dir.test
++++ b/test/nfs/nfs-dir.test
+@@ -14,7 +14,7 @@ EXPORT_PATH => the path that is mounted at the working directory.
+ 	Make sure the file can be accessed before.
+ 
+ 	$ su bin
+-	$ cat test/blah
++	$ cat %{EXPORT_PATH}/test/blah
+ 	> blah
+ 
+ 	Set up a situation that triggers the bug.
+@@ -36,12 +36,12 @@ EXPORT_PATH => the path that is mounted at the working directory.
+ 	fail with "Stale NFS file handle" or "Input/output error".
+ 
+ 	$ su bin
+-	$ cat test/blah
++	$ cat %{EXPORT_PATH}/test/blah
+ 	> blah
+ 	$ sleep 3
+-	$ cat test/blah
++	$ cat %{EXPORT_PATH}/test/blah
+ 	> blah
+-	$ cat test/blah
++	$ cat %{EXPORT_PATH}/test/blah
+ 	> blah
+ 
+ 	Clean up.
+-- 
+2.34.1
+
diff --git a/meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch b/meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch
new file mode 100644
index 0000000000..f990ca4a31
--- /dev/null
+++ b/meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch
@@ -0,0 +1,51 @@
+From dfc6328f02821f9c6703f764ec6f53cf81daaab6 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+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]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ test/nfs/nfsacl.test | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/test/nfs/nfsacl.test b/test/nfs/nfsacl.test
+index 4f37322..dfcc323 100644
+--- a/test/nfs/nfsacl.test
++++ b/test/nfs/nfsacl.test
+@@ -8,7 +8,7 @@ The test should be run on an NFS export mount with ACL support.
+ 	$ echo blah > test/sub/blah
+ 
+ 	$ cp -rp test/sub test/sub2
+-	$ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}'
++	$ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}'
+ 	> drwxr-xr-x test/sub2
+ 	> -rw-r--r-- test/sub2/blah
+ 
+@@ -23,7 +23,7 @@ The test should be run on an NFS export mount with ACL support.
+ 	>
+ 
+ 	$ cp -rp test/sub test/sub2
+-	$ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}'
++	$ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}'
+ 	> drwxrwxr-x+ test/sub2
+ 	> -rw-r--r-- test/sub2/blah
+ 
+@@ -31,7 +31,7 @@ The test should be run on an NFS export mount with ACL support.
+ 
+ 	$ setfacl -m u:daemon:rw test/sub/blah
+ 	$ cp -rp test/sub test/sub2
+-	$ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}'
++	$ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}'
+ 	> drwxrwxr-x+ test/sub2
+ 	> -rw-rw-r--+ test/sub2/blah
+ 
+-- 
+2.34.1
+
diff --git a/meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch b/meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch
new file mode 100644
index 0000000000..2fea254fec
--- /dev/null
+++ b/meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch
@@ -0,0 +1,67 @@
+From 6398d3fe7a766b4e3cd15bb77fd0f15f7dba52b2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
+Date: Wed, 19 Jun 2024 11:11:30 +0800
+Subject: [PATCH] tests: fix getpwnam and getgrnam
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The calls to these functions 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/root/restore.test test:
+
+[21] $ chown bin passwd -- failed
+chown: invalid user: ‘bin’        != ~
+
+Fixes: 3737f000d3f17cd283f51eeacac21a71a3472053 ("use thread-safe getpwnam_r
+and getgrnam_r")
+
+Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/acl-devel/2024-06/msg00000.html]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ test/test_group.c  | 2 +-
+ test/test_passwd.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/test/test_group.c b/test/test_group.c
+index 96dd612..42d6b07 100644
+--- a/test/test_group.c
++++ b/test/test_group.c
+@@ -136,7 +136,7 @@ struct group *getgrnam(const char *name)
+ 	static struct group grp;
+ 	struct group *result;
+ 
+-	(void) getgrnam_r(name, &grp, buf, sizeof(buf), &result);
++	(void) test_getgr_match(&grp, buf, sizeof buf, &result, match_name, name);
+ 	return result;
+ }
+ 
+diff --git a/test/test_passwd.c b/test/test_passwd.c
+index 9428bf8..97f2673 100644
+--- a/test/test_passwd.c
++++ b/test/test_passwd.c
+@@ -119,7 +119,7 @@ int getpwnam_r(const char *name, struct passwd *pwd, char *buf, size_t buflen,
+ 		*result = NULL;
+ 		return ERANGE;
+ 	}
+-	last_buflen =- 1;
++	last_buflen = -1;
+ 
+ 	return test_getpw_match(pwd, buf, buflen, result, match_name, name);
+ }
+@@ -131,7 +131,7 @@ struct passwd *getpwnam(const char *name)
+ 	static struct passwd pwd;
+ 	struct passwd *result;
+ 
+-	(void) getpwnam_r(name, &pwd, buf, sizeof(buf), &result);
++	(void) test_getpw_match(&pwd, buf, sizeof(buf), &result, match_name, name);
+ 	return result;
+ }
+ 
+-- 
+2.34.1
+
diff --git a/meta/recipes-support/attr/acl/run-ptest b/meta/recipes-support/attr/acl/run-ptest
index 3af75c84fe..bc7947c3ad 100644
--- a/meta/recipes-support/attr/acl/run-ptest
+++ b/meta/recipes-support/attr/acl/run-ptest
@@ -6,8 +6,10 @@
 
 mkdir -p /tmp/acl-ptest/test
 cp test/test.* /tmp/acl-ptest/test
+export EXPORT_PATH="/tmp/acl-ptest/test"
 
 set +e
+rm -rf test-suite.log
 make test-suite.log
 exitcode=$?
 if [ $exitcode -ne 0 -a -e test-suite.log ]; then
diff --git a/meta/recipes-support/attr/acl_2.3.2.bb b/meta/recipes-support/attr/acl_2.3.2.bb
index 6178473873..ee86ce2cae 100644
--- a/meta/recipes-support/attr/acl_2.3.2.bb
+++ b/meta/recipes-support/attr/acl_2.3.2.bb
@@ -19,6 +19,9 @@ 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 \
            "
 
 SRC_URI[sha256sum] = "5f2bdbad629707aa7d85c623f994aa8a1d2dec55a73de5205bac0bf6058a2f7c"
-- 
2.34.1



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

* Re: [OE-core] [PATCH v2] acl: Fix nfs ptest failure
  2024-06-26  5:56 [PATCH v2] acl: Fix nfs ptest failure mingli.yu
@ 2024-06-26 23:09 ` Alexandre Belloni
  2024-06-27  6:15   ` Yu, Mingli
  2024-06-27  6:17   ` [PATCH] acl: Add attr to RDEPENDS:${PN}-ptest mingli.yu
  0 siblings, 2 replies; 8+ messages in thread
From: Alexandre Belloni @ 2024-06-26 23:09 UTC (permalink / raw)
  To: Yu, Mingli; +Cc: openembedded-core, Ross.Burton, João Marcos Costa

Hello, this fails on the autobuilders:

https://autobuilder.yoctoproject.org/typhoon/#/builders/82/builds/6574/steps/12/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/81/builds/6751/steps/12/logs/stdio

On 26/06/2024 13:56:37+0800, Yu, Mingli wrote:
> From: Mingli Yu <mingli.yu@windriver.com>
> 
> * 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           != ~
> 
> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> ---
>  ...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       |  2 +
>  meta/recipes-support/attr/acl_2.3.2.bb        |  3 +
>  5 files changed, 169 insertions(+)
>  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
> 
> diff --git a/meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch b/meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch
> new file mode 100644
> index 0000000000..c48ee9f820
> --- /dev/null
> +++ b/meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch
> @@ -0,0 +1,46 @@
> +From e87562e4e03450e380bd1ce8e11c561e8f9653d2 Mon Sep 17 00:00:00 2001
> +From: Mingli Yu <mingli.yu@windriver.com>
> +Date: Mon, 17 Jun 2024 11:22:21 +0800
> +Subject: [PATCH] test/nfs/nfs-dir.test: Use the abosulte path
> +
> +Use the abosulte path otherwise we won't find the expected file blah.
> +
> +Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/acl-devel/2024-06/msg00001.html]
> +
> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> +---
> + test/nfs/nfs-dir.test | 8 ++++----
> + 1 file changed, 4 insertions(+), 4 deletions(-)
> +
> +diff --git a/test/nfs/nfs-dir.test b/test/nfs/nfs-dir.test
> +index 33e5f5f..7216a6e 100644
> +--- a/test/nfs/nfs-dir.test
> ++++ b/test/nfs/nfs-dir.test
> +@@ -14,7 +14,7 @@ EXPORT_PATH => the path that is mounted at the working directory.
> + 	Make sure the file can be accessed before.
> + 
> + 	$ su bin
> +-	$ cat test/blah
> ++	$ cat %{EXPORT_PATH}/test/blah
> + 	> blah
> + 
> + 	Set up a situation that triggers the bug.
> +@@ -36,12 +36,12 @@ EXPORT_PATH => the path that is mounted at the working directory.
> + 	fail with "Stale NFS file handle" or "Input/output error".
> + 
> + 	$ su bin
> +-	$ cat test/blah
> ++	$ cat %{EXPORT_PATH}/test/blah
> + 	> blah
> + 	$ sleep 3
> +-	$ cat test/blah
> ++	$ cat %{EXPORT_PATH}/test/blah
> + 	> blah
> +-	$ cat test/blah
> ++	$ cat %{EXPORT_PATH}/test/blah
> + 	> blah
> + 
> + 	Clean up.
> +-- 
> +2.34.1
> +
> diff --git a/meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch b/meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch
> new file mode 100644
> index 0000000000..f990ca4a31
> --- /dev/null
> +++ b/meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch
> @@ -0,0 +1,51 @@
> +From dfc6328f02821f9c6703f764ec6f53cf81daaab6 Mon Sep 17 00:00:00 2001
> +From: Mingli Yu <mingli.yu@windriver.com>
> +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]
> +
> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> +---
> + test/nfs/nfsacl.test | 6 +++---
> + 1 file changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/test/nfs/nfsacl.test b/test/nfs/nfsacl.test
> +index 4f37322..dfcc323 100644
> +--- a/test/nfs/nfsacl.test
> ++++ b/test/nfs/nfsacl.test
> +@@ -8,7 +8,7 @@ The test should be run on an NFS export mount with ACL support.
> + 	$ echo blah > test/sub/blah
> + 
> + 	$ cp -rp test/sub test/sub2
> +-	$ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}'
> ++	$ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}'
> + 	> drwxr-xr-x test/sub2
> + 	> -rw-r--r-- test/sub2/blah
> + 
> +@@ -23,7 +23,7 @@ The test should be run on an NFS export mount with ACL support.
> + 	>
> + 
> + 	$ cp -rp test/sub test/sub2
> +-	$ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}'
> ++	$ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}'
> + 	> drwxrwxr-x+ test/sub2
> + 	> -rw-r--r-- test/sub2/blah
> + 
> +@@ -31,7 +31,7 @@ The test should be run on an NFS export mount with ACL support.
> + 
> + 	$ setfacl -m u:daemon:rw test/sub/blah
> + 	$ cp -rp test/sub test/sub2
> +-	$ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}'
> ++	$ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}'
> + 	> drwxrwxr-x+ test/sub2
> + 	> -rw-rw-r--+ test/sub2/blah
> + 
> +-- 
> +2.34.1
> +
> diff --git a/meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch b/meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch
> new file mode 100644
> index 0000000000..2fea254fec
> --- /dev/null
> +++ b/meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch
> @@ -0,0 +1,67 @@
> +From 6398d3fe7a766b4e3cd15bb77fd0f15f7dba52b2 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
> +Date: Wed, 19 Jun 2024 11:11:30 +0800
> +Subject: [PATCH] tests: fix getpwnam and getgrnam
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +The calls to these functions 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/root/restore.test test:
> +
> +[21] $ chown bin passwd -- failed
> +chown: invalid user: ‘bin’        != ~
> +
> +Fixes: 3737f000d3f17cd283f51eeacac21a71a3472053 ("use thread-safe getpwnam_r
> +and getgrnam_r")
> +
> +Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/acl-devel/2024-06/msg00000.html]
> +
> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> +---
> + test/test_group.c  | 2 +-
> + test/test_passwd.c | 4 ++--
> + 2 files changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/test/test_group.c b/test/test_group.c
> +index 96dd612..42d6b07 100644
> +--- a/test/test_group.c
> ++++ b/test/test_group.c
> +@@ -136,7 +136,7 @@ struct group *getgrnam(const char *name)
> + 	static struct group grp;
> + 	struct group *result;
> + 
> +-	(void) getgrnam_r(name, &grp, buf, sizeof(buf), &result);
> ++	(void) test_getgr_match(&grp, buf, sizeof buf, &result, match_name, name);
> + 	return result;
> + }
> + 
> +diff --git a/test/test_passwd.c b/test/test_passwd.c
> +index 9428bf8..97f2673 100644
> +--- a/test/test_passwd.c
> ++++ b/test/test_passwd.c
> +@@ -119,7 +119,7 @@ int getpwnam_r(const char *name, struct passwd *pwd, char *buf, size_t buflen,
> + 		*result = NULL;
> + 		return ERANGE;
> + 	}
> +-	last_buflen =- 1;
> ++	last_buflen = -1;
> + 
> + 	return test_getpw_match(pwd, buf, buflen, result, match_name, name);
> + }
> +@@ -131,7 +131,7 @@ struct passwd *getpwnam(const char *name)
> + 	static struct passwd pwd;
> + 	struct passwd *result;
> + 
> +-	(void) getpwnam_r(name, &pwd, buf, sizeof(buf), &result);
> ++	(void) test_getpw_match(&pwd, buf, sizeof(buf), &result, match_name, name);
> + 	return result;
> + }
> + 
> +-- 
> +2.34.1
> +
> diff --git a/meta/recipes-support/attr/acl/run-ptest b/meta/recipes-support/attr/acl/run-ptest
> index 3af75c84fe..bc7947c3ad 100644
> --- a/meta/recipes-support/attr/acl/run-ptest
> +++ b/meta/recipes-support/attr/acl/run-ptest
> @@ -6,8 +6,10 @@
>  
>  mkdir -p /tmp/acl-ptest/test
>  cp test/test.* /tmp/acl-ptest/test
> +export EXPORT_PATH="/tmp/acl-ptest/test"
>  
>  set +e
> +rm -rf test-suite.log
>  make test-suite.log
>  exitcode=$?
>  if [ $exitcode -ne 0 -a -e test-suite.log ]; then
> diff --git a/meta/recipes-support/attr/acl_2.3.2.bb b/meta/recipes-support/attr/acl_2.3.2.bb
> index 6178473873..ee86ce2cae 100644
> --- a/meta/recipes-support/attr/acl_2.3.2.bb
> +++ b/meta/recipes-support/attr/acl_2.3.2.bb
> @@ -19,6 +19,9 @@ 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 \
>             "
>  
>  SRC_URI[sha256sum] = "5f2bdbad629707aa7d85c623f994aa8a1d2dec55a73de5205bac0bf6058a2f7c"
> -- 
> 2.34.1
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#201151): https://lists.openembedded.org/g/openembedded-core/message/201151
> Mute This Topic: https://lists.openembedded.org/mt/106885245/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


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

* Re: [OE-core] [PATCH v2] acl: Fix nfs ptest failure
  2024-06-26 23:09 ` [OE-core] " Alexandre Belloni
@ 2024-06-27  6:15   ` Yu, Mingli
  2024-06-27  6:57     ` Alexandre Belloni
  2024-06-27  6:17   ` [PATCH] acl: Add attr to RDEPENDS:${PN}-ptest mingli.yu
  1 sibling, 1 reply; 8+ messages in thread
From: Yu, Mingli @ 2024-06-27  6:15 UTC (permalink / raw)
  To: Alexandre Belloni, Yu, Mingli
  Cc: openembedded-core, Ross.Burton, João Marcos Costa



On 6/27/24 07:09, Alexandre Belloni wrote:
> 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, this fails on the autobuilders:
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/82/builds/6574/steps/12/logs/stdio
> https://autobuilder.yoctoproject.org/typhoon/#/builders/81/builds/6751/steps/12/logs/stdio

Noticed the patch already in master-next, will send a follow-up patch to 
fix the issue monitored by autobuilder.

Thanks,

> 
> On 26/06/2024 13:56:37+0800, Yu, Mingli wrote:
>> From: Mingli Yu <mingli.yu@windriver.com>
>>
>> * 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           != ~
>>
>> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>> ---
>>   ...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       |  2 +
>>   meta/recipes-support/attr/acl_2.3.2.bb        |  3 +
>>   5 files changed, 169 insertions(+)
>>   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
>>
>> diff --git a/meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch b/meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch
>> new file mode 100644
>> index 0000000000..c48ee9f820
>> --- /dev/null
>> +++ b/meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch
>> @@ -0,0 +1,46 @@
>> +From e87562e4e03450e380bd1ce8e11c561e8f9653d2 Mon Sep 17 00:00:00 2001
>> +From: Mingli Yu <mingli.yu@windriver.com>
>> +Date: Mon, 17 Jun 2024 11:22:21 +0800
>> +Subject: [PATCH] test/nfs/nfs-dir.test: Use the abosulte path
>> +
>> +Use the abosulte path otherwise we won't find the expected file blah.
>> +
>> +Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/acl-devel/2024-06/msg00001.html]
>> +
>> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>> +---
>> + test/nfs/nfs-dir.test | 8 ++++----
>> + 1 file changed, 4 insertions(+), 4 deletions(-)
>> +
>> +diff --git a/test/nfs/nfs-dir.test b/test/nfs/nfs-dir.test
>> +index 33e5f5f..7216a6e 100644
>> +--- a/test/nfs/nfs-dir.test
>> ++++ b/test/nfs/nfs-dir.test
>> +@@ -14,7 +14,7 @@ EXPORT_PATH => the path that is mounted at the working directory.
>> +     Make sure the file can be accessed before.
>> +
>> +     $ su bin
>> +-    $ cat test/blah
>> ++    $ cat %{EXPORT_PATH}/test/blah
>> +     > blah
>> +
>> +     Set up a situation that triggers the bug.
>> +@@ -36,12 +36,12 @@ EXPORT_PATH => the path that is mounted at the working directory.
>> +     fail with "Stale NFS file handle" or "Input/output error".
>> +
>> +     $ su bin
>> +-    $ cat test/blah
>> ++    $ cat %{EXPORT_PATH}/test/blah
>> +     > blah
>> +     $ sleep 3
>> +-    $ cat test/blah
>> ++    $ cat %{EXPORT_PATH}/test/blah
>> +     > blah
>> +-    $ cat test/blah
>> ++    $ cat %{EXPORT_PATH}/test/blah
>> +     > blah
>> +
>> +     Clean up.
>> +--
>> +2.34.1
>> +
>> diff --git a/meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch b/meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch
>> new file mode 100644
>> index 0000000000..f990ca4a31
>> --- /dev/null
>> +++ b/meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch
>> @@ -0,0 +1,51 @@
>> +From dfc6328f02821f9c6703f764ec6f53cf81daaab6 Mon Sep 17 00:00:00 2001
>> +From: Mingli Yu <mingli.yu@windriver.com>
>> +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]
>> +
>> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>> +---
>> + test/nfs/nfsacl.test | 6 +++---
>> + 1 file changed, 3 insertions(+), 3 deletions(-)
>> +
>> +diff --git a/test/nfs/nfsacl.test b/test/nfs/nfsacl.test
>> +index 4f37322..dfcc323 100644
>> +--- a/test/nfs/nfsacl.test
>> ++++ b/test/nfs/nfsacl.test
>> +@@ -8,7 +8,7 @@ The test should be run on an NFS export mount with ACL support.
>> +     $ echo blah > test/sub/blah
>> +
>> +     $ cp -rp test/sub test/sub2
>> +-    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}'
>> ++    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}'
>> +     > drwxr-xr-x test/sub2
>> +     > -rw-r--r-- test/sub2/blah
>> +
>> +@@ -23,7 +23,7 @@ The test should be run on an NFS export mount with ACL support.
>> +     >
>> +
>> +     $ cp -rp test/sub test/sub2
>> +-    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}'
>> ++    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}'
>> +     > drwxrwxr-x+ test/sub2
>> +     > -rw-r--r-- test/sub2/blah
>> +
>> +@@ -31,7 +31,7 @@ The test should be run on an NFS export mount with ACL support.
>> +
>> +     $ setfacl -m u:daemon:rw test/sub/blah
>> +     $ cp -rp test/sub test/sub2
>> +-    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}'
>> ++    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}'
>> +     > drwxrwxr-x+ test/sub2
>> +     > -rw-rw-r--+ test/sub2/blah
>> +
>> +--
>> +2.34.1
>> +
>> diff --git a/meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch b/meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch
>> new file mode 100644
>> index 0000000000..2fea254fec
>> --- /dev/null
>> +++ b/meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch
>> @@ -0,0 +1,67 @@
>> +From 6398d3fe7a766b4e3cd15bb77fd0f15f7dba52b2 Mon Sep 17 00:00:00 2001
>> +From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
>> +Date: Wed, 19 Jun 2024 11:11:30 +0800
>> +Subject: [PATCH] tests: fix getpwnam and getgrnam
>> +MIME-Version: 1.0
>> +Content-Type: text/plain; charset=UTF-8
>> +Content-Transfer-Encoding: 8bit
>> +
>> +The calls to these functions 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/root/restore.test test:
>> +
>> +[21] $ chown bin passwd -- failed
>> +chown: invalid user: ‘bin’        != ~
>> +
>> +Fixes: 3737f000d3f17cd283f51eeacac21a71a3472053 ("use thread-safe getpwnam_r
>> +and getgrnam_r")
>> +
>> +Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/acl-devel/2024-06/msg00000.html]
>> +
>> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>> +---
>> + test/test_group.c  | 2 +-
>> + test/test_passwd.c | 4 ++--
>> + 2 files changed, 3 insertions(+), 3 deletions(-)
>> +
>> +diff --git a/test/test_group.c b/test/test_group.c
>> +index 96dd612..42d6b07 100644
>> +--- a/test/test_group.c
>> ++++ b/test/test_group.c
>> +@@ -136,7 +136,7 @@ struct group *getgrnam(const char *name)
>> +     static struct group grp;
>> +     struct group *result;
>> +
>> +-    (void) getgrnam_r(name, &grp, buf, sizeof(buf), &result);
>> ++    (void) test_getgr_match(&grp, buf, sizeof buf, &result, match_name, name);
>> +     return result;
>> + }
>> +
>> +diff --git a/test/test_passwd.c b/test/test_passwd.c
>> +index 9428bf8..97f2673 100644
>> +--- a/test/test_passwd.c
>> ++++ b/test/test_passwd.c
>> +@@ -119,7 +119,7 @@ int getpwnam_r(const char *name, struct passwd *pwd, char *buf, size_t buflen,
>> +             *result = NULL;
>> +             return ERANGE;
>> +     }
>> +-    last_buflen =- 1;
>> ++    last_buflen = -1;
>> +
>> +     return test_getpw_match(pwd, buf, buflen, result, match_name, name);
>> + }
>> +@@ -131,7 +131,7 @@ struct passwd *getpwnam(const char *name)
>> +     static struct passwd pwd;
>> +     struct passwd *result;
>> +
>> +-    (void) getpwnam_r(name, &pwd, buf, sizeof(buf), &result);
>> ++    (void) test_getpw_match(&pwd, buf, sizeof(buf), &result, match_name, name);
>> +     return result;
>> + }
>> +
>> +--
>> +2.34.1
>> +
>> diff --git a/meta/recipes-support/attr/acl/run-ptest b/meta/recipes-support/attr/acl/run-ptest
>> index 3af75c84fe..bc7947c3ad 100644
>> --- a/meta/recipes-support/attr/acl/run-ptest
>> +++ b/meta/recipes-support/attr/acl/run-ptest
>> @@ -6,8 +6,10 @@
>>
>>   mkdir -p /tmp/acl-ptest/test
>>   cp test/test.* /tmp/acl-ptest/test
>> +export EXPORT_PATH="/tmp/acl-ptest/test"
>>
>>   set +e
>> +rm -rf test-suite.log
>>   make test-suite.log
>>   exitcode=$?
>>   if [ $exitcode -ne 0 -a -e test-suite.log ]; then
>> diff --git a/meta/recipes-support/attr/acl_2.3.2.bb b/meta/recipes-support/attr/acl_2.3.2.bb
>> index 6178473873..ee86ce2cae 100644
>> --- a/meta/recipes-support/attr/acl_2.3.2.bb
>> +++ b/meta/recipes-support/attr/acl_2.3.2.bb
>> @@ -19,6 +19,9 @@ 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 \
>>              "
>>
>>   SRC_URI[sha256sum] = "5f2bdbad629707aa7d85c623f994aa8a1d2dec55a73de5205bac0bf6058a2f7c"
>> --
>> 2.34.1
>>
> 
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#201151): https://lists.openembedded.org/g/openembedded-core/message/201151
>> Mute This Topic: https://lists.openembedded.org/mt/106885245/3617179
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
> 
> 
> --
> Alexandre Belloni, co-owner and COO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com


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

* [PATCH] acl: Add attr to RDEPENDS:${PN}-ptest
  2024-06-26 23:09 ` [OE-core] " Alexandre Belloni
  2024-06-27  6:15   ` Yu, Mingli
@ 2024-06-27  6:17   ` mingli.yu
  2024-06-27  6:23     ` [OE-core] " Chen, Qi
  1 sibling, 1 reply; 8+ messages in thread
From: mingli.yu @ 2024-06-27  6:17 UTC (permalink / raw)
  To: openembedded-core

From: Mingli Yu <mingli.yu@windriver.com>

* Add attr which provides getfattr to RDEPENDS:${PN}-ptest to fix below
test/nfs/nfsacl failure.
  [19] $ getfattr -m- test/sub -- failed\n'
        'Can\'t exec "getfattr": Nosuch file or directory at ./test/run line '
        369, <TEST_FILE> line 24. != # file: test/sub\n'
        'getfattr: No such file or directory   != system.posix_acl_access\n'
        '~                                 != system.posix_acl_default\n'
        '~

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 meta/recipes-support/attr/acl_2.3.2.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-support/attr/acl_2.3.2.bb b/meta/recipes-support/attr/acl_2.3.2.bb
index ee86ce2cae..5ac085c322 100644
--- a/meta/recipes-support/attr/acl_2.3.2.bb
+++ b/meta/recipes-support/attr/acl_2.3.2.bb
@@ -68,6 +68,7 @@ do_install_ptest:append:libc-musl() {
 }
 
 RDEPENDS:${PN}-ptest = "acl \
+                        attr \
                         bash \
                         coreutils \
                         perl \
-- 
2.34.1



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

* RE: [OE-core] [PATCH] acl: Add attr to RDEPENDS:${PN}-ptest
  2024-06-27  6:17   ` [PATCH] acl: Add attr to RDEPENDS:${PN}-ptest mingli.yu
@ 2024-06-27  6:23     ` Chen, Qi
  2024-06-27  6:59       ` Yu, Mingli
  0 siblings, 1 reply; 8+ messages in thread
From: Chen, Qi @ 2024-06-27  6:23 UTC (permalink / raw)
  To: Yu, Mingli, openembedded-core@lists.openembedded.org

Just one question: the testcase's name looks like it's supposed to be run on some NFS. Does it?

Regards,
Qi

-----Original Message-----
From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Yu, Mingli via lists.openembedded.org
Sent: Thursday, June 27, 2024 2:18 PM
To: openembedded-core@lists.openembedded.org
Subject: [OE-core] [PATCH] acl: Add attr to RDEPENDS:${PN}-ptest

From: Mingli Yu <mingli.yu@windriver.com>

* Add attr which provides getfattr to RDEPENDS:${PN}-ptest to fix below test/nfs/nfsacl failure.
  [19] $ getfattr -m- test/sub -- failed\n'
        'Can\'t exec "getfattr": Nosuch file or directory at ./test/run line '
        369, <TEST_FILE> line 24. != # file: test/sub\n'
        'getfattr: No such file or directory   != system.posix_acl_access\n'
        '~                                 != system.posix_acl_default\n'
        '~

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 meta/recipes-support/attr/acl_2.3.2.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-support/attr/acl_2.3.2.bb b/meta/recipes-support/attr/acl_2.3.2.bb
index ee86ce2cae..5ac085c322 100644
--- a/meta/recipes-support/attr/acl_2.3.2.bb
+++ b/meta/recipes-support/attr/acl_2.3.2.bb
@@ -68,6 +68,7 @@ do_install_ptest:append:libc-musl() {  }
 
 RDEPENDS:${PN}-ptest = "acl \
+                        attr \
                         bash \
                         coreutils \
                         perl \
--
2.34.1



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

* Re: [OE-core] [PATCH v2] acl: Fix nfs ptest failure
  2024-06-27  6:15   ` Yu, Mingli
@ 2024-06-27  6:57     ` Alexandre Belloni
  2024-06-27  7:03       ` Yu, Mingli
  0 siblings, 1 reply; 8+ messages in thread
From: Alexandre Belloni @ 2024-06-27  6:57 UTC (permalink / raw)
  To: Yu, Mingli
  Cc: Yu, Mingli, openembedded-core, Ross.Burton,
	João Marcos Costa

On 27/06/2024 14:15:56+0800, Yu, Mingli wrote:
> 
> 
> On 6/27/24 07:09, Alexandre Belloni wrote:
> > 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, this fails on the autobuilders:
> > 
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/82/builds/6574/steps/12/logs/stdio
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/81/builds/6751/steps/12/logs/stdio
> 
> Noticed the patch already in master-next, will send a follow-up patch to fix
> the issue monitored by autobuilder.

No, master-next can be rebased, please base your patches on top of
master unless instructed to do differently.

> 
> Thanks,
> 
> > 
> > On 26/06/2024 13:56:37+0800, Yu, Mingli wrote:
> > > From: Mingli Yu <mingli.yu@windriver.com>
> > > 
> > > * 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           != ~
> > > 
> > > Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> > > ---
> > >   ...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       |  2 +
> > >   meta/recipes-support/attr/acl_2.3.2.bb        |  3 +
> > >   5 files changed, 169 insertions(+)
> > >   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
> > > 
> > > diff --git a/meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch b/meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch
> > > new file mode 100644
> > > index 0000000000..c48ee9f820
> > > --- /dev/null
> > > +++ b/meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch
> > > @@ -0,0 +1,46 @@
> > > +From e87562e4e03450e380bd1ce8e11c561e8f9653d2 Mon Sep 17 00:00:00 2001
> > > +From: Mingli Yu <mingli.yu@windriver.com>
> > > +Date: Mon, 17 Jun 2024 11:22:21 +0800
> > > +Subject: [PATCH] test/nfs/nfs-dir.test: Use the abosulte path
> > > +
> > > +Use the abosulte path otherwise we won't find the expected file blah.
> > > +
> > > +Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/acl-devel/2024-06/msg00001.html]
> > > +
> > > +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> > > +---
> > > + test/nfs/nfs-dir.test | 8 ++++----
> > > + 1 file changed, 4 insertions(+), 4 deletions(-)
> > > +
> > > +diff --git a/test/nfs/nfs-dir.test b/test/nfs/nfs-dir.test
> > > +index 33e5f5f..7216a6e 100644
> > > +--- a/test/nfs/nfs-dir.test
> > > ++++ b/test/nfs/nfs-dir.test
> > > +@@ -14,7 +14,7 @@ EXPORT_PATH => the path that is mounted at the working directory.
> > > +     Make sure the file can be accessed before.
> > > +
> > > +     $ su bin
> > > +-    $ cat test/blah
> > > ++    $ cat %{EXPORT_PATH}/test/blah
> > > +     > blah
> > > +
> > > +     Set up a situation that triggers the bug.
> > > +@@ -36,12 +36,12 @@ EXPORT_PATH => the path that is mounted at the working directory.
> > > +     fail with "Stale NFS file handle" or "Input/output error".
> > > +
> > > +     $ su bin
> > > +-    $ cat test/blah
> > > ++    $ cat %{EXPORT_PATH}/test/blah
> > > +     > blah
> > > +     $ sleep 3
> > > +-    $ cat test/blah
> > > ++    $ cat %{EXPORT_PATH}/test/blah
> > > +     > blah
> > > +-    $ cat test/blah
> > > ++    $ cat %{EXPORT_PATH}/test/blah
> > > +     > blah
> > > +
> > > +     Clean up.
> > > +--
> > > +2.34.1
> > > +
> > > diff --git a/meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch b/meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch
> > > new file mode 100644
> > > index 0000000000..f990ca4a31
> > > --- /dev/null
> > > +++ b/meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch
> > > @@ -0,0 +1,51 @@
> > > +From dfc6328f02821f9c6703f764ec6f53cf81daaab6 Mon Sep 17 00:00:00 2001
> > > +From: Mingli Yu <mingli.yu@windriver.com>
> > > +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]
> > > +
> > > +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> > > +---
> > > + test/nfs/nfsacl.test | 6 +++---
> > > + 1 file changed, 3 insertions(+), 3 deletions(-)
> > > +
> > > +diff --git a/test/nfs/nfsacl.test b/test/nfs/nfsacl.test
> > > +index 4f37322..dfcc323 100644
> > > +--- a/test/nfs/nfsacl.test
> > > ++++ b/test/nfs/nfsacl.test
> > > +@@ -8,7 +8,7 @@ The test should be run on an NFS export mount with ACL support.
> > > +     $ echo blah > test/sub/blah
> > > +
> > > +     $ cp -rp test/sub test/sub2
> > > +-    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}'
> > > ++    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}'
> > > +     > drwxr-xr-x test/sub2
> > > +     > -rw-r--r-- test/sub2/blah
> > > +
> > > +@@ -23,7 +23,7 @@ The test should be run on an NFS export mount with ACL support.
> > > +     >
> > > +
> > > +     $ cp -rp test/sub test/sub2
> > > +-    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}'
> > > ++    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}'
> > > +     > drwxrwxr-x+ test/sub2
> > > +     > -rw-r--r-- test/sub2/blah
> > > +
> > > +@@ -31,7 +31,7 @@ The test should be run on an NFS export mount with ACL support.
> > > +
> > > +     $ setfacl -m u:daemon:rw test/sub/blah
> > > +     $ cp -rp test/sub test/sub2
> > > +-    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}'
> > > ++    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}'
> > > +     > drwxrwxr-x+ test/sub2
> > > +     > -rw-rw-r--+ test/sub2/blah
> > > +
> > > +--
> > > +2.34.1
> > > +
> > > diff --git a/meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch b/meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch
> > > new file mode 100644
> > > index 0000000000..2fea254fec
> > > --- /dev/null
> > > +++ b/meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch
> > > @@ -0,0 +1,67 @@
> > > +From 6398d3fe7a766b4e3cd15bb77fd0f15f7dba52b2 Mon Sep 17 00:00:00 2001
> > > +From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
> > > +Date: Wed, 19 Jun 2024 11:11:30 +0800
> > > +Subject: [PATCH] tests: fix getpwnam and getgrnam
> > > +MIME-Version: 1.0
> > > +Content-Type: text/plain; charset=UTF-8
> > > +Content-Transfer-Encoding: 8bit
> > > +
> > > +The calls to these functions 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/root/restore.test test:
> > > +
> > > +[21] $ chown bin passwd -- failed
> > > +chown: invalid user: ‘bin’        != ~
> > > +
> > > +Fixes: 3737f000d3f17cd283f51eeacac21a71a3472053 ("use thread-safe getpwnam_r
> > > +and getgrnam_r")
> > > +
> > > +Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/acl-devel/2024-06/msg00000.html]
> > > +
> > > +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> > > +---
> > > + test/test_group.c  | 2 +-
> > > + test/test_passwd.c | 4 ++--
> > > + 2 files changed, 3 insertions(+), 3 deletions(-)
> > > +
> > > +diff --git a/test/test_group.c b/test/test_group.c
> > > +index 96dd612..42d6b07 100644
> > > +--- a/test/test_group.c
> > > ++++ b/test/test_group.c
> > > +@@ -136,7 +136,7 @@ struct group *getgrnam(const char *name)
> > > +     static struct group grp;
> > > +     struct group *result;
> > > +
> > > +-    (void) getgrnam_r(name, &grp, buf, sizeof(buf), &result);
> > > ++    (void) test_getgr_match(&grp, buf, sizeof buf, &result, match_name, name);
> > > +     return result;
> > > + }
> > > +
> > > +diff --git a/test/test_passwd.c b/test/test_passwd.c
> > > +index 9428bf8..97f2673 100644
> > > +--- a/test/test_passwd.c
> > > ++++ b/test/test_passwd.c
> > > +@@ -119,7 +119,7 @@ int getpwnam_r(const char *name, struct passwd *pwd, char *buf, size_t buflen,
> > > +             *result = NULL;
> > > +             return ERANGE;
> > > +     }
> > > +-    last_buflen =- 1;
> > > ++    last_buflen = -1;
> > > +
> > > +     return test_getpw_match(pwd, buf, buflen, result, match_name, name);
> > > + }
> > > +@@ -131,7 +131,7 @@ struct passwd *getpwnam(const char *name)
> > > +     static struct passwd pwd;
> > > +     struct passwd *result;
> > > +
> > > +-    (void) getpwnam_r(name, &pwd, buf, sizeof(buf), &result);
> > > ++    (void) test_getpw_match(&pwd, buf, sizeof(buf), &result, match_name, name);
> > > +     return result;
> > > + }
> > > +
> > > +--
> > > +2.34.1
> > > +
> > > diff --git a/meta/recipes-support/attr/acl/run-ptest b/meta/recipes-support/attr/acl/run-ptest
> > > index 3af75c84fe..bc7947c3ad 100644
> > > --- a/meta/recipes-support/attr/acl/run-ptest
> > > +++ b/meta/recipes-support/attr/acl/run-ptest
> > > @@ -6,8 +6,10 @@
> > > 
> > >   mkdir -p /tmp/acl-ptest/test
> > >   cp test/test.* /tmp/acl-ptest/test
> > > +export EXPORT_PATH="/tmp/acl-ptest/test"
> > > 
> > >   set +e
> > > +rm -rf test-suite.log
> > >   make test-suite.log
> > >   exitcode=$?
> > >   if [ $exitcode -ne 0 -a -e test-suite.log ]; then
> > > diff --git a/meta/recipes-support/attr/acl_2.3.2.bb b/meta/recipes-support/attr/acl_2.3.2.bb
> > > index 6178473873..ee86ce2cae 100644
> > > --- a/meta/recipes-support/attr/acl_2.3.2.bb
> > > +++ b/meta/recipes-support/attr/acl_2.3.2.bb
> > > @@ -19,6 +19,9 @@ 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 \
> > >              "
> > > 
> > >   SRC_URI[sha256sum] = "5f2bdbad629707aa7d85c623f994aa8a1d2dec55a73de5205bac0bf6058a2f7c"
> > > --
> > > 2.34.1
> > > 
> > 
> > > 
> > > -=-=-=-=-=-=-=-=-=-=-=-
> > > Links: You receive all messages sent to this group.
> > > View/Reply Online (#201151): https://lists.openembedded.org/g/openembedded-core/message/201151
> > > Mute This Topic: https://lists.openembedded.org/mt/106885245/3617179
> > > Group Owner: openembedded-core+owner@lists.openembedded.org
> > > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> > > -=-=-=-=-=-=-=-=-=-=-=-
> > > 
> > 
> > 
> > --
> > Alexandre Belloni, co-owner and COO, Bootlin
> > Embedded Linux and Kernel engineering
> > https://bootlin.com

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


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

* Re: [OE-core] [PATCH] acl: Add attr to RDEPENDS:${PN}-ptest
  2024-06-27  6:23     ` [OE-core] " Chen, Qi
@ 2024-06-27  6:59       ` Yu, Mingli
  0 siblings, 0 replies; 8+ messages in thread
From: Yu, Mingli @ 2024-06-27  6:59 UTC (permalink / raw)
  To: Chen, Qi, openembedded-core@lists.openembedded.org



On 6/27/24 14:23, Chen, Qi wrote:
> Just one question: the testcase's name looks like it's supposed to be run on some NFS. Does it?

Yes, It's designed for nfs root with acl support. But the cases are 
mainly some basic setting like set the file access control 
lists(setfacl) or get file access control lists(getfacl) which should 
also works with local root as my understanding.

Thanks,

> 
> Regards,
> Qi
> 
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Yu, Mingli via lists.openembedded.org
> Sent: Thursday, June 27, 2024 2:18 PM
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH] acl: Add attr to RDEPENDS:${PN}-ptest
> 
> From: Mingli Yu <mingli.yu@windriver.com>
> 
> * Add attr which provides getfattr to RDEPENDS:${PN}-ptest to fix below test/nfs/nfsacl failure.
>    [19] $ getfattr -m- test/sub -- failed\n'
>          'Can\'t exec "getfattr": Nosuch file or directory at ./test/run line '
>          369, <TEST_FILE> line 24. != # file: test/sub\n'
>          'getfattr: No such file or directory   != system.posix_acl_access\n'
>          '~                                 != system.posix_acl_default\n'
>          '~
> 
> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> ---
>   meta/recipes-support/attr/acl_2.3.2.bb | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/meta/recipes-support/attr/acl_2.3.2.bb b/meta/recipes-support/attr/acl_2.3.2.bb
> index ee86ce2cae..5ac085c322 100644
> --- a/meta/recipes-support/attr/acl_2.3.2.bb
> +++ b/meta/recipes-support/attr/acl_2.3.2.bb
> @@ -68,6 +68,7 @@ do_install_ptest:append:libc-musl() {  }
>   
>   RDEPENDS:${PN}-ptest = "acl \
> +                        attr \
>                           bash \
>                           coreutils \
>                           perl \
> --
> 2.34.1
> 


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

* Re: [OE-core] [PATCH v2] acl: Fix nfs ptest failure
  2024-06-27  6:57     ` Alexandre Belloni
@ 2024-06-27  7:03       ` Yu, Mingli
  0 siblings, 0 replies; 8+ messages in thread
From: Yu, Mingli @ 2024-06-27  7:03 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Yu, Mingli, openembedded-core, Ross.Burton,
	João Marcos Costa



On 6/27/24 14:57, Alexandre Belloni wrote:
> 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.
> 
> On 27/06/2024 14:15:56+0800, Yu, Mingli wrote:
>>
>>
>> On 6/27/24 07:09, Alexandre Belloni wrote:
>>> 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, this fails on the autobuilders:
>>>
>>> https://autobuilder.yoctoproject.org/typhoon/#/builders/82/builds/6574/steps/12/logs/stdio
>>> https://autobuilder.yoctoproject.org/typhoon/#/builders/81/builds/6751/steps/12/logs/stdio
>>
>> Noticed the patch already in master-next, will send a follow-up patch to fix
>> the issue monitored by autobuilder.
> 
> No, master-next can be rebased, please base your patches on top of
> master unless instructed to do differently.

Got it! v3 is sent.

Thanks,

> 
>>
>> Thanks,
>>
>>>
>>> On 26/06/2024 13:56:37+0800, Yu, Mingli wrote:
>>>> From: Mingli Yu <mingli.yu@windriver.com>
>>>>
>>>> * 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           != ~
>>>>
>>>> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>>>> ---
>>>>    ...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       |  2 +
>>>>    meta/recipes-support/attr/acl_2.3.2.bb        |  3 +
>>>>    5 files changed, 169 insertions(+)
>>>>    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
>>>>
>>>> diff --git a/meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch b/meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch
>>>> new file mode 100644
>>>> index 0000000000..c48ee9f820
>>>> --- /dev/null
>>>> +++ b/meta/recipes-support/attr/acl/0001-test-nfs-nfs-dir.test-Use-the-abosulte-path.patch
>>>> @@ -0,0 +1,46 @@
>>>> +From e87562e4e03450e380bd1ce8e11c561e8f9653d2 Mon Sep 17 00:00:00 2001
>>>> +From: Mingli Yu <mingli.yu@windriver.com>
>>>> +Date: Mon, 17 Jun 2024 11:22:21 +0800
>>>> +Subject: [PATCH] test/nfs/nfs-dir.test: Use the abosulte path
>>>> +
>>>> +Use the abosulte path otherwise we won't find the expected file blah.
>>>> +
>>>> +Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/acl-devel/2024-06/msg00001.html]
>>>> +
>>>> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>>>> +---
>>>> + test/nfs/nfs-dir.test | 8 ++++----
>>>> + 1 file changed, 4 insertions(+), 4 deletions(-)
>>>> +
>>>> +diff --git a/test/nfs/nfs-dir.test b/test/nfs/nfs-dir.test
>>>> +index 33e5f5f..7216a6e 100644
>>>> +--- a/test/nfs/nfs-dir.test
>>>> ++++ b/test/nfs/nfs-dir.test
>>>> +@@ -14,7 +14,7 @@ EXPORT_PATH => the path that is mounted at the working directory.
>>>> +     Make sure the file can be accessed before.
>>>> +
>>>> +     $ su bin
>>>> +-    $ cat test/blah
>>>> ++    $ cat %{EXPORT_PATH}/test/blah
>>>> +     > blah
>>>> +
>>>> +     Set up a situation that triggers the bug.
>>>> +@@ -36,12 +36,12 @@ EXPORT_PATH => the path that is mounted at the working directory.
>>>> +     fail with "Stale NFS file handle" or "Input/output error".
>>>> +
>>>> +     $ su bin
>>>> +-    $ cat test/blah
>>>> ++    $ cat %{EXPORT_PATH}/test/blah
>>>> +     > blah
>>>> +     $ sleep 3
>>>> +-    $ cat test/blah
>>>> ++    $ cat %{EXPORT_PATH}/test/blah
>>>> +     > blah
>>>> +-    $ cat test/blah
>>>> ++    $ cat %{EXPORT_PATH}/test/blah
>>>> +     > blah
>>>> +
>>>> +     Clean up.
>>>> +--
>>>> +2.34.1
>>>> +
>>>> diff --git a/meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch b/meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch
>>>> new file mode 100644
>>>> index 0000000000..f990ca4a31
>>>> --- /dev/null
>>>> +++ b/meta/recipes-support/attr/acl/0001-test-nfs-nfsacl.test-Correct-the-check-item.patch
>>>> @@ -0,0 +1,51 @@
>>>> +From dfc6328f02821f9c6703f764ec6f53cf81daaab6 Mon Sep 17 00:00:00 2001
>>>> +From: Mingli Yu <mingli.yu@windriver.com>
>>>> +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]
>>>> +
>>>> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>>>> +---
>>>> + test/nfs/nfsacl.test | 6 +++---
>>>> + 1 file changed, 3 insertions(+), 3 deletions(-)
>>>> +
>>>> +diff --git a/test/nfs/nfsacl.test b/test/nfs/nfsacl.test
>>>> +index 4f37322..dfcc323 100644
>>>> +--- a/test/nfs/nfsacl.test
>>>> ++++ b/test/nfs/nfsacl.test
>>>> +@@ -8,7 +8,7 @@ The test should be run on an NFS export mount with ACL support.
>>>> +     $ echo blah > test/sub/blah
>>>> +
>>>> +     $ cp -rp test/sub test/sub2
>>>> +-    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}'
>>>> ++    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}'
>>>> +     > drwxr-xr-x test/sub2
>>>> +     > -rw-r--r-- test/sub2/blah
>>>> +
>>>> +@@ -23,7 +23,7 @@ The test should be run on an NFS export mount with ACL support.
>>>> +     >
>>>> +
>>>> +     $ cp -rp test/sub test/sub2
>>>> +-    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}'
>>>> ++    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}'
>>>> +     > drwxrwxr-x+ test/sub2
>>>> +     > -rw-r--r-- test/sub2/blah
>>>> +
>>>> +@@ -31,7 +31,7 @@ The test should be run on an NFS export mount with ACL support.
>>>> +
>>>> +     $ setfacl -m u:daemon:rw test/sub/blah
>>>> +     $ cp -rp test/sub test/sub2
>>>> +-    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$8}'
>>>> ++    $ find test/sub2 | sort | xargs ls -dl | awk '{print $1,$9}'
>>>> +     > drwxrwxr-x+ test/sub2
>>>> +     > -rw-rw-r--+ test/sub2/blah
>>>> +
>>>> +--
>>>> +2.34.1
>>>> +
>>>> diff --git a/meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch b/meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch
>>>> new file mode 100644
>>>> index 0000000000..2fea254fec
>>>> --- /dev/null
>>>> +++ b/meta/recipes-support/attr/acl/0001-tests-fix-getpwnam-and-getgrnam.patch
>>>> @@ -0,0 +1,67 @@
>>>> +From 6398d3fe7a766b4e3cd15bb77fd0f15f7dba52b2 Mon Sep 17 00:00:00 2001
>>>> +From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
>>>> +Date: Wed, 19 Jun 2024 11:11:30 +0800
>>>> +Subject: [PATCH] tests: fix getpwnam and getgrnam
>>>> +MIME-Version: 1.0
>>>> +Content-Type: text/plain; charset=UTF-8
>>>> +Content-Transfer-Encoding: 8bit
>>>> +
>>>> +The calls to these functions 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/root/restore.test test:
>>>> +
>>>> +[21] $ chown bin passwd -- failed
>>>> +chown: invalid user: ‘bin’        != ~
>>>> +
>>>> +Fixes: 3737f000d3f17cd283f51eeacac21a71a3472053 ("use thread-safe getpwnam_r
>>>> +and getgrnam_r")
>>>> +
>>>> +Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/acl-devel/2024-06/msg00000.html]
>>>> +
>>>> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>>>> +---
>>>> + test/test_group.c  | 2 +-
>>>> + test/test_passwd.c | 4 ++--
>>>> + 2 files changed, 3 insertions(+), 3 deletions(-)
>>>> +
>>>> +diff --git a/test/test_group.c b/test/test_group.c
>>>> +index 96dd612..42d6b07 100644
>>>> +--- a/test/test_group.c
>>>> ++++ b/test/test_group.c
>>>> +@@ -136,7 +136,7 @@ struct group *getgrnam(const char *name)
>>>> +     static struct group grp;
>>>> +     struct group *result;
>>>> +
>>>> +-    (void) getgrnam_r(name, &grp, buf, sizeof(buf), &result);
>>>> ++    (void) test_getgr_match(&grp, buf, sizeof buf, &result, match_name, name);
>>>> +     return result;
>>>> + }
>>>> +
>>>> +diff --git a/test/test_passwd.c b/test/test_passwd.c
>>>> +index 9428bf8..97f2673 100644
>>>> +--- a/test/test_passwd.c
>>>> ++++ b/test/test_passwd.c
>>>> +@@ -119,7 +119,7 @@ int getpwnam_r(const char *name, struct passwd *pwd, char *buf, size_t buflen,
>>>> +             *result = NULL;
>>>> +             return ERANGE;
>>>> +     }
>>>> +-    last_buflen =- 1;
>>>> ++    last_buflen = -1;
>>>> +
>>>> +     return test_getpw_match(pwd, buf, buflen, result, match_name, name);
>>>> + }
>>>> +@@ -131,7 +131,7 @@ struct passwd *getpwnam(const char *name)
>>>> +     static struct passwd pwd;
>>>> +     struct passwd *result;
>>>> +
>>>> +-    (void) getpwnam_r(name, &pwd, buf, sizeof(buf), &result);
>>>> ++    (void) test_getpw_match(&pwd, buf, sizeof(buf), &result, match_name, name);
>>>> +     return result;
>>>> + }
>>>> +
>>>> +--
>>>> +2.34.1
>>>> +
>>>> diff --git a/meta/recipes-support/attr/acl/run-ptest b/meta/recipes-support/attr/acl/run-ptest
>>>> index 3af75c84fe..bc7947c3ad 100644
>>>> --- a/meta/recipes-support/attr/acl/run-ptest
>>>> +++ b/meta/recipes-support/attr/acl/run-ptest
>>>> @@ -6,8 +6,10 @@
>>>>
>>>>    mkdir -p /tmp/acl-ptest/test
>>>>    cp test/test.* /tmp/acl-ptest/test
>>>> +export EXPORT_PATH="/tmp/acl-ptest/test"
>>>>
>>>>    set +e
>>>> +rm -rf test-suite.log
>>>>    make test-suite.log
>>>>    exitcode=$?
>>>>    if [ $exitcode -ne 0 -a -e test-suite.log ]; then
>>>> diff --git a/meta/recipes-support/attr/acl_2.3.2.bb b/meta/recipes-support/attr/acl_2.3.2.bb
>>>> index 6178473873..ee86ce2cae 100644
>>>> --- a/meta/recipes-support/attr/acl_2.3.2.bb
>>>> +++ b/meta/recipes-support/attr/acl_2.3.2.bb
>>>> @@ -19,6 +19,9 @@ 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 \
>>>>               "
>>>>
>>>>    SRC_URI[sha256sum] = "5f2bdbad629707aa7d85c623f994aa8a1d2dec55a73de5205bac0bf6058a2f7c"
>>>> --
>>>> 2.34.1
>>>>
>>>
>>>>
>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>> Links: You receive all messages sent to this group.
>>>> View/Reply Online (#201151): https://lists.openembedded.org/g/openembedded-core/message/201151
>>>> Mute This Topic: https://lists.openembedded.org/mt/106885245/3617179
>>>> Group Owner: openembedded-core+owner@lists.openembedded.org
>>>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>
>>>
>>>
>>> --
>>> Alexandre Belloni, co-owner and COO, Bootlin
>>> Embedded Linux and Kernel engineering
>>> https://bootlin.com
> 
> --
> Alexandre Belloni, co-owner and COO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com


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

end of thread, other threads:[~2024-06-27  7:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-26  5:56 [PATCH v2] acl: Fix nfs ptest failure mingli.yu
2024-06-26 23:09 ` [OE-core] " Alexandre Belloni
2024-06-27  6:15   ` Yu, Mingli
2024-06-27  6:57     ` Alexandre Belloni
2024-06-27  7:03       ` Yu, Mingli
2024-06-27  6:17   ` [PATCH] acl: Add attr to RDEPENDS:${PN}-ptest mingli.yu
2024-06-27  6:23     ` [OE-core] " Chen, Qi
2024-06-27  6:59       ` Yu, Mingli

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