From f70225355f7065a0917606fd036fc689a965b8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Leszczy=C5=84ski?= <2000michal@wp.pl> Date: Wed, 22 May 2024 15:37:31 +0200 Subject: [PATCH] fix(scyllaclient_test): don't assume system_auth exists Starting with Scylla 6.0, system_auth is moved to system/system_auth_v2 and is handled by raft. New clusters won't have the old system_auth tables. --- .../client_scylla_integration_test.go | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkg/scyllaclient/client_scylla_integration_test.go b/pkg/scyllaclient/client_scylla_integration_test.go index e8a9fad47a..2931acfc60 100644 --- a/pkg/scyllaclient/client_scylla_integration_test.go +++ b/pkg/scyllaclient/client_scylla_integration_test.go @@ -199,9 +199,11 @@ func TestClientSnapshotIntegration(t *testing.T) { ctx := context.Background() host := ManagedClusterHost() tag := "sm_" + timeutc.Now().Format("20060102150405") + "UTC" + const ks = "system_schema" + const tab = "tables" Print("When: snapshot is taken") - if err := client.TakeSnapshot(ctx, host, tag, "system_auth"); err != nil { + if err := client.TakeSnapshot(ctx, host, tag, ks); err != nil { t.Fatal(err) } @@ -216,12 +218,12 @@ func TestClientSnapshotIntegration(t *testing.T) { Print("When: snapshot is taken again with the same tag") Print("Then: nothing happens") - if err := client.TakeSnapshot(ctx, host, tag, "system_auth"); err != nil { + if err := client.TakeSnapshot(ctx, host, tag, ks); err != nil { t.Fatal(err) } Print("When: table snapshot is removed") - if err := client.DeleteTableSnapshot(ctx, host, tag, "system_auth", "roles"); err != nil { + if err := client.DeleteTableSnapshot(ctx, host, tag, ks, tab); err != nil { t.Fatal(err) } @@ -232,14 +234,14 @@ func TestClientSnapshotIntegration(t *testing.T) { } var u scyllaclient.Unit for _, u = range units { - if u.Keyspace == "system_auth" { + if u.Keyspace == ks { break } } if u.Keyspace == "" { t.Fatal("missing snapshot") } - if slice.ContainsString(u.Tables, "roles") { + if slice.ContainsString(u.Tables, tab) { t.Fatal("table snapshot not deleted") } @@ -259,6 +261,8 @@ func TestClientSnapshotIntegration(t *testing.T) { } func TestClientTableExistsIntegration(t *testing.T) { + const ks = "system_schema" + const tab = "tables" table := []struct { Name string Keyspace string @@ -267,13 +271,13 @@ func TestClientTableExistsIntegration(t *testing.T) { }{ { Name: "Valid", - Keyspace: "system_auth", - Table: "roles", + Keyspace: ks, + Table: tab, Exists: true, }, { Name: "No table", - Keyspace: "system_auth", + Keyspace: ks, Table: "aaa", Exists: false, },