orion/openwrt/dhcp_client_test.go

13 lines
337 B
Go
Raw Normal View History

2018-09-20 10:59:11 +02:00
package openwrt
import "testing"
func TestDhcpClientAskForIP(t *testing.T) {
2018-10-17 15:54:48 +02:00
uexec := createMockExecutor("udhcpc: ifconfig wlan1 192.168.42.20 netmask 255.255.255.0 broadcast +", "", 0)
2018-09-20 10:59:11 +02:00
dhc := NewDhcpClientWithExecutor("wlan1", uexec)
res := dhc.AskForIP()
if res.CmdRes.ReturnCode != 0 {
2018-09-20 10:59:11 +02:00
t.Error("Error in DHCP Client !!")
}
}