Skip to content

Commit 18e0e01

Browse files
authored
test: modify cbt tests (#1863)
Remove vanilla and rancher failover failback tests since they use older way of clusterpair creation and are not good candidate for CBTs. Replaced them with DR tests and also add clone test.
1 parent 8c300a4 commit 18e0e01

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

test/integration_test/common_test.go

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,35 @@ func TestSnapshot(t *testing.T) {
195195
}
196196

197197
func TestStorkCbt(t *testing.T) {
198+
// reset mock time before running any tests
199+
err := setMockTime(nil)
200+
log.FailOnError(t, err, "Error resetting mock time")
201+
currentTestSuite = t.Name()
202+
203+
err = setSourceKubeConfig()
204+
log.FailOnError(t, err, "failed to set kubeconfig to source cluster: %v", err)
205+
206+
log.InfoD("Using stork volume driver: %s", volumeDriverName)
207+
log.InfoD("Backup path being used: %s", backupLocationPath)
208+
setDefaultsForBackup(t)
209+
210+
// get the destination kubeconfig from configmap in source cluster so that it can be passed to storkctl commands
211+
// since both the dr cli commands run in destination cluster
212+
destinationKubeConfigPath, err = getDestinationKubeConfigFile()
213+
log.FailOnError(t, err, "Error getting destination kubeconfig file")
214+
215+
// Get the source kubeconfig from configmap.
216+
srcKubeConfigPath, err = getSourceKubeConfigFile()
217+
log.FailOnError(t, err, "Error getting source kubeconfig file")
218+
198219
t.Run("deploymentTest", deploymentMigrationTest)
199220
t.Run("dataExportTest", TestDataExportRsync)
200-
t.Run("testMigrationFailoverFailback", testMigrationFailoverFailback)
221+
t.Run("testDRActionFailbackIntervalScheduleTest", testDRActionFailbackIntervalScheduleTest)
201222
t.Run("stopDriverTest", stopDriverTest)
202223
t.Run("simpleSnapshotTest", simpleSnapshotTest)
203224
t.Run("pvcOwnershipTest", pvcOwnershipTest)
204225
t.Run("cmdExecutorTest", cmdExecutorTest)
226+
t.Run("statefulsetTest", statefulsetApplicationCloneTest)
205227
}
206228

207229
func TestStorkCbtBackup(t *testing.T) {

test/integration_test/migration_dr_actions_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ func TestDRActions(t *testing.T) {
4242
log.FailOnError(t, err, "Error getting destination kubeconfig file")
4343

4444
// Get the source kubeconfig from configmap.
45-
srcKubeConfigPath, err = getDestinationKubeConfigFile()
46-
log.FailOnError(t, err, "Error getting destination kubeconfig file")
45+
srcKubeConfigPath, err = getSourceKubeConfigFile()
46+
log.FailOnError(t, err, "Error getting source kubeconfig file")
4747

4848
t.Run("testSyncDR", testSyncDR)
4949
t.Run("testAsyncDR", testAsyncDR)

0 commit comments

Comments
 (0)