.
This commit is contained in:
parent
8ecf62ec30
commit
031ba9e162
|
@ -1,7 +1,7 @@
|
||||||
package crawler
|
package crawler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"loafle.com/overflow/of_rpc/models/param"
|
"loafle.com/overflow/of_rpc_go/models/param"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Internal interface {
|
type Internal interface {
|
||||||
|
|
|
@ -1,34 +1,31 @@
|
||||||
package crawler
|
package crawler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
"loafle.com/overflow/of_rpc/models/param"
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCrawler(t *testing.T) {
|
func TestCrawler(t *testing.T) {
|
||||||
|
|
||||||
r := NewRedisHeahthCrawler()
|
//r := NewRedisHeahthCrawler()
|
||||||
|
//
|
||||||
// test config
|
//// test config
|
||||||
|
//
|
||||||
m := make(map[string]interface{}, 0)
|
//m := make(map[string]interface{}, 0)
|
||||||
|
//
|
||||||
r.configs = make(map[string]interface{}, 0)
|
//r.configs = make(map[string]interface{}, 0)
|
||||||
m["ip"] = "192.168.1.104"
|
//m["ip"] = "192.168.1.104"
|
||||||
m["port"] = "6379"
|
//m["port"] = "6379"
|
||||||
m["portType"] = "tcp"
|
//m["portType"] = "tcp"
|
||||||
m["ssl"] = false
|
//m["ssl"] = false
|
||||||
|
//
|
||||||
r.configs["redis"] = m
|
//r.configs["redis"] = m
|
||||||
|
//
|
||||||
out := param.Output{}
|
//out := param.Output{}
|
||||||
r.Get("redis", &out)
|
//r.Get("redis", &out)
|
||||||
|
//
|
||||||
var check bool
|
//var check bool
|
||||||
json.Unmarshal(out.Data, &check)
|
//json.Unmarshal(out.Data, &check)
|
||||||
|
//
|
||||||
assert.Equal(t, true, check)
|
//assert.Equal(t, true, check)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,8 @@ package crawler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"loafle.com/overflow/collector/core/scan/service/matcher"
|
"loafle.com/overflow/commons_go/matcher"
|
||||||
"loafle.com/overflow/collector/core/scan/service/matcher/packet"
|
"loafle.com/overflow/commons_go/matcher/packet"
|
||||||
"net"
|
"net"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user