Source VRF Select tests
Change-Id: Id6c16462fccf890eaa0e526ad048e032c9da8800 Signed-off-by: Neale Ranns <nranns@cisco.com>
This commit is contained in:

committed by
Damjan Marion

parent
f9faf2420c
commit
ccc70f6c6e
@ -37,10 +37,16 @@ svs_table_add (fib_protocol_t fproto, u32 table_id)
|
||||
int
|
||||
svs_table_delete (fib_protocol_t fproto, u32 table_id)
|
||||
{
|
||||
u32 fib_index;
|
||||
u32 fib_index, ii;
|
||||
|
||||
fib_index = fib_table_find (fproto, table_id);
|
||||
|
||||
vec_foreach_index (ii, svs_itf_db[fproto])
|
||||
{
|
||||
if (svs_itf_db[fproto][ii] == fib_index)
|
||||
return VNET_API_ERROR_INSTANCE_IN_USE;
|
||||
}
|
||||
|
||||
if (~0 == fib_index)
|
||||
return VNET_API_ERROR_NO_SUCH_FIB;
|
||||
|
||||
@ -193,7 +199,7 @@ svs_disable (fib_protocol_t fproto, u32 table_id, u32 sw_if_index)
|
||||
if (~0 == fib_index)
|
||||
return VNET_API_ERROR_NO_SUCH_FIB;
|
||||
|
||||
if (sw_if_index <= vec_len (svs_itf_db[fproto]))
|
||||
if (sw_if_index >= vec_len (svs_itf_db[fproto]))
|
||||
return VNET_API_ERROR_INVALID_SW_IF_INDEX;
|
||||
|
||||
svs_itf_db[fproto][sw_if_index] = ~0;
|
||||
|
@ -101,11 +101,11 @@ vl_api_svs_table_add_del_t_handler (vl_api_svs_table_add_del_t * mp)
|
||||
|
||||
if (mp->is_add)
|
||||
{
|
||||
svs_table_add (fproto, ntohl (mp->table_id));
|
||||
rv = svs_table_add (fproto, ntohl (mp->table_id));
|
||||
}
|
||||
else
|
||||
{
|
||||
svs_table_delete (fproto, ntohl (mp->table_id));
|
||||
rv = svs_table_delete (fproto, ntohl (mp->table_id));
|
||||
}
|
||||
|
||||
REPLY_MACRO (VL_API_SVS_TABLE_ADD_DEL_REPLY + svs_base_msg_id);
|
||||
@ -122,8 +122,7 @@ vl_api_svs_route_add_del_t_handler (vl_api_svs_route_add_del_t * mp)
|
||||
|
||||
if (mp->is_add)
|
||||
{
|
||||
rv =
|
||||
svs_route_add (ntohl (mp->table_id), &pfx,
|
||||
rv = svs_route_add (ntohl (mp->table_id), &pfx,
|
||||
ntohl (mp->source_table_id));
|
||||
}
|
||||
else
|
||||
@ -147,10 +146,11 @@ vl_api_svs_enable_disable_t_handler (vl_api_svs_enable_disable_t * mp)
|
||||
|
||||
if (mp->is_enable)
|
||||
{
|
||||
svs_enable (fproto, ntohl (mp->table_id), ntohl (mp->sw_if_index));
|
||||
rv = svs_enable (fproto, ntohl (mp->table_id), ntohl (mp->sw_if_index));
|
||||
}
|
||||
else
|
||||
{
|
||||
rv =
|
||||
svs_disable (fproto, ntohl (mp->table_id), ntohl (mp->sw_if_index));
|
||||
}
|
||||
|
||||
|
304
test/test_svs.py
Normal file
304
test/test_svs.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user