2017-07-15 21:15:59 +00:00
|
|
|
package agent
|
|
|
|
|
|
|
|
import (
|
|
|
|
"reflect"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
discover "github.com/hashicorp/go-discover"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestGoDiscoverRegistration(t *testing.T) {
|
2018-05-04 19:11:12 +00:00
|
|
|
d, err := discover.New()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2017-08-02 15:59:47 +00:00
|
|
|
got := d.Names()
|
2018-05-10 23:04:40 +00:00
|
|
|
want := []string{"aliyun", "aws", "azure", "digitalocean", "gce", "os", "scaleway", "softlayer", "triton"}
|
2017-07-15 21:15:59 +00:00
|
|
|
if !reflect.DeepEqual(got, want) {
|
|
|
|
t.Fatalf("got go-discover providers %v want %v", got, want)
|
|
|
|
}
|
|
|
|
}
|