session: cleanup use of api_client_index
[vpp.git] / src / plugins / unittest / session_test.c
index 182a8e8..c1622d1 100644 (file)
@@ -216,6 +216,7 @@ session_test_basic (vlib_main_t * vm, unformat_input_t * input)
 
   vnet_app_detach_args_t detach_args = {
     .app_index = server_index,
+    .api_client_index = ~0,
   };
   vnet_application_detach (&detach_args);
   return 0;
@@ -393,6 +394,7 @@ session_test_endpoint_cfg (vlib_main_t * vm, unformat_input_t * input)
 
   vnet_app_detach_args_t detach_args = {
     .app_index = server_index,
+    .api_client_index = ~0,
   };
   vnet_application_detach (&detach_args);
   detach_args.app_index = client_index;
@@ -417,7 +419,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
   u64 options[APP_OPTIONS_N_OPTIONS], dummy_secret = 1234;
   u32 server_index, server_st_index, server_local_st_index;
   u32 dummy_port = 1234, client_index, server_wrk_index;
-  u32 dummy_api_context = 4321, dummy_client_api_index = 1234;
+  u32 dummy_api_context = 4321, dummy_client_api_index = ~0;
   u32 dummy_server_api_index = ~0, sw_if_index = 0;
   session_endpoint_t server_sep = SESSION_ENDPOINT_NULL;
   session_endpoint_t client_sep = SESSION_ENDPOINT_NULL;
@@ -463,6 +465,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
 
   vnet_app_detach_args_t detach_args = {
     .app_index = 0,
+    .api_client_index = ~0,
   };
 
   ip4_address_t intf_addr = {
@@ -1490,7 +1493,7 @@ session_test_rules (vlib_main_t * vm, unformat_input_t * input)
   app_ns = app_namespace_get_from_id (ns_id);
 
   attach_args.namespace_id = ns_id;
-  attach_args.api_client_index = dummy_server_api_index - 1;
+  attach_args.api_client_index = dummy_server_api_index;
   error = vnet_application_attach (&attach_args);
   SESSION_TEST ((error == 0), "server2 attached");
   server_index2 = attach_args.app_index;
@@ -1562,6 +1565,7 @@ session_test_rules (vlib_main_t * vm, unformat_input_t * input)
   vec_free (args.table_args.tag);
   vnet_app_detach_args_t detach_args = {
     .app_index = server_index,
+    .api_client_index = ~0,
   };
   vnet_application_detach (&detach_args);
 
@@ -1677,6 +1681,7 @@ session_test_proxy (vlib_main_t * vm, unformat_input_t * input)
 
   vnet_app_detach_args_t detach_args = {
     .app_index = server_index,
+    .api_client_index = ~0,
   };
   vnet_application_detach (&detach_args);