aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-07-13 08:52:53 -0700
committerFlorin Coras <fcoras@cisco.com>2020-07-13 08:57:35 -0700
commit47cb248424b4eab20a6b3cf8768f62ee3f8f0273 (patch)
tree12e3ba49248fb1aaa50918a1dc037d6d813ee464 /src
parent52e9aaf0b55e7742a39d75e5dffb813a3b0c011d (diff)
session: reduce verbosity on fifo alloc failure
Also fix session test app name registrations Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7d365154ab9af83b17b026762ab4f0aea85ce486
Diffstat (limited to 'src')
-rw-r--r--src/plugins/unittest/session_test.c17
-rw-r--r--src/vnet/session/segment_manager.c2
2 files changed, 15 insertions, 4 deletions
diff --git a/src/plugins/unittest/session_test.c b/src/plugins/unittest/session_test.c
index b48a961bf59..72292613abd 100644
--- a/src/plugins/unittest/session_test.c
+++ b/src/plugins/unittest/session_test.c
@@ -429,13 +429,17 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
session_endpoint_t server_sep = SESSION_ENDPOINT_NULL;
session_endpoint_t client_sep = SESSION_ENDPOINT_NULL;
session_endpoint_t intf_sep = SESSION_ENDPOINT_NULL;
- u8 *ns_id = format (0, "appns1");
+ u8 *ns_id, *server_name, *client_name;
app_namespace_t *app_ns;
application_t *server;
session_t *s;
u64 handle;
int error = 0;
+ ns_id = format (0, "appns1");
+ server_name = format (0, "session_test");
+ client_name = format (0, "session_test_client");
+
server_sep.is_ip4 = 1;
server_sep.port = dummy_port;
client_sep.is_ip4 = 1;
@@ -448,7 +452,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
.options = options,
.namespace_id = 0,
.session_cb_vft = &dummy_session_cbs,
- .name = format (0, "session_test"),
+ .name = server_name,
};
vnet_listen_args_t bind_args = {
@@ -588,6 +592,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
* Try client connect with 1) local scope 2) global scope
*/
options[APP_OPTIONS_FLAGS] &= ~APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
+ attach_args.name = client_name;
attach_args.api_client_index = dummy_client_api_index;
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "client attachment should work");
@@ -641,6 +646,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
options[APP_OPTIONS_FLAGS] &= ~APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
attach_args.api_client_index = dummy_server_api_index;
+ attach_args.name = server_name;
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "app attachment should work");
server_index = attach_args.app_index;
@@ -675,6 +681,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
attach_args.namespace_id = 0;
attach_args.api_client_index = dummy_client_api_index;
+ attach_args.name = client_name;
vnet_application_attach (&attach_args);
error = vnet_connect (&connect_args);
SESSION_TEST ((error != 0), "client connect should return error code");
@@ -709,6 +716,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
options[APP_OPTIONS_NAMESPACE_SECRET] = dummy_secret;
attach_args.namespace_id = ns_id;
attach_args.api_client_index = dummy_server_api_index;
+ attach_args.name = server_name;
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "server attachment should work");
server_index = attach_args.app_index;
@@ -735,7 +743,8 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
/*
* Cleanup
*/
- vec_free (attach_args.name);
+ vec_free (server_name);
+ vec_free (client_name);
vec_free (ns_id);
session_delete_loopback (sw_if_index);
return 0;
@@ -1490,6 +1499,8 @@ session_test_rules (vlib_main_t * vm, unformat_input_t * input)
attach_args.namespace_id = ns_id;
attach_args.api_client_index = dummy_server_api_index;
+ vec_free (attach_args.name);
+ attach_args.name = format (0, "server_test2");
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "server2 attached");
server_index2 = attach_args.app_index;
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c
index caaf67f8915..dbeff6e4acf 100644
--- a/src/vnet/session/segment_manager.c
+++ b/src/vnet/session/segment_manager.c
@@ -720,7 +720,7 @@ alloc_check:
}
else
{
- clib_warning ("Can't add new seg and no space to allocate fifos!");
+ SESSION_DBG ("Can't add new seg and no space to allocate fifos!");
return SESSION_E_SEG_NO_SPACE;
}
}