That way it actually fits with what the condition checks for. Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx> --- src/rpc/virnetserver.c | 6 ++-- ...nput-data-invalid-max-clients-failure.json | 31 +++++++++++++++++++ ...utput-data-invalid-max-clients-failure.err | 1 + tests/virnetdaemontest.c | 1 + 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 tests/virnetdaemondata/input-data-invalid-max-clients-failure.json create mode 100644 tests/virnetdaemondata/output-data-invalid-max-clients-failure.err diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index 17ab61b88245..2ec4b9a6c947 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -1114,9 +1114,9 @@ virNetServerSetClientLimits(virNetServer *srv, if (max < max_unauth) { virReportError(VIR_ERR_INVALID_ARG, "%s", - _("The overall maximum number of clients must be " - "greater than the maximum number of clients waiting " - "for authentication")); + _("The overall maximum number of clients waiting " + "for authentication must not be less than the overall " + "maximum number of clients")); return -1; } diff --git a/tests/virnetdaemondata/input-data-invalid-max-clients-failure.json b/tests/virnetdaemondata/input-data-invalid-max-clients-failure.json new file mode 100644 index 000000000000..9bd55929943b --- /dev/null +++ b/tests/virnetdaemondata/input-data-invalid-max-clients-failure.json @@ -0,0 +1,31 @@ +{ + "servers": { + "testServer0": { + "min_workers": 10, + "max_workers": 50, + "priority_workers": 5, + "max_clients": 5, + "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": [ + ] + } + } +} diff --git a/tests/virnetdaemondata/output-data-invalid-max-clients-failure.err b/tests/virnetdaemondata/output-data-invalid-max-clients-failure.err new file mode 100644 index 000000000000..00c2cee42c8c --- /dev/null +++ b/tests/virnetdaemondata/output-data-invalid-max-clients-failure.err @@ -0,0 +1 @@ +internal error: The overall maximum number of clients must not be less than the number of clients waiting for authentication diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c index 47d0923bdd93..110ec748f8b6 100644 --- a/tests/virnetdaemontest.c +++ b/tests/virnetdaemontest.c @@ -413,6 +413,7 @@ mymain(void) EXEC_RESTART_TEST_FAIL("anon-clients", 2); EXEC_RESTART_TEST("client-auth-pending", 1); EXEC_RESTART_TEST_FAIL("client-auth-pending-failure", 1); + EXEC_RESTART_TEST_FAIL("invalid-max-clients-failure", 1); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } -- 2.39.0