@@ -95,15 +95,40 @@ func Test_DownloadBackup(t *testing.T) {
9595 "scw rdb backup export {{ .Backup.ID }} --wait" ,
9696 ),
9797 ),
98- Cmd : "scw rdb backup download {{ .Backup.ID }} output=dump " ,
98+ Cmd : "scw rdb backup download {{ .Backup.ID }} output=simple_dump " ,
9999 Check : core .TestCheckCombine (
100100 core .TestCheckGolden (),
101101 core .TestCheckExitCode (0 ),
102102 ),
103103 AfterFunc : core .AfterFuncCombine (
104104 deleteInstance (),
105105 func (ctx * core.AfterFuncCtx ) error {
106- err := os .Remove ("dump" )
106+ err := os .Remove ("simple_dump" )
107+ return err
108+ },
109+ ),
110+ DefaultRegion : scw .RegionNlAms ,
111+ TmpHomeDir : true ,
112+ }))
113+
114+ t .Run ("With no previous export backup" , core .Test (& core.TestConfig {
115+ Commands : GetCommands (),
116+ BeforeFunc : core .BeforeFuncCombine (
117+ createInstance (engine ),
118+ core .ExecStoreBeforeCmd (
119+ "Backup" ,
120+ "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-07:00 instance-id={{ .Instance.ID }} database-name=rdb --wait" ,
121+ ),
122+ ),
123+ Cmd : "scw rdb backup download {{ .Backup.ID }} output=no_previous_export_dump" ,
124+ Check : core .TestCheckCombine (
125+ core .TestCheckGolden (),
126+ core .TestCheckExitCode (0 ),
127+ ),
128+ AfterFunc : core .AfterFuncCombine (
129+ deleteInstance (),
130+ func (ctx * core.AfterFuncCtx ) error {
131+ err := os .Remove ("no_previous_export_dump" )
107132 return err
108133 },
109134 ),
0 commit comments