summaryrefslogtreecommitdiffstats
path: root/tests/features
diff options
context:
space:
mode:
Diffstat (limited to 'tests/features')
-rwxr-xr-xtests/features/ipc.t21
-rwxr-xr-xtests/features/ipctest.py28
2 files changed, 49 insertions, 0 deletions
diff --git a/tests/features/ipc.t b/tests/features/ipc.t
new file mode 100755
index 00000000000..2aaca6620bf
--- /dev/null
+++ b/tests/features/ipc.t
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+
+cleanup;
+mkdir -p $B0/1
+mkdir -p $M0
+
+TEST glusterd
+TEST pidof glusterd
+TEST $CLI volume info;
+
+TEST $CLI volume create $V0 $H0:$B0/1
+TEST $CLI volume start $V0
+
+# This is a pretty lame test. Basically we just want to make sure that we
+# get all the way through the translator stacks on client and server to get a
+# simple error (95 = EOPNOTUPP) instead of a crash, RPC error, etc.
+EXPECT 95 $PYTHON $(dirname $0)/ipctest.py $H0 $V0
+
+cleanup;
diff --git a/tests/features/ipctest.py b/tests/features/ipctest.py
new file mode 100755
index 00000000000..0592bae3bbc
--- /dev/null
+++ b/tests/features/ipctest.py
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+
+import ctypes
+import ctypes.util
+
+api = ctypes.CDLL(ctypes.util.find_library("gfapi"))
+api.glfs_ipc.argtypes = [ ctypes.c_void_p, ctypes.c_int ]
+api.glfs_ipc.restype = ctypes.c_int
+
+def do_ipc (host, volume):
+ fs = api.glfs_new(volume)
+ #api.glfs_set_logging(fs,"/dev/stderr",7)
+ api.glfs_set_volfile_server(fs,"tcp",host,24007)
+
+ api.glfs_init(fs)
+ ret = api.glfs_ipc(fs,1470369258)
+ api.glfs_fini(fs)
+
+ return ret
+
+if __name__ == "__main__":
+ import sys
+
+ try:
+ res = apply(do_ipc,sys.argv[1:3])
+ print res
+ except:
+ print "IPC failed (volume not started?)"