container_network/crawler/health/ssh/SSHHealthCrawler_test.go

34 lines
731 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{
2018-07-05 08:33:10 +00:00
MetaIPTypeKey: "V4",
IP: "192.168.1.103",
MetaPortTypeKey: "TCP",
Port: "22",
2018-04-19 15:46:38 +00:00
}
2018-07-04 12:28:28 +00:00
metaCollectionItem := &meta.MetaCollectionItem{
2018-07-05 08:33:10 +00:00
Key: "ssh.response_time",
2018-07-04 12:28:28 +00:00
}
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)
}