summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-05-23 17:13:39 -0400
committerTavian Barnes <tavianator@tavianator.com>2019-05-24 09:00:51 -0400
commitf1fb3158d3f242f1884d8d8a7473ab0719e93e8c (patch)
tree4ab193109db3da98b779ed807f40adb3bb0b9fbd /tests.sh
parentd9b3196d6c8f4fa0e7d0a4771040762edaebb1ee (diff)
downloadbfs-f1fb3158d3f242f1884d8d8a7473ab0719e93e8c.tar.xz
Implement -xattr predicate
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests.sh b/tests.sh
index c776ba4..bec7022 100755
--- a/tests.sh
+++ b/tests.sh
@@ -648,6 +648,9 @@ sudo_tests=(
test_capable
test_L_capable
+ test_xattr
+ test_L_xattr
+
test_mount
test_xdev
@@ -2351,6 +2354,30 @@ function test_L_capable() {
bfs_diff -L scratch -capable
}
+function test_xattr() {
+ rm -rf scratch/*
+ touch scratch/{normal,xattr}
+ # Linux tmpfs doesn't support the user.* namespace, so we use the security.*
+ # namespace, which is writable by root and readable by others
+ sudo setfattr -n security.bfs_test scratch/xattr
+ ln -s xattr scratch/link
+ ln -s normal scratch/xattr_link
+ sudo setfattr -h -n security.bfs_test scratch/xattr_link
+
+ bfs_diff scratch -xattr
+}
+
+function test_L_xattr() {
+ rm -rf scratch/*
+ touch scratch/{normal,xattr}
+ sudo setfattr -n security.bfs_test scratch/xattr
+ ln -s xattr scratch/link
+ ln -s normal scratch/xattr_link
+ sudo setfattr -h -n security.bfs_test scratch/xattr_link
+
+ bfs_diff -L scratch -xattr
+}
+
BOL=
EOL='\n'