From 8b8f55d573c612bca85195fc1f4447a118ffce0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=80=9D=E6=95=8F?= Date: Fri, 26 Aug 2022 16:53:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config_test.go | 5 +++++ main.go | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config_test.go b/config_test.go index 155fa44..d33a83e 100644 --- a/config_test.go +++ b/config_test.go @@ -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) { + +} diff --git a/main.go b/main.go index d722992..bef35ea 100644 --- a/main.go +++ b/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) } }