test_dhcp: set link up on net_test netif

DHCP test code didn't set link up on net_test netif (exposed by changes
in 637bce91b4)

Then during the test_dhcp function, a Gratuitous ARP was not sent during
the call to dhcp_bind() because the link was still down

The sets the link state for all DHCP test functions
This commit is contained in:
Joel Cunningham 2017-11-08 14:42:28 -06:00
parent 637bce91b4
commit 1147b9ce38

View File

@ -448,6 +448,7 @@ START_TEST(test_dhcp)
IP4_ADDR(&gw, 0, 0, 0, 0);
netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input);
netif_set_link_up(&net_test);
netif_set_up(&net_test);
dhcp_start(&net_test);
@ -520,6 +521,7 @@ START_TEST(test_dhcp_nak)
IP4_ADDR(&gw, 0, 0, 0, 0);
netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input);
netif_set_link_up(&net_test);
netif_set_up(&net_test);
dhcp_start(&net_test);
@ -741,6 +743,7 @@ START_TEST(test_dhcp_relayed)
IP4_ADDR(&gw, 0, 0, 0, 0);
netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input);
netif_set_link_up(&net_test);
netif_set_up(&net_test);
dhcp_start(&net_test);
@ -882,6 +885,7 @@ START_TEST(test_dhcp_nak_no_endmarker)
IP4_ADDR(&gw, 0, 0, 0, 0);
netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input);
netif_set_link_up(&net_test);
netif_set_up(&net_test);
dhcp_start(&net_test);
@ -981,6 +985,7 @@ START_TEST(test_dhcp_invalid_overload)
IP4_ADDR(&gw, 0, 0, 0, 0);
netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input);
netif_set_link_up(&net_test);
netif_set_up(&net_test);
dhcp_start(&net_test);