测试
This commit is contained in:
parent
139a26705a
commit
8b8f55d573
|
@ -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) {
|
||||
|
||||
}
|
||||
|
|
4
main.go
4
main.go
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user