mirror of
https://github.com/fumiama/water.git
synced 2026-06-16 00:15:51 +08:00
fix darwin test build
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
// +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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user