This repository has been archived on 2024-08-02. You can view files and clone it, but cannot push or open issues or pull requests.
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()
|
2018-10-10 17:38:04 +02:00
|
|
|
if res.CmdRes.ReturnCode != 0 {
|
2018-09-20 10:59:11 +02:00
|
|
|
t.Error("Error in DHCP Client !!")
|
|
|
|
}
|
|
|
|
}
|