@@ -179,26 +179,27 @@ var _ = Describe(
179179
180180 err = validateRestoredData (k8sClient )
181181 Expect (err ).ToNot (HaveOccurred ())
182-
183182 },
184183 )
185184
186185 It (
187186 "Should complete restore for Timestamp restore type" , func () {
188- restoreConfig := getRestoreConfigInMap (backupDataPath )
189- delete (restoreConfig , asdbv1beta1 .SourceKey )
190- delete (restoreConfig , asdbv1beta1 .BackupDataPathKey )
187+ configBytes , err := getTimeStampRestoreConfigBytes (getRestoreConfigInMap (backupDataPath ))
188+ Expect (err ).ToNot (HaveOccurred ())
189+
190+ restore = newRestoreWithConfig (restoreNsNm , asdbv1beta1 .Timestamp , configBytes )
191191
192- parts := strings .Split (backupDataPath , "/" )
193- time := parts [len (parts )- 3 ]
194- timeInt , err := strconv .Atoi (time )
192+ err = createRestore (k8sClient , restore )
195193 Expect (err ).ToNot (HaveOccurred ())
196194
197- // increase time by 1 millisecond to consider the latest backup under time bound
198- restoreConfig [asdbv1beta1 .TimeKey ] = int64 (timeInt ) + 1
199- restoreConfig [asdbv1beta1 .RoutineKey ] = parts [len (parts )- 5 ]
195+ err = validateRestoredData (k8sClient )
196+ Expect (err ).ToNot (HaveOccurred ())
197+ },
198+ )
200199
201- configBytes , err := json .Marshal (restoreConfig )
200+ It (
201+ "Should complete restore for Timestamp restore type and with TLS configured" , func () {
202+ configBytes , err := getTimeStampRestoreConfigBytes (getRestoreConfigWithTLSInMap (backupDataPath ))
202203 Expect (err ).ToNot (HaveOccurred ())
203204
204205 restore = newRestoreWithConfig (restoreNsNm , asdbv1beta1 .Timestamp , configBytes )
@@ -208,8 +209,23 @@ var _ = Describe(
208209
209210 err = validateRestoredData (k8sClient )
210211 Expect (err ).ToNot (HaveOccurred ())
211-
212212 },
213213 )
214214 })
215215 })
216+
217+ func getTimeStampRestoreConfigBytes (restoreConfig map [string ]interface {}) (configBytes []byte , err error ) {
218+ delete (restoreConfig , asdbv1beta1 .SourceKey )
219+ delete (restoreConfig , asdbv1beta1 .BackupDataPathKey )
220+
221+ parts := strings .Split (backupDataPath , "/" )
222+ time := parts [len (parts )- 3 ]
223+ timeInt , err := strconv .Atoi (time )
224+ Expect (err ).ToNot (HaveOccurred ())
225+
226+ // increase time by 1 millisecond to consider the latest backup under time bound
227+ restoreConfig [asdbv1beta1 .TimeKey ] = int64 (timeInt ) + 1
228+ restoreConfig [asdbv1beta1 .RoutineKey ] = parts [len (parts )- 5 ]
229+
230+ return getRestoreConfBytes (restoreConfig )
231+ }
0 commit comments