From d9b3196d6c8f4fa0e7d0a4771040762edaebb1ee Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 23 May 2019 17:11:23 -0400 Subject: fsade: Refactor the POSIX.1e abstractions Since we're going to want to abstract more things that aren't part of POSIX.1e (like xattrs) in a similar way, let's give this a more generic name. And while we're at it, give it some more precise error reporting, and add some tests. --- tests.sh | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'tests.sh') diff --git a/tests.sh b/tests.sh index 15e341d..c776ba4 100755 --- a/tests.sh +++ b/tests.sh @@ -279,6 +279,9 @@ bsd_tests=( # Primaries + test_acl + test_L_acl + test_delete test_depth_maxdepth_1 @@ -642,6 +645,9 @@ bfs_tests=( ) sudo_tests=( + test_capable + test_L_capable + test_mount test_xdev @@ -2299,6 +2305,52 @@ function test_xtype_bind_mount() { return $ret } +function test_acl() { + rm -rf scratch/* + + if ! invoke_bfs scratch -acl 2>/dev/null; then + return 0 + fi + + touch scratch/{normal,acl} + setfacl -m "u:$(id -un):rw" scratch/acl + ln -s acl scratch/link + + bfs_diff scratch -acl +} + +function test_L_acl() { + rm -rf scratch/* + + if ! invoke_bfs scratch -acl 2>/dev/null; then + return 0 + fi + + touch scratch/{normal,acl} + setfacl -m "u:$(id -un):rw" scratch/acl + ln -s acl scratch/link + + bfs_diff -L scratch -acl +} + +function test_capable() { + rm -rf scratch/* + touch scratch/{normal,capable} + sudo setcap all+ep scratch/capable + ln -s capable scratch/link + + bfs_diff scratch -capable +} + +function test_L_capable() { + rm -rf scratch/* + touch scratch/{normal,capable} + sudo setcap all+ep scratch/capable + ln -s capable scratch/link + + bfs_diff -L scratch -capable +} + BOL= EOL='\n' -- cgit v1.2.3