service_matcher-go/mysql/mysql_test.go
2018-08-15 16:17:18 +09:00

29 lines
406 B
Go

package mysql
import (
"net"
"testing"
osm "git.loafle.net/overflow/service_matcher-go"
)
func TestMySql(t *testing.T) {
m := NewMatcher()
conn, _ := net.Dial("tcp", "192.168.1.201:23306")
defer conn.Close()
bytes := make([]byte, 1024)
n, _ := conn.Read(bytes)
p := osm.NewPacket(bytes, n)
if err := m.Match(nil, 0, p); err != nil {
t.Error(err)
}
t.Log(m.Name())
t.Log(m.Meta())
}