aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/unittest/session_test.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-10-21 16:07:46 -0700
committerDave Barach <openvpp@barachs.net>2020-04-03 22:10:22 +0000
commit00e01d3e875bb18397ff81e0f58f9b468477f473 (patch)
tree277b9ce692a465644de5d3481b42e6cce6394f46 /src/plugins/unittest/session_test.c
parent39aa7a5202a6a875bd6f5d341cb07f19ab0bf51e (diff)
session: improve error reporting
Type: improvement Change-Id: I9dd850a1ce85b0adb5136233f176117e0ee38817 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/plugins/unittest/session_test.c')
-rw-r--r--src/plugins/unittest/session_test.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/plugins/unittest/session_test.c b/src/plugins/unittest/session_test.c
index 8d5566feb46..9368f9f80f7 100644
--- a/src/plugins/unittest/session_test.c
+++ b/src/plugins/unittest/session_test.c
@@ -54,7 +54,7 @@ volatile u32 connected_session_index = ~0;
volatile u32 connected_session_thread = ~0;
int
dummy_session_connected_callback (u32 app_index, u32 api_context,
- session_t * s, u8 is_fail)
+ session_t * s, session_error_t err)
{
if (s)
{
@@ -596,7 +596,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
connect_args.app_index = client_index;
error = vnet_connect (&connect_args);
SESSION_TEST ((error != 0), "client connect should return error code");
- SESSION_TEST ((error == VNET_API_ERROR_INVALID_VALUE),
+ SESSION_TEST ((error == SESSION_E_INVALID_RMT_IP),
"error code should be invalid value (zero ip)");
SESSION_TEST ((dummy_segment_count == 0),
"shouldn't have received request to map new segment");
@@ -678,8 +678,8 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
vnet_application_attach (&attach_args);
error = vnet_connect (&connect_args);
SESSION_TEST ((error != 0), "client connect should return error code");
- SESSION_TEST ((error == VNET_API_ERROR_SESSION_CONNECT),
- "error code should be connect (not in same ns)");
+ SESSION_TEST ((error == SESSION_E_NOROUTE),
+ "error code should be noroute (not in same ns)");
detach_args.app_index = client_index;
vnet_application_detach (&detach_args);
@@ -1255,8 +1255,7 @@ session_test_rules (vlib_main_t * vm, unformat_input_t * input)
/* Try connecting */
error = vnet_connect (&connect_args);
SESSION_TEST ((error != 0), "connect should fail");
- SESSION_TEST ((error == VNET_API_ERROR_APP_CONNECT_FILTERED),
- "connect should be filtered");
+ SESSION_TEST ((error == SESSION_E_FILTERED), "connect should be filtered");
sep.ip.ip4.as_u32 -= 1 << 24;
@@ -1529,8 +1528,7 @@ session_test_rules (vlib_main_t * vm, unformat_input_t * input)
error = vnet_connect (&connect_args);
SESSION_TEST ((error != 0), "connect should fail");
- SESSION_TEST ((error == VNET_API_ERROR_APP_CONNECT_FILTERED),
- "connect should be filtered");
+ SESSION_TEST ((error == SESSION_E_FILTERED), "connect should be filtered");
/*
* Lookup test namespace
@@ -1542,8 +1540,7 @@ session_test_rules (vlib_main_t * vm, unformat_input_t * input)
connect_args.app_index = server_index;
error = vnet_connect (&connect_args);
SESSION_TEST ((error != 0), "connect should fail");
- SESSION_TEST ((error == VNET_API_ERROR_APP_CONNECT_FILTERED),
- "connect should be filtered");
+ SESSION_TEST ((error == SESSION_E_FILTERED), "connect should be filtered");
args.table_args.is_add = 0;
vnet_session_rule_add_del (&args);