Skip to content

Commit

Permalink
feat(cluster_test): test empty --host in SM DB
Browse files Browse the repository at this point in the history
As it is possible that the --host field in SM DB is empty,
we should test that this scenario does not break anything in SM.

Tests scylladb/scylla-enterprise#4692
  • Loading branch information
Michal-Leszczynski authored and karol-kokoszka committed Sep 11, 2024
1 parent f0faa48 commit 4ef2a82
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pkg/service/cluster/service_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package cluster_test

import (
"context"
"fmt"
"net"
"os"
"strconv"
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 4ef2a82

Please sign in to comment.