Skip to content

Commit

Permalink
sysutil: fix linux tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Dec 7, 2020
1 parent 91202d6 commit 0dc19dd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/sysutil/net_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,18 @@ func TestIfacesStaticConfig(t *testing.T) {
}

func TestSetStaticIPdhcpcdConf(t *testing.T) {
dhcpcdConf := `interface wlan0` + nl +
dhcpcdConf := nl + `interface wlan0` + nl +
`static ip_address=192.168.0.2/24` + nl +
`static routers=192.168.0.1` + nl +
`static domain_name_servers=192.168.0.2` + nl
`static domain_name_servers=192.168.0.2` + nl + nl

s := updateStaticIPdhcpcdConf("wlan0", "192.168.0.2/24", "192.168.0.1", "192.168.0.2")
assert.Equal(t, dhcpcdConf, s)

// without gateway
dhcpcdConf = `interface wlan0` + nl +
dhcpcdConf = nl + `interface wlan0` + nl +
`static ip_address=192.168.0.2/24` + nl +
`static domain_name_servers=192.168.0.2` + nl
`static domain_name_servers=192.168.0.2` + nl + nl

s = updateStaticIPdhcpcdConf("wlan0", "192.168.0.2/24", "", "192.168.0.2")
assert.Equal(t, dhcpcdConf, s)
Expand Down

0 comments on commit 0dc19dd

Please sign in to comment.