]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: virnetdaemontest: Enable testing for 'auth_pending'
authorMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
Thu, 21 Dec 2017 14:29:06 +0000 (15:29 +0100)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 4 Jan 2018 11:55:31 +0000 (06:55 -0500)
Enable testing for 'auth_pending' in the virnetdaemon test case.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
tests/virnetdaemondata/input-data-client-auth-pending-failure.json [new file with mode: 0644]
tests/virnetdaemondata/input-data-client-auth-pending.json [new file with mode: 0644]
tests/virnetdaemondata/output-data-client-auth-pending.json [new file with mode: 0644]
tests/virnetdaemontest.c

diff --git a/tests/virnetdaemondata/input-data-client-auth-pending-failure.json b/tests/virnetdaemondata/input-data-client-auth-pending-failure.json
new file mode 100644 (file)
index 0000000..7d4ef64
--- /dev/null
@@ -0,0 +1,44 @@
+{
+    "servers": {
+        "testServer0": {
+            "min_workers": 10,
+            "max_workers": 50,
+            "priority_workers": 5,
+            "max_clients": 100,
+            "max_anonymous_clients": 10,
+            "keepaliveInterval": 120,
+            "keepaliveCount": 5,
+            "next_client_id": 5,
+            "services": [
+                {
+                    "auth": 0,
+                    "readonly": true,
+                    "nrequests_client_max": 2,
+                    "socks": [
+                        {
+                            "fd": 100,
+                            "errfd": -1,
+                            "pid": 0,
+                            "isClient": false
+                        }
+                    ]
+                },
+            ],
+            "clients": [
+                {
+                    "id": 2,
+                    "auth": 0,
+                    "auth_pending": true,
+                    "readonly": true,
+                    "nrequests_max": 15,
+                    "sock": {
+                        "fd": 102,
+                        "errfd": -1,
+                        "pid": -1,
+                        "isClient": true
+                    }
+                },
+            ]
+        }
+    }
+}
diff --git a/tests/virnetdaemondata/input-data-client-auth-pending.json b/tests/virnetdaemondata/input-data-client-auth-pending.json
new file mode 100644 (file)
index 0000000..ae85253
--- /dev/null
@@ -0,0 +1,70 @@
+{
+    "servers": {
+        "testServer0": {
+            "min_workers": 10,
+            "max_workers": 50,
+            "priority_workers": 5,
+            "max_clients": 100,
+            "max_anonymous_clients": 10,
+            "keepaliveInterval": 120,
+            "keepaliveCount": 5,
+            "next_client_id": 5,
+            "services": [
+                {
+                    "auth": 0,
+                    "readonly": true,
+                    "nrequests_client_max": 2,
+                    "socks": [
+                        {
+                            "fd": 100,
+                            "errfd": -1,
+                            "pid": 0,
+                            "isClient": false
+                        }
+                    ]
+                },
+                {
+                    "auth": 2,
+                    "readonly": false,
+                    "nrequests_client_max": 5,
+                    "socks": [
+                        {
+                            "fd": 101,
+                            "errfd": -1,
+                            "pid": 0,
+                            "isClient": false
+                        }
+                    ]
+                }
+            ],
+            "clients": [
+                {
+                    "id": 2,
+                    "auth": 0,
+                    "auth_pending": false,
+                    "readonly": true,
+                    "nrequests_max": 15,
+                    "sock": {
+                        "fd": 102,
+                        "errfd": -1,
+                        "pid": -1,
+                        "isClient": true
+                    }
+                },
+                {
+                    "id": 3,
+                    "auth": 2,
+                    "auth_pending": true,
+                    "readonly": true,
+                    "nrequests_max": 66,
+                    "sock": {
+                        "fd": 103,
+                        "errfd": -1,
+                        "pid": -1,
+                        "isClient": true
+                    }
+                }
+            ]
+        }
+    }
+}
diff --git a/tests/virnetdaemondata/output-data-client-auth-pending.json b/tests/virnetdaemondata/output-data-client-auth-pending.json
new file mode 100644 (file)
index 0000000..5720ea9
--- /dev/null
@@ -0,0 +1,70 @@
+{
+  "servers": {
+    "testServer0": {
+      "min_workers": 10,
+      "max_workers": 50,
+      "priority_workers": 5,
+      "max_clients": 100,
+      "max_anonymous_clients": 10,
+      "keepaliveInterval": 120,
+      "keepaliveCount": 5,
+      "next_client_id": 5,
+      "services": [
+        {
+          "auth": 0,
+          "readonly": true,
+          "nrequests_client_max": 2,
+          "socks": [
+            {
+              "fd": 100,
+              "errfd": -1,
+              "pid": 0,
+              "isClient": false
+            }
+          ]
+        },
+        {
+          "auth": 2,
+          "readonly": false,
+          "nrequests_client_max": 5,
+          "socks": [
+            {
+              "fd": 101,
+              "errfd": -1,
+              "pid": 0,
+              "isClient": false
+            }
+          ]
+        }
+      ],
+      "clients": [
+        {
+          "id": 2,
+          "auth": 0,
+          "auth_pending": false,
+          "readonly": true,
+          "nrequests_max": 15,
+          "sock": {
+            "fd": 102,
+            "errfd": -1,
+            "pid": -1,
+            "isClient": true
+          }
+        },
+        {
+          "id": 3,
+          "auth": 2,
+          "auth_pending": true,
+          "readonly": true,
+          "nrequests_max": 66,
+          "sock": {
+            "fd": 103,
+            "errfd": -1,
+            "pid": -1,
+            "isClient": true
+          }
+        }
+      ]
+    }
+  }
+}
index 2835d9f96f7f27c342be6ddf4719e03c5c23850d..3e60f090079bdeb2b83b99097f3c99d6822260e4 100644 (file)
@@ -341,6 +341,8 @@ mymain(void)
     EXEC_RESTART_TEST("client-ids", 1);
     EXEC_RESTART_TEST("client-timestamp", 1);
     EXEC_RESTART_TEST_FAIL("anon-clients", 2);
+    EXEC_RESTART_TEST("client-auth-pending", 1);
+    EXEC_RESTART_TEST_FAIL("client-auth-pending-failure", 1);
 
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }