Skip to content

Commit 1505b44

Browse files
Update backup_flex_test.go
1 parent 40a3d10 commit 1505b44

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

test/e2e/atlas/backup_flex_test.go

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func TestFlexBackup(t *testing.T) {
9696

9797
var restoreJobID string
9898

99-
t.Run("Restores Create", func(t *testing.T) {
99+
t.Run("Restores Create - Automated", func(t *testing.T) {
100100
cmd := exec.Command(cliPath,
101101
backupsEntity,
102102
restoresEntity,
@@ -170,6 +170,47 @@ func TestFlexBackup(t *testing.T) {
170170
assert.NotEmpty(t, result)
171171
})
172172

173+
t.Run("Restores Create - Download", func(t *testing.T) {
174+
cmd := exec.Command(cliPath,
175+
backupsEntity,
176+
restoresEntity,
177+
"start",
178+
"download",
179+
"--clusterName",
180+
clusterName,
181+
"--snapshotId",
182+
snapshotID,
183+
"--targetClusterName",
184+
g.clusterName,
185+
"--targetProjectId",
186+
g.projectID,
187+
"-o=json")
188+
cmd.Env = os.Environ()
189+
resp, err := e2e.RunAndGetStdOut(cmd)
190+
191+
require.NoError(t, err, string(resp))
192+
var result atlasv2.FlexBackupRestoreJob20241113
193+
require.NoError(t, json.Unmarshal(resp, &result), string(resp))
194+
restoreJobID = result.GetId()
195+
t.Log("snapshotID", restoreJobID)
196+
require.NotEmpty(t, restoreJobID)
197+
})
198+
199+
t.Run("Restores Watch - Download", func(t *testing.T) {
200+
cmd := exec.Command(cliPath,
201+
backupsEntity,
202+
restoresEntity,
203+
"watch",
204+
restoreJobID,
205+
"--clusterName",
206+
clusterName,
207+
"-o=json")
208+
cmd.Env = os.Environ()
209+
resp, err := e2e.RunAndGetStdOut(cmd)
210+
211+
require.NoError(t, err, string(resp))
212+
})
213+
173214
t.Run("Delete flex cluster", func(t *testing.T) {
174215
cmd := exec.Command(cliPath,
175216
clustersEntity,

0 commit comments

Comments
 (0)