From f1fb3158d3f242f1884d8d8a7473ab0719e93e8c Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 23 May 2019 17:13:39 -0400 Subject: Implement -xattr predicate --- tests.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tests.sh') 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' -- cgit v1.2.3