13 lines
334 B
Go
13 lines
334 B
Go
package owrt
|
|
|
|
import "testing"
|
|
|
|
func TestDhcpClientAskForIP(t *testing.T) {
|
|
uexec := createMockExecutor("udhcpc: ifconfig wlan1 192.168.42.20 netmask 255.255.255.0 broadcast +", "", 0)
|
|
dhc := NewDhcpClientWithExecutor("wlan1", uexec)
|
|
res := dhc.AskForIP()
|
|
if res.CmdRes.ReturnCode != 0 {
|
|
t.Error("Error in DHCP Client !!")
|
|
}
|
|
}
|