ctdb-tests: Add comments describing sock daemon tests
authorMartin Schwenke <martin@meltin.net>
Wed, 16 Aug 2017 07:37:16 +0000 (17:37 +1000)
committerAmitay Isaacs <amitay@samba.org>
Tue, 29 Aug 2017 09:14:09 +0000 (11:14 +0200)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/src/sock_daemon_test.c

index 278dcab8ec071b9e059cd673780f298775f1e43b..98b9f066fc8af895201eab39ea0131f4e101b30a 100644 (file)
@@ -54,6 +54,12 @@ static struct sock_socket_funcs dummy_socket_funcs = {
        .read_recv = dummy_read_recv,
 };
 
+/*
+ * test1
+ *
+ * Check setup without actually running daemon
+ */
+
 static void test1(TALLOC_CTX *mem_ctx, const char *pidfile,
                  const char *sockpath)
 {
@@ -86,6 +92,13 @@ static void test1(TALLOC_CTX *mem_ctx, const char *pidfile,
        assert(ret == -1);
 }
 
+/*
+ * test2
+ *
+ * Start daemon, check PID file, sock daemon functions, termination,
+ * exit code
+ */
+
 static void test2_startup(void *private_data)
 {
        int fd = *(int *)private_data;
@@ -200,6 +213,12 @@ static void test2(TALLOC_CTX *mem_ctx, const char *pidfile,
        assert(ret == -1);
 }
 
+/*
+ * test3
+ *
+ * Start daemon, test watching of (parent) PID
+ */
+
 static void test3(TALLOC_CTX *mem_ctx, const char *pidfile,
                  const char *sockpath)
 {
@@ -254,6 +273,12 @@ static void test3(TALLOC_CTX *mem_ctx, const char *pidfile,
        assert(ret == -1);
 }
 
+/*
+ * test4
+ *
+ * Start daemon, test termination via wait_send function
+ */
+
 struct test4_wait_state {
 };
 
@@ -354,6 +379,12 @@ static void test4(TALLOC_CTX *mem_ctx, const char *pidfile,
        assert(ret == -1);
 }
 
+/*
+ * test5
+ *
+ * Start daemon, multiple client connects, requests, disconnects
+ */
+
 #define TEST5_MAX_CLIENTS      10
 
 struct test5_pkt {
@@ -652,6 +683,12 @@ static void test5(TALLOC_CTX *mem_ctx, const char *pidfile,
        assert(ret == 0);
 }
 
+/*
+ * test6
+ *
+ * Start daemon, test client connects, requests, replies, disconnects
+ */
+
 struct test6_pkt {
        uint32_t len;
        uint32_t data;