diff options
author | Florin Coras <fcoras@cisco.com> | 2020-10-28 16:41:26 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-10-29 21:31:25 +0000 |
commit | 06ac4bbc3234d8538b12c5b7c101a3ee56616e2a (patch) | |
tree | 8a0f297614b80cb4492f66efaffc733d2671aa07 /src/plugins | |
parent | d6894568709b59625f03e92595e0686b05f2167a (diff) |
session: fix ct cleanup before full establishement
Type: fix
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I58fb0e05f62eae45818c23e8e148ff6758ba463a
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/unittest/session_test.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/plugins/unittest/session_test.c b/src/plugins/unittest/session_test.c index 37b4dac244d..c152a8ac9da 100644 --- a/src/plugins/unittest/session_test.c +++ b/src/plugins/unittest/session_test.c @@ -376,7 +376,18 @@ session_test_endpoint_cfg (vlib_main_t * vm, unformat_input_t * input) /* wait for stuff to happen */ while (connected_session_index == ~0 && ++tries < 100) - vlib_process_suspend (vm, 100e-3); + { + vlib_worker_thread_barrier_release (vm); + vlib_process_suspend (vm, 100e-3); + vlib_worker_thread_barrier_sync (vm); + } + while (accepted_session_index == ~0 && ++tries < 100) + { + vlib_worker_thread_barrier_release (vm); + vlib_process_suspend (vm, 100e-3); + vlib_worker_thread_barrier_sync (vm); + } + clib_warning ("waited %.1f seconds for connections", tries / 10.0); SESSION_TEST ((connected_session_index != ~0), "session should exist"); SESSION_TEST ((connected_session_thread != ~0), "thread should exist"); @@ -422,7 +433,7 @@ session_test_endpoint_cfg (vlib_main_t * vm, unformat_input_t * input) static int session_test_namespace (vlib_main_t * vm, unformat_input_t * input) { - u64 options[APP_OPTIONS_N_OPTIONS], placeholder_secret = 1234; + u64 options[APP_OPTIONS_N_OPTIONS], placeholder_secret = 1234, tries; u32 server_index, server_st_index, server_local_st_index; u32 placeholder_port = 1234, client_index, server_wrk_index; u32 placeholder_api_context = 4321, placeholder_client_api_index = ~0; @@ -609,6 +620,19 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input) connect_args.sep.ip.ip4.as_u8[0] = 127; error = vnet_connect (&connect_args); SESSION_TEST ((error == 0), "client connect should not return error code"); + + /* wait for accept */ + if (vlib_num_workers ()) + { + tries = 0; + while (!placeholder_accept && ++tries < 100) + { + vlib_worker_thread_barrier_release (vm); + vlib_process_suspend (vm, 100e-3); + vlib_worker_thread_barrier_sync (vm); + } + } + SESSION_TEST ((placeholder_segment_count == 1), "should've received request to map new segment"); SESSION_TEST ((placeholder_accept == 1), |