#NEWLINE# def test_delete_partition_ssync_single_region( self ) : #NEWLINE# #INDENT# devs = [ { #NEWLINE# #INDENT# 'id' : 0 , #NEWLINE# 'device' : 'sda' , #NEWLINE# 'zone' : 0 , #NEWLINE# 'region' : 1 , #NEWLINE# 'ip' : '127.0.0.0' , #NEWLINE# 'port' : 6200 , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 1 , #NEWLINE# 'device' : 'sda' , #NEWLINE# 'zone' : 1 , #NEWLINE# 'region' : 1 , #NEWLINE# 'ip' : '127.0.0.1' , #NEWLINE# 'port' : 6200 , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 2 , #NEWLINE# 'device' : 'sda' , #NEWLINE# 'zone' : 2 , #NEWLINE# 'region' : 1 , #NEWLINE# 'ip' : '127.0.0.2' , #NEWLINE# 'port' : 6200 , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 3 , #NEWLINE# 'device' : 'sda' , #NEWLINE# 'zone' : 4 , #NEWLINE# 'region' : 1 , #NEWLINE# 'ip' : '127.0.0.3' , #NEWLINE# 'port' : 6200 , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 4 , #NEWLINE# 'device' : 'sda' , #NEWLINE# 'zone' : 5 , #NEWLINE# 'region' : 1 , #NEWLINE# 'ip' : '127.0.0.4' , #NEWLINE# 'port' : 6200 , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 5 , #NEWLINE# 'device' : 'sda' , #NEWLINE# 'zone' : 6 , #NEWLINE# 'region' : 1 , #NEWLINE# 'ip' : 'fe80::202:b3ff:fe1e:8329' , #NEWLINE# 'port' : 6200 , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 6 , #NEWLINE# 'device' : 'sda' , #NEWLINE# 'zone' : 7 , #NEWLINE# 'region' : 1 , #NEWLINE# 'ip' : '2001:0db8:85a3:0000:0000:8a2e:0370:7334' , #NEWLINE# 'port' : 6200 , #NEWLINE# #UNINDENT# } ] #NEWLINE# _create_test_rings ( self . testdir , devs = devs ) #NEWLINE# self . conf [ 'sync_method' ] = 'ssync' #NEWLINE# self . replicator = object_replicator . ObjectReplicator ( self . conf ) #NEWLINE# self . replicator . logger = debug_logger ( ) #NEWLINE# self . replicator . _zero_stats ( ) #NEWLINE# with mock . patch ( 'swift.obj.replicator.http_connect' , mock_http_connect ( 200 ) ) : #NEWLINE# #INDENT# df = self . df_mgr . get_diskfile ( 'sda' , '1' , 'a' , 'c' , 'o' , policy = POLICIES . legacy ) #NEWLINE# mkdirs ( df . _datadir ) #NEWLINE# ts = normalize_timestamp ( time . time ( ) ) #NEWLINE# f = open ( os . path . join ( df . _datadir , ( ts + '.data' ) ) , 'wb' ) #NEWLINE# f . write ( '1234567890' ) #NEWLINE# f . close ( ) #NEWLINE# ohash = hash_path ( 'a' , 'c' , 'o' ) #NEWLINE# whole_path_from = storage_directory ( self . objects , 1 , ohash ) #NEWLINE# suffix_dir_path = os . path . dirname ( whole_path_from ) #NEWLINE# part_path = os . path . join ( self . objects , '1' ) #NEWLINE# self . assertTrue ( os . access ( part_path , os . F_OK ) ) #NEWLINE# def _fake_ssync( node , job , suffixes , **kwargs ) : #NEWLINE# #INDENT# return ( True , { #NEWLINE# #INDENT# ohash : ts , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# self . replicator . sync_method = _fake_ssync #NEWLINE# self . replicator . replicate ( ) #NEWLINE# self . assertFalse ( os . access ( whole_path_from , os . F_OK ) ) #NEWLINE# self . assertFalse ( os . access ( suffix_dir_path , os . F_OK ) ) #NEWLINE# self . assertFalse ( os . access ( part_path , os . F_OK ) )