package collector_go import ( "encoding/json" "fmt" "io/ioutil" conf "loafle.com/overflow/crawler_go/config" "log" "testing" "time" ) func TestCallGet(t *testing.T) { c := Collector{} c.Start() time.Sleep(time.Second * 10) //log.Println("add sensor") //c.AddSensor("/network/smb/t2.conf") //time.Sleep(time.Second * 3) log.Println("update sensor") c.UpdateSensor(newConf()) time.Sleep(time.Second * 30) } func newConf() *conf.Config { bytes, err := ioutil.ReadFile("/config/container/network/smb/smb2.conf") if err != nil { fmt.Println(err) return nil } conf := conf.Config{} json.Unmarshal(bytes, &conf) return &conf }