fixed test

This commit is contained in:
snoop 2017-08-08 18:40:28 +09:00
parent 2e33d4b23c
commit 354f334cc3

View File

@ -1,71 +1,71 @@
package mysql package mysql
//
//import ( import (
// "crypto/tls" "crypto/tls"
// "git.loafle.net/overflow/overflow_probe/collector/core/scan/service/matcher/packet" "git.loafle.net/overflow/overflow_probe/matcher/packet"
// "net" "net"
// "testing" "testing"
//) )
//
//func TestMySql(t *testing.T) { func TestMySql(t *testing.T) {
//
// m := NewMySqlMatcher() m := NewMySqlMatcher()
//
// /* /*
// 192.168.1.103:3306 - normal 192.168.1.103:3306 - normal
// 192.168.1.105:8306 - ssl 192.168.1.105:8306 - ssl
// 192.168.1.203:3306 - mysql with error code 192.168.1.203:3306 - mysql with error code
// */ */
// conn, _ := net.Dial("tcp", "192.168.1.215:3306") conn, _ := net.Dial("tcp", "192.168.1.15:3306")
//
// defer conn.Close() defer conn.Close()
//
// bytes := make([]byte, 1024) bytes := make([]byte, 1024)
// n, _ := conn.Read(bytes) n, _ := conn.Read(bytes)
// p := packet.NewPacket(bytes, n) p := packet.NewPacket(bytes, n)
//
// if m.Match(0, p, nil) { if m.Match(0, p, nil) {
// t.Log(m.ServiceName()) t.Log(m.ServiceName())
// return return
// } }
//
// t.Error("MySQL not found") t.Error("MySQL not found")
//
//} }
//
//func TestCassandraTLS(t *testing.T) { func TestCassandraTLS(t *testing.T) {
//
// m := NewMySqlMatcher() m := NewMySqlMatcher()
//
// conn, err := tls.Dial( conn, err := tls.Dial(
// "tcp", "tcp",
// "192.168.1.105:8306", "192.168.1.105:8306",
// &tls.Config{ &tls.Config{
// InsecureSkipVerify: true, InsecureSkipVerify: true,
// ServerName: "192.168.1.105", ServerName: "192.168.1.105",
// }, },
// ) )
// if err != nil { if err != nil {
// t.Fatal(err) t.Fatal(err)
// } }
//
// defer conn.Close() defer conn.Close()
//
// for i := 0; i < m.PacketCount(); i++ { for i := 0; i < m.PacketCount(); i++ {
//
// pack := m.Packet(i) pack := m.Packet(i)
// conn.Write(pack.Buffer) conn.Write(pack.Buffer)
// bytes := make([]byte, 1024) bytes := make([]byte, 1024)
// n, _ := conn.Read(bytes) n, _ := conn.Read(bytes)
// p := packet.NewPacket(bytes, n) p := packet.NewPacket(bytes, n)
//
// if m.Match(i, p, nil) { if m.Match(i, p, nil) {
// t.Log(m.ServiceName()) t.Log(m.ServiceName())
// return return
// } }
//
// t.Error("MySQL not found") t.Error("MySQL not found")
// } }
//
//} }