@@ -265,6 +265,59 @@ def test_enable_ttl(self, table_lsi):
265
265
ttl_status = ttl ["TimeToLiveStatus" ]
266
266
assert ttl_status in ("ENABLED" , "ENABLING" )
267
267
268
+ def test_enable_point_in_time_recovery (self , table_lsi ):
269
+ (ref , res ) = table_lsi
270
+
271
+ table_name = res ["spec" ]["tableName" ]
272
+
273
+ # Check DynamoDB Table exists
274
+ assert self .table_exists (table_name )
275
+
276
+ # Get CR latest revision
277
+ cr = k8s .wait_resource_consumed_by_controller (ref )
278
+
279
+ # Update PITR
280
+ updates = {
281
+ "spec" : {
282
+ "continuousBackups" : {
283
+ "pointInTimeRecoveryEnabled" : True
284
+ }
285
+ }
286
+ }
287
+
288
+ # Patch k8s resource
289
+ k8s .patch_custom_resource (ref , updates )
290
+
291
+ table .wait_until (
292
+ table_name ,
293
+ table .point_in_time_recovery_matches (True ),
294
+ )
295
+
296
+ pitr_enabled = table .get_point_in_time_recovery_enabled (table_name )
297
+ assert pitr_enabled is not None
298
+ assert pitr_enabled
299
+
300
+ # turn off pitr again and ensure it is disabled
301
+ updates = {
302
+ "spec" : {
303
+ "continuousBackups" : {
304
+ "pointInTimeRecoveryEnabled" : False
305
+ }
306
+ }
307
+ }
308
+
309
+ # Patch k8s resource
310
+ k8s .patch_custom_resource (ref , updates )
311
+
312
+ table .wait_until (
313
+ table_name ,
314
+ table .point_in_time_recovery_matches (False ),
315
+ )
316
+
317
+ pitr_enabled = table .get_point_in_time_recovery_enabled (table_name )
318
+ assert pitr_enabled is not None
319
+ assert not pitr_enabled
320
+
268
321
def test_enable_stream_specification (self , table_lsi ):
269
322
(ref , res ) = table_lsi
270
323
@@ -706,4 +759,4 @@ def test_multi_updates(self, table_gsi):
706
759
707
760
assert latestTable ["ProvisionedThroughput" ] is not None
708
761
assert latestTable ["ProvisionedThroughput" ]["ReadCapacityUnits" ] == 10
709
- assert latestTable ["ProvisionedThroughput" ]["WriteCapacityUnits" ] == 10
762
+ assert latestTable ["ProvisionedThroughput" ]["WriteCapacityUnits" ] == 10
0 commit comments