fix darwin test build

This commit is contained in:
Song Gao 2018-03-01 14:23:49 -08:00
parent 75f112d19d
commit 8bbc3c8191
2 changed files with 1 additions and 1 deletions

24
ipv4_unix_test.go Normal file
View file

@ -0,0 +1,24 @@
// +build linux darwin
package water
import (
"net"
"os/exec"
"testing"
)
func startBroadcast(t *testing.T, dst net.IP) {
if err := exec.Command("ping", "-b", "-c", "2", dst.String()).Start(); err != nil {
t.Fatal(err)
}
}
func setupIfce(t *testing.T, ipNet net.IPNet, dev string) {
if err := exec.Command("ip", "link", "set", dev, "up").Run(); err != nil {
t.Fatal(err)
}
if err := exec.Command("ip", "addr", "add", ipNet.String(), "dev", dev).Run(); err != nil {
t.Fatal(err)
}
}