Le 10/01/2024 à 21:41, Pádraig Brady a écrit :
On 10/01/2024 18:21, Sylvestre Ledru wrote:
Hello
AFAIK, there isn't a test in ls to verify that using setfactl on
directory shows a "+".
This patch should cover this.
That's worthwhile adding.
It may need more guards though.
I'd be inclined to check getfacl output first before testing with ls.
I.e. use the guards from tests/cp/acl.sh
This new test will also need to be referenced in tests/local.mk
Also the summary should start with "tests:"
Thanks!
Here it is!
Cheers,
Sylvestre
From da2169448387e155a1210cef4a4629f198847f1a Mon Sep 17 00:00:00 2001
From: Sylvestre Ledru <sylves...@debian.org>
Date: Wed, 10 Jan 2024 19:18:05 +0100
Subject: [PATCH] tests: ls: add a test to verify that '+' is added
---
tests/local.mk | 1 +
tests/ls/acl.sh | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+)
create mode 100644 tests/ls/acl.sh
diff --git a/tests/local.mk b/tests/local.mk
index b74a4a234..2174cef91 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -608,6 +608,7 @@ all_tests = \
tests/ln/slash-decorated-nonexistent-dest.sh \
tests/ln/target-1.sh \
tests/ls/a-option.sh \
+ tests/ls/acl.sh \
tests/ls/abmon-align.sh \
tests/ls/birthtime.sh \
tests/ls/block-size.sh \
diff --git a/tests/ls/acl.sh b/tests/ls/acl.sh
new file mode 100644
index 000000000..fb7fcd3c1
--- /dev/null
+++ b/tests/ls/acl.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# verify that ls -al with acl display the "+"
+
+# Copyright (C) 2011-2024 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
+print_ver_ ls
+
+require_setfacl_
+
+mkdir k || framework_failure_
+skip=no
+getfacl k 2> /dev/null || skip=yes
+setfacl -d -m user::rwx k 2> /dev/null || skip=yes
+test $skip = yes &&
+ skip_ "'.' is not on a suitable file system for this test"
+
+ls_l=$(ls -ld k) || fail=1
+
+case $ls_l in
+ drwx*+*) ;;
+ *) fail=1; ;;
+esac
+
+Exit $fail
--
2.43.0