container_network/crawler/health/ssh/SSHHealthCrawler_test.go
2018-07-05 17:33:10 +09:00

34 lines
731 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.103",
MetaPortTypeKey: "TCP",
Port: "22",
}
metaCollectionItem := &meta.MetaCollectionItem{
Key: "ssh.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)
}