From c0e77f643930499966554cd849a40580e4ff68f9 Mon Sep 17 00:00:00 2001 From: Soumya Koduri Date: Fri, 22 Sep 2017 16:43:39 +0530 Subject: 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 --- tests/basic/gfapi/upcall-register-api.t | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 tests/basic/gfapi/upcall-register-api.t (limited to 'tests/basic/gfapi/upcall-register-api.t') diff --git a/tests/basic/gfapi/upcall-register-api.t b/tests/basic/gfapi/upcall-register-api.t new file mode 100755 index 00000000000..a46234ed7af --- /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; -- cgit