tests/net: Fix ethernet mgmt mac change test

The test checked if the change was reported as successful and it always
was.  What needs to be done is comparing whether the mac address was
actually changed to the requested one.

This commit adds this check.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
This commit is contained in:
Tomasz Gorochowik 2018-05-16 14:25:26 +02:00 committed by Jukka Rissanen
parent 05148610a4
commit e2db76c9cc

View File

@ -163,6 +163,11 @@ static void test_change_mac_when_down(void)
ret = net_mgmt(NET_REQUEST_ETHERNET_SET_MAC_ADDRESS, iface,
&params, sizeof(struct ethernet_req_params));
zassert_equal(ret, 0, "unable to change mac address\n");
ret = memcmp(net_if_get_link_addr(iface)->addr, mac_addr_change,
sizeof(mac_addr_change));
zassert_equal(ret, 0, "invalid mac address change\n");
net_if_up(iface);