add ipv4 broadcast test

This commit is contained in:
Song Gao 2015-11-08 21:54:47 +00:00
parent ecf657aba3
commit 965ca414a6
3 changed files with 117 additions and 0 deletions

16
ipv4_test_linux.go Normal file
View file

@ -0,0 +1,16 @@
package water
import (
"net"
"os/exec"
"testing"
)
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)
}
}