summaryrefslogtreecommitdiff
path: root/test/getfattr.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/getfattr.test')
-rw-r--r--test/getfattr.test52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/getfattr.test b/test/getfattr.test
new file mode 100644
index 0000000..1e9366d
--- /dev/null
+++ b/test/getfattr.test
@@ -0,0 +1,52 @@
+ $ mkdir d
+ $ cd d
+
+ $ touch f
+ $ setfattr -n user.test -v test f
+ $ ln -s f l
+
+This case should be obvious:
+ $ getfattr -d f
+ > # file: f
+ > user.test="test"
+ >
+
+If a symlink is explicitly specified on the command line, follow it
+(-H behavior):
+ $ getfattr -d l
+ > # file: l
+ > user.test="test"
+ >
+
+Unless we are explicitly told not to dereference symlinks:
+ $ getfattr -hd l
+
+When walking a tree, it does not make sense to follow symlinks. We should
+only see f's attributes here -- that's a bug:
+ $ getfattr -Rd .
+ > # file: f
+ > user.test="test"
+ >
+
+This case works as expected:
+ $ getfattr -Rhd .
+ > # file: f
+ > user.test="test"
+ >
+
+In these two cases, getfattr should dereference the symlink passed on the
+command line, but not l. This doesn't work correctly, either; it's the same
+bug:
+ $ ln -s . here
+ $ getfattr -Rd here
+ > # file: here/f
+ > user.test="test"
+ >
+
+ $ getfattr -Rhd here
+ > # file: here/f
+ > user.test="test"
+ >
+
+ $ cd ..
+ $ rm -rf d