mirror of
https://github.com/rtr7/router7.git
synced 2024-05-06 15:54:52 +00:00
dhcpv4: replace hard-coded midna → os.Hostname()
This commit is contained in:
@ -144,17 +144,21 @@ func TestDHCPv4(t *testing.T) {
|
||||
|
||||
dnsmasq.Kill() // to flush logs
|
||||
got := dnsmasq.Actions()
|
||||
hostname, err := os.Hostname()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
want := []string{
|
||||
"DHCPDISCOVER(veth0b) 02:73:53:00:ca:fe",
|
||||
"DHCPOFFER(veth0b) 192.168.23.4 02:73:53:00:ca:fe",
|
||||
"DHCPREQUEST(veth0b) 192.168.23.4 02:73:53:00:ca:fe",
|
||||
"DHCPACK(veth0b) 192.168.23.4 02:73:53:00:ca:fe midna",
|
||||
"DHCPACK(veth0b) 192.168.23.4 02:73:53:00:ca:fe " + hostname,
|
||||
|
||||
"DHCPREQUEST(veth0b) 192.168.23.4 02:73:53:00:ca:fe",
|
||||
"DHCPACK(veth0b) 192.168.23.4 02:73:53:00:ca:fe midna",
|
||||
"DHCPACK(veth0b) 192.168.23.4 02:73:53:00:ca:fe " + hostname,
|
||||
|
||||
"DHCPREQUEST(veth0b) 192.168.23.4 02:73:53:00:ca:fe",
|
||||
"DHCPACK(veth0b) 192.168.23.4 02:73:53:00:ca:fe midna",
|
||||
"DHCPACK(veth0b) 192.168.23.4 02:73:53:00:ca:fe " + hostname,
|
||||
|
||||
"DHCPRELEASE(veth0b) 192.168.23.4 02:73:53:00:ca:fe",
|
||||
}
|
||||
|
Reference in New Issue
Block a user