summaryrefslogtreecommitdiffstats
path: root/tests/basic/gfapi/glfs_h_creat_open.t
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2019-09-18 16:32:08 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2019-09-25 10:47:36 +0000
commit41a0f2aa755ec7162facd30209f2fa3f40308766 (patch)
tree95285259bbf5580f81796c379fe4383dce9226c7 /tests/basic/gfapi/glfs_h_creat_open.t
parent5677b85a59ec98dbe8c99680308403f56d3ce014 (diff)
gfapi: 'glfs_h_creat_open' - new API to create handle and open fd
Right now we have two separate APIs, one - 'glfs_h_creat_handle' to create handle & another - 'glfs_h_open' to create a glfd to return to application Having two separate routines can result in access errors while trying to create and write into a read-only file. Since a fd is opened even during file/directory creation, introducing a new API to make these two operations atomic i.e, which can create both handle & fd and pass them to application Change-Id: Ibf513fcfcdad175f4d7eb6fa7a61b8feec6d33b5 Fixes: bz#1753569 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Diffstat (limited to 'tests/basic/gfapi/glfs_h_creat_open.t')
-rwxr-xr-xtests/basic/gfapi/glfs_h_creat_open.t27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/basic/gfapi/glfs_h_creat_open.t b/tests/basic/gfapi/glfs_h_creat_open.t
new file mode 100755
index 00000000000..f24ae7395be
--- /dev/null
+++ b/tests/basic/gfapi/glfs_h_creat_open.t
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+. $(dirname $0)/../../include.rc
+. $(dirname $0)/../../volume.rc
+
+cleanup;
+
+TEST glusterd
+
+TEST $CLI volume create $V0 $H0:$B0/brick1;
+EXPECT 'Created' volinfo_field $V0 'Status';
+
+TEST $CLI volume start $V0;
+EXPECT 'Started' volinfo_field $V0 'Status';
+
+logdir=`gluster --print-logdir`
+
+TEST build_tester $(dirname $0)/glfs_h_creat_open.c -lgfapi
+
+TEST ./$(dirname $0)/glfs_h_creat_open $H0 $V0 $logdir/glfs.log
+
+cleanup_tester $(dirname $0)/glfs_h_creat_open
+
+TEST $CLI volume stop $V0
+TEST $CLI volume delete $V0
+
+cleanup;