This commit is contained in:
黄思敏 2022-08-26 16:53:05 +08:00
parent 139a26705a
commit 8b8f55d573
2 changed files with 8 additions and 1 deletions

View File

@ -14,6 +14,7 @@ func TestConfig(t *testing.T) {
if err != nil {
log.Panic(err)
}
dec := yaml.NewDecoder(f)
err = dec.Decode(cnf)
if err != nil {
@ -21,3 +22,7 @@ func TestConfig(t *testing.T) {
}
t.Error(cnf)
}
func TestCase1(t *testing.T) {
}

View File

@ -25,7 +25,7 @@ func testmain() {
var a chan bool = make(chan bool)
go func() {
<-a
cmdstr := fmt.Sprintf("ip addr add %s dev stun", config.Network.Self.Virt)
cmdstr := fmt.Sprintf("ip addr add %s dev stun", "10.10.10.111")
log.Println(cmdstr)
cmd := strings.Split(cmdstr, " ")
err := exec.Command(cmd[0], cmd[1:]...).Run()
@ -64,5 +64,7 @@ func testmain() {
log.Printf("Src: %s %s\n", waterutil.IPv4Source(frame), frame.Source())
log.Printf("Ethertype: % x\n", frame.Ethertype())
// log.Printf("Payload: % x\n", frame.Payload())
ifce.Write(frame)
}
}