summaryrefslogtreecommitdiffstats
path: root/tests/basic/gfapi/upcall-register-api.t
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2017-09-22 16:43:39 +0530
committerAmar Tumballi <amarts@redhat.com>2017-10-31 07:53:50 +0000
commitc0e77f643930499966554cd849a40580e4ff68f9 (patch)
tree5baf2c5b33da77b4567fd23a77d526ca890519b0 /tests/basic/gfapi/upcall-register-api.t
parent4216869c724cf19c12d63c0580de88e9427e6467 (diff)
downloadglusterfs-c0e77f643930499966554cd849a40580e4ff68f9.tar.gz
glusterfs-c0e77f643930499966554cd849a40580e4ff68f9.tar.xz
glusterfs-c0e77f643930499966554cd849a40580e4ff68f9.zip
gfapi: Register/Unregister Upcall events' callback
Polling continuously for upcall events is not optimal. Hence new APIs have been added to allow applications to register and unregister upcall events it is interested in along with callback function to be invoked in case of any such upcalls sent by backend server. @TODO: Make changes in upcall xlator so that events are sent to only those clients which either registered callbacks or started polling. Shall be addressed in separate patch. Updates: #315 Change-Id: I40473fd5cf689172ff2d7bb2869756b7fd5bc761 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Diffstat (limited to 'tests/basic/gfapi/upcall-register-api.t')
-rwxr-xr-xtests/basic/gfapi/upcall-register-api.t30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/basic/gfapi/upcall-register-api.t b/tests/basic/gfapi/upcall-register-api.t
new file mode 100755
index 0000000000..a46234ed7a
--- /dev/null
+++ b/tests/basic/gfapi/upcall-register-api.t
@@ -0,0 +1,30 @@
+#!/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`
+
+## Enable Upcall cache-invalidation feature
+TEST $CLI volume set $V0 features.cache-invalidation on;
+
+TEST build_tester $(dirname $0)/upcall-register-api.c -lgfapi
+
+TEST ./$(dirname $0)/upcall-register-api $H0 $V0 $logdir/upcall-register-api.log
+
+cleanup_tester $(dirname $0)/upcall-register-api
+
+TEST $CLI volume stop $V0
+TEST $CLI volume delete $V0
+
+cleanup;