35 lines
778 B
Go
35 lines
778 B
Go
package ssh
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.loafle.net/overflow/commons-go/model/meta"
|
|
ocmsc "git.loafle.net/overflow/commons-go/model/sensorconfig"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestMatch(t *testing.T) {
|
|
config := &ocmsc.SensorConfig{}
|
|
config.Connection = &ocmsc.SensorConfigConnection{
|
|
MetaIPTypeKey: "V4",
|
|
IP: "192.168.1.111",
|
|
MetaPortTypeKey: "TCP",
|
|
Port: "22",
|
|
MetaCryptoTypeKey: "SSL",
|
|
}
|
|
metaCollectionItem := &meta.MetaCollectionItem{
|
|
Key: "service.health.response_time",
|
|
}
|
|
config.MetaCollectionItems = make([]*meta.MetaCollectionItem, 1)
|
|
config.MetaCollectionItems[0] = metaCollectionItem
|
|
|
|
c := NewCrawler()
|
|
rss, err := c.Get(config)
|
|
|
|
if err != nil {
|
|
t.Log(err.Error())
|
|
}
|
|
|
|
assert.NotNil(t, rss)
|
|
}
|