aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-04-11 19:28:11 -0700
committerDamjan Marion <dmarion@me.com>2022-04-12 08:06:16 +0000
commitc15fc34b8f73b8a1dbda9fd69f6cd184781a8105 (patch)
treecf11c5bd8787b4135bc58f20b202aa48d61fb772
parentc792b9f5e905c168f77ab1a262351ecd2fb4b511 (diff)
hsa: vcl test client option to close only client
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I45c63e0a7d7179a0f27ca3f093bd3cf7458a12d3
-rw-r--r--src/plugins/hs_apps/vcl/vcl_test.h3
-rw-r--r--src/plugins/hs_apps/vcl/vcl_test_client.c11
2 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/hs_apps/vcl/vcl_test.h b/src/plugins/hs_apps/vcl/vcl_test.h
index 4f67e03f72b..d51e204140f 100644
--- a/src/plugins/hs_apps/vcl/vcl_test.h
+++ b/src/plugins/hs_apps/vcl/vcl_test.h
@@ -80,6 +80,7 @@ typedef enum
VCL_TEST_TYPE_UNI,
VCL_TEST_TYPE_BI,
VCL_TEST_TYPE_EXIT,
+ VCL_TEST_TYPE_EXIT_CLIENT,
} vcl_test_t;
typedef enum
@@ -201,7 +202,7 @@ static inline void
vcl_test_cfg_init (vcl_test_cfg_t * cfg)
{
cfg->magic = VCL_TEST_CFG_CTRL_MAGIC;
- cfg->test = VCL_TEST_TYPE_NONE;
+ cfg->test = VCL_TEST_TYPE_UNI;
cfg->ctrl_handle = ~0;
cfg->num_test_sessions = 1;
cfg->num_test_sessions_perq = 1;
diff --git a/src/plugins/hs_apps/vcl/vcl_test_client.c b/src/plugins/hs_apps/vcl/vcl_test_client.c
index 182de8f9015..730df55b016 100644
--- a/src/plugins/hs_apps/vcl/vcl_test_client.c
+++ b/src/plugins/hs_apps/vcl/vcl_test_client.c
@@ -701,7 +701,7 @@ vtc_process_opts (vcl_test_client_main_t * vcm, int argc, char **argv)
int c, v;
opterr = 0;
- while ((c = getopt (argc, argv, "chnp:w:XE:I:N:R:T:UBV6DLs:q:S")) != -1)
+ while ((c = getopt (argc, argv, "chnp:w:xXE:I:N:R:T:UBV6DLs:q:S")) != -1)
switch (c)
{
case 'c':
@@ -759,6 +759,9 @@ vtc_process_opts (vcl_test_client_main_t * vcm, int argc, char **argv)
vcm->post_test = VCL_TEST_TYPE_EXIT;
break;
+ case 'x':
+ vcm->post_test = VCL_TEST_TYPE_NONE;
+
case 'E':
if (strlen (optarg) > ctrl->txbuf_size)
{
@@ -947,6 +950,10 @@ vtc_ctrl_session_exit (void)
vcl_test_session_t *ctrl = &vcm->ctrl_session;
int verbose = ctrl->cfg.verbose;
+ /* Only clients exits, server can accept new connections */
+ if (vcm->post_test == VCL_TEST_TYPE_EXIT_CLIENT)
+ return;
+
ctrl->cfg.test = VCL_TEST_TYPE_EXIT;
vtinf ("(fd %d): Sending exit cfg to server...", ctrl->fd);
if (verbose)
@@ -1027,6 +1034,7 @@ main (int argc, char **argv)
int rv;
vcm->n_workers = 1;
+ vcm->post_test = VCL_TEST_TYPE_EXIT_CLIENT;
vcl_test_cfg_init (&ctrl->cfg);
vcl_test_session_buf_alloc (ctrl);
vtc_process_opts (vcm, argc, argv);
@@ -1082,6 +1090,7 @@ main (int argc, char **argv)
switch (vcm->post_test)
{
case VCL_TEST_TYPE_EXIT:
+ case VCL_TEST_TYPE_EXIT_CLIENT:
switch (ctrl->cfg.test)
{
case VCL_TEST_TYPE_EXIT: