path: root/tests/gfid2path/gfid2path_fuse.t
diff options
authorAravinda VK <>2017-07-20 17:08:12 +0530
committerShyamsundar Ranganathan <>2017-07-28 14:53:20 +0000
commit1ae254ddcf397b101d291342272e13af25b0b1a1 (patch)
treea979684704b882f5717ce4e2f6a5c3c3c913ba70 /tests/gfid2path/gfid2path_fuse.t
parentb5fa5ae05f73e03023db37e43fb203267b719160 (diff)
tools/setgfid2path: Tool to set GFID to Path xattr in brick backend
Once storage/gfid2path feature is enabled using `gluster volume set <volname> storage.gfid2path enable`, it starts recording the gfid2path xattr on each files. But this feature will not add xattr to the existing files. This tool accepts the file path as argument and sets the necessary xattr required for this feature. Change-Id: I75ad82c86ce482950645e687ff2e33b413fa53da Updates: #139 Signed-off-by: Aravinda VK <> Reviewed-on: Smoke: Gluster Build System <> Reviewed-by: Niels de Vos <> Reviewed-by: Kotresh HR <> Tested-by: Kotresh HR <> CentOS-regression: Gluster Build System <>
Diffstat (limited to 'tests/gfid2path/gfid2path_fuse.t')
1 files changed, 20 insertions, 3 deletions
diff --git a/tests/gfid2path/gfid2path_fuse.t b/tests/gfid2path/gfid2path_fuse.t
index 38798cf..a66ab18 100644
--- a/tests/gfid2path/gfid2path_fuse.t
+++ b/tests/gfid2path/gfid2path_fuse.t
@@ -3,6 +3,8 @@
. $(dirname $0)/../include.rc
. $(dirname $0)/../volume.rc
XXHSUM_SOURCE="$(dirname $0)/../../contrib/xxhash/xxhsum.c $(dirname $0)/../../contrib/xxhash/xxhash.c"
@@ -25,15 +27,30 @@ EXPECT '1' brick_count $V0
TEST $CLI volume start $V0;
EXPECT 'Started' volinfo_field $V0 'Status';
-## enable gfid2path
-TEST $CLI volume set $V0 gfid2path enable
## Mount the volume
TEST $GFS --volfile-server=$H0 --volfile-id=$V0 $M0;
+# Create a file before enabling gfid2path
+touch $fname;
+# Set gfid2path xattr
+#Check for the presence of xattr
+echo -n $pgfid_bname > $xxh64_file
+xxh64sum=$($XXHSUM_EXEC $xxh64_file | awk '{print $1}')
+EXPECT $pgfid_bname get_text_xattr $key $backpath
+## enable gfid2path
+TEST $CLI volume set $V0 gfid2path enable
touch $fname;