test: Rename interfaces defined in virtual networks test
This work is similar to one performed for ./net/ptp/clock/ test. However, there is one notable extension - the check in iface_cb() callback also checks for virtual interfaces defined in subsys/net/l2/virtual/ipip/ipip.c. Those 'virtual' interfaces are required for this test to be run. Signed-off-by: Lukasz Majewski <lukma@denx.de>
This commit is contained in:
parent
d1b6a80191
commit
b9f5ba2730
1 changed files with 15 additions and 2 deletions
|
@ -247,7 +247,7 @@ static struct dummy_api net_iface_api = {
|
|||
/* For testing purposes, create two dummy network interfaces so we can check
|
||||
* that attaching virtual interface work ok.
|
||||
*/
|
||||
NET_DEVICE_INIT_INSTANCE(net_iface1_test,
|
||||
NET_DEVICE_INIT_INSTANCE(eth_test_dummy1,
|
||||
"iface1",
|
||||
iface1,
|
||||
net_iface_dev_init,
|
||||
|
@ -260,7 +260,7 @@ NET_DEVICE_INIT_INSTANCE(net_iface1_test,
|
|||
NET_L2_GET_CTX_TYPE(DUMMY_L2),
|
||||
127);
|
||||
|
||||
NET_DEVICE_INIT_INSTANCE(net_iface2_test,
|
||||
NET_DEVICE_INIT_INSTANCE(eth_test_dummy2,
|
||||
"iface2",
|
||||
iface2,
|
||||
net_iface_dev_init,
|
||||
|
@ -304,6 +304,19 @@ static void iface_cb(struct net_if *iface, void *user_data)
|
|||
struct user_data *ud = user_data;
|
||||
static int starting_eth_idx = 1;
|
||||
|
||||
/*
|
||||
* The below code is to only use struct net_if devices defined in this
|
||||
* test as board on which it is run can have its own set of interfaces.
|
||||
*
|
||||
* As a result one will not rely on linker's specific 'net_if_area'
|
||||
* placement.
|
||||
*/
|
||||
if ((iface != net_if_lookup_by_dev(DEVICE_GET(eth_test_dummy1))) &&
|
||||
(iface != net_if_lookup_by_dev(DEVICE_GET(eth_test_dummy2))) &&
|
||||
(iface != net_if_lookup_by_dev(DEVICE_GET(eth_test))) &&
|
||||
(net_if_l2(iface) != &NET_L2_GET_NAME(VIRTUAL)))
|
||||
return;
|
||||
|
||||
DBG("Interface %p (%s) [%d]\n", iface, iface2str(iface),
|
||||
net_if_get_by_iface(iface));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue