Skip to content

Commit

Permalink
Add a backup and restore to the DSE Search test
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvoncek committed Dec 7, 2023
1 parent 2039871 commit a491158
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/medusa/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (
DefaultMedusaImageRepository = "k8ssandra"
DefaultMedusaImageName = "medusa"
// DefaultMedusaVersion pins to an unreleased version to be compatible. will revert back to a release version once we have it
DefaultMedusaVersion = "2e5723d-tmp"
DefaultMedusaVersion = "75d7873-tmp"
DefaultMedusaPort = 50051
DefaultProbeInitialDelay = 10
DefaultProbeTimeout = 1
Expand Down
15 changes: 15 additions & 0 deletions test/e2e/dse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,21 @@ func createSingleDseSearchDatacenterCluster(t *testing.T, ctx context.Context, n
require.Eventually(t, func() bool {
return testSolrEndpoint(t, solrHostAndPort, username, password)
}, 2*time.Minute, 10*time.Second, "failed to reach solr endpoint")

kc := &api.K8ssandraCluster{}
backupKey := types.NamespacedName{Namespace: namespace, Name: backupName}

checkDatacenterReady(t, ctx, dcKey, f)
checkMedusaContainersExist(t, ctx, namespace, dcKey, f, kc)
createBackupJob(t, ctx, namespace, f, dcKey)
verifyBackupJobFinished(t, ctx, f, dcKey, backupKey)
restoreBackupJob(t, ctx, namespace, f, dcKey)
verifyRestoreJobFinished(t, ctx, f, dcKey, backupKey)

require.Eventually(t, func() bool {
return testSolrEndpoint(t, solrHostAndPort, username, password)
}, 2*time.Minute, 10*time.Second, "failed to reach solr endpoint")

}

func basicAuth(username, password string) string {
Expand Down
7 changes: 4 additions & 3 deletions test/e2e/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,10 @@ func TestOperator(t *testing.T) {
dse: true,
}))
t.Run("CreateSingleDseSearchDatacenterCluster", e2eTest(ctx, &e2eTestOpts{
testFunc: createSingleDseSearchDatacenterCluster,
fixture: framework.NewTestFixture("single-dc-dse-search", controlPlane),
dse: true,
testFunc: createSingleDseSearchDatacenterCluster,
fixture: framework.NewTestFixture("single-dc-dse-search", controlPlane),
dse: true,
installMinio: true,
}))
t.Run("CreateSingleDseGraphDatacenterCluster", e2eTest(ctx, &e2eTestOpts{
testFunc: createSingleDseGraphDatacenterCluster,
Expand Down
12 changes: 12 additions & 0 deletions test/testdata/fixtures/single-dc-dse-search/k8ssandra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ kind: K8ssandraCluster
metadata:
name: test
spec:
medusa:
containerImage:
tag:
storageProperties:
storageProvider: s3_compatible
bucketName: k8ssandra-medusa
prefix: test
storageSecretRef:
name: medusa-bucket-key
host: minio-service.minio.svc.cluster.local
port: 9000
secure: false
cassandra:
serverVersion: 6.8.26
serverType: dse
Expand Down

0 comments on commit a491158

Please sign in to comment.