service_matcher-go/mysql/mysql_test.go

29 lines
406 B
Go
Raw Normal View History

2018-08-13 07:48:32 +00:00
package mysql
import (
"net"
"testing"
2018-08-15 07:17:18 +00:00
osm "git.loafle.net/overflow/service_matcher-go"
2018-08-13 07:48:32 +00:00
)
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)
2018-08-15 07:17:18 +00:00
p := osm.NewPacket(bytes, n)
2018-08-13 07:48:32 +00:00
if err := m.Match(nil, 0, p); err != nil {
t.Error(err)
}
t.Log(m.Name())
t.Log(m.Meta())
}