diff --git a/pkg/service/cluster/service_integration_test.go b/pkg/service/cluster/service_integration_test.go index 497111acc..e70c6f18e 100644 --- a/pkg/service/cluster/service_integration_test.go +++ b/pkg/service/cluster/service_integration_test.go @@ -7,6 +7,7 @@ package cluster_test import ( "context" + "fmt" "net" "os" "strconv" @@ -580,6 +581,28 @@ func TestServiceStorageIntegration(t *testing.T) { } }) + t.Run("no --host in SM DB", func(t *testing.T) { + setup(t) + c := validCluster() + if err := s.PutCluster(ctx, c); err != nil { + t.Fatal(err) + } + + if err := session.Query(fmt.Sprintf("UPDATE cluster SET host = '' WHERE id = %s", c.ID), nil).ExecRelease(); err != nil { + t.Fatalf("remove --host from SM DB: %s", err) + } + + client, err := s.CreateClientNoCache(context.Background(), c.ID) + if err != nil { + t.Fatal(err) + } + for _, h := range ManagedClusterHosts() { + if _, err := client.HostRack(ctx, h); err != nil { + t.Fatalf("test client by getting rack of host %s: %s", h, err) + } + } + }) + t.Run("list nodes", func(t *testing.T) { setup(t)