[PATCH 12/14] tests: virnetdaemontest: Enable testing for 'auth_pending'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Enable testing for 'auth_pending' in the virnetdaemon test case.

Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxxxxxxx>
---
 .../input-data-client-auth-pending-failure.json    | 44 ++++++++++++++
 .../input-data-client-auth-pending.json            | 70 ++++++++++++++++++++++
 .../output-data-client-auth-pending.json           | 70 ++++++++++++++++++++++
 tests/virnetdaemontest.c                           |  2 +
 4 files changed, 186 insertions(+)
 create mode 100644 tests/virnetdaemondata/input-data-client-auth-pending-failure.json
 create mode 100644 tests/virnetdaemondata/input-data-client-auth-pending.json
 create mode 100644 tests/virnetdaemondata/output-data-client-auth-pending.json

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
index 000000000000..7d4ef6438dea
--- /dev/null
+++ b/tests/virnetdaemondata/input-data-client-auth-pending-failure.json
@@ -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
index 000000000000..ae85253b5332
--- /dev/null
+++ b/tests/virnetdaemondata/input-data-client-auth-pending.json
@@ -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
index 000000000000..5720ea9b71c4
--- /dev/null
+++ b/tests/virnetdaemondata/output-data-client-auth-pending.json
@@ -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/virnetdaemontest.c b/tests/virnetdaemontest.c
index 2835d9f96f7f..3e60f090079b 100644
--- a/tests/virnetdaemontest.c
+++ b/tests/virnetdaemontest.c
@@ -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;
 }
-- 
2.13.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux