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

Marc Hartmayer posted 14 patches 7 years, 5 months ago
There is a newer version of this series
[libvirt] [PATCH 12/14] tests: virnetdaemontest: Enable testing for 'auth_pending'
Posted by Marc Hartmayer 7 years, 5 months ago
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>
---
 .../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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 12/14] tests: virnetdaemontest: Enable testing for 'auth_pending'
Posted by John Ferlan 7 years, 5 months ago

On 12/12/2017 06:36 AM, Marc Hartmayer wrote:
> 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>
> ---
>  .../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
> 

I assume the -failure test case is what I pointed out in the previous
patch, right?  That somehow the ExecRestart case was incorrect and that
the check should be there and not in the NewInternal helper.

In any case, for this patch... Thanks for the test it helps.

Reviewed-by: John Ferlan <jferlan@redhat.com>

John

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 12/14] tests: virnetdaemontest: Enable testing for 'auth_pending'
Posted by Marc Hartmayer 7 years, 4 months ago
On Fri, Dec 15, 2017 at 08:01 PM +0100, John Ferlan <jferlan@redhat.com> wrote:
> On 12/12/2017 06:36 AM, Marc Hartmayer wrote:
>> 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>
>> ---
>>  .../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
>>
>
> I assume the -failure test case is what I pointed out in the previous
> patch, right?  That somehow the ExecRestart case was incorrect and that
> the check should be there and not in the NewInternal helper.

Yep.

>
> In any case, for this patch... Thanks for the test it helps.
>
> Reviewed-by: John Ferlan <jferlan@redhat.com>

Thanks.

>
> John
>
--
Beste Grüße / Kind regards
   Marc Hartmayer

IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


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