From d9b124f91e519b4131598eaa133550ccd02746ff Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Fri, 26 Jun 2015 11:01:52 -0700 Subject: [PATCH] Add integration test for xattr --- test/integration-test-main.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/integration-test-main.sh b/test/integration-test-main.sh index d0539b6..d63c846 100755 --- a/test/integration-test-main.sh +++ b/test/integration-test-main.sh @@ -314,6 +314,27 @@ ls 'special*' 2>&1 | grep -q 'No such file or directory' ls 'special~' 2>&1 | grep -q 'No such file or directory' ls 'specialĀµ' 2>&1 | grep -q 'No such file or directory' +########################################################## +# Testing extended attributes +########################################################## + +rm -f $TEST_TEXT_FILE +touch $TEST_TEXT_FILE + +# set value +setfattr -n key1 -v value1 $TEST_TEXT_FILE +getfattr -n key1 --only-values $TEST_TEXT_FILE | grep -q '^value1$' + +# append value +setfattr -n key2 -v value2 $TEST_TEXT_FILE +getfattr -n key1 --only-values $TEST_TEXT_FILE | grep -q '^value1$' +getfattr -n key2 --only-values $TEST_TEXT_FILE | grep -q '^value2$' + +# remove value +setfattr -x key1 $TEST_TEXT_FILE +! getfattr -n key1 --only-values $TEST_TEXT_FILE +getfattr -n key2 --only-values $TEST_TEXT_FILE | grep -q '^value2$' + ##################################################################### # Tests are finished #####################################################################