container_network/crawler/health/ssh/SSHHealthCrawler_test.go

35 lines
778 B
Go
Raw Normal View History

2018-04-19 15:46:38 +00:00
package ssh
import (
"testing"
2018-07-04 12:28:28 +00:00
"git.loafle.net/overflow/commons-go/model/meta"
2018-04-26 08:50:26 +00:00
ocmsc "git.loafle.net/overflow/commons-go/model/sensorconfig"
2018-04-19 15:46:38 +00:00
"github.com/stretchr/testify/assert"
)
func TestMatch(t *testing.T) {
2018-04-26 08:50:26 +00:00
config := &ocmsc.SensorConfig{}
2018-07-04 12:28:28 +00:00
config.Connection = &ocmsc.SensorConfigConnection{
MetaIPTypeKey: "V4",
IP: "192.168.1.103",
MetaPortTypeKey: "TCP",
Port: "22",
MetaCryptoTypeKey: "SSL",
2018-04-19 15:46:38 +00:00
}
2018-07-04 12:28:28 +00:00
metaCollectionItem := &meta.MetaCollectionItem{
Key: "service.health.response_time",
}
config.MetaCollectionItems = make([]*meta.MetaCollectionItem, 1)
config.MetaCollectionItems[0] = metaCollectionItem
2018-04-19 15:46:38 +00:00
c := NewCrawler()
rss, err := c.Get(config)
2018-07-04 12:28:28 +00:00
if err != nil {
t.Log(err.Error())
}
2018-04-19 15:46:38 +00:00
assert.NotNil(t, rss)
}