#NEWLINE# def test_volumes( self ) : #NEWLINE# #INDENT# 'Test volume and snapshot functionality' #NEWLINE# volume_name = self . getUniqueString ( ) #NEWLINE# snapshot_name = self . getUniqueString ( ) #NEWLINE# self . addDetail ( 'volume' , content . text_content ( volume_name ) ) #NEWLINE# self . addCleanup ( self . cleanup , volume_name , snapshot_name ) #NEWLINE# volume = self . demo_cloud . create_volume ( display_name = volume_name , size = 1 ) #NEWLINE# snapshot = self . demo_cloud . create_volume_snapshot ( volume [ 'id' ] , display_name = snapshot_name ) #NEWLINE# volume_ids = [ v [ 'id' ] for v in self . demo_cloud . list_volumes ( ) ] #NEWLINE# self . assertIn ( volume [ 'id' ] , volume_ids ) #NEWLINE# snapshot_list = self . demo_cloud . list_volume_snapshots ( ) #NEWLINE# snapshot_ids = [ s [ 'id' ] for s in snapshot_list ] #NEWLINE# self . assertIn ( snapshot [ 'id' ] , snapshot_ids ) #NEWLINE# ret_snapshot = self . demo_cloud . get_volume_snapshot_by_id ( snapshot [ 'id' ] ) #NEWLINE# self . assertEqual ( snapshot [ 'id' ] , ret_snapshot [ 'id' ] ) #NEWLINE# self . demo_cloud . delete_volume_snapshot ( snapshot_name , wait = True ) #NEWLINE# self . demo_cloud . delete_volume ( volume_name , wait = True )