Fixes tests which were improperly deleting shares

This commit is contained in:
Mark Berger 2013-06-24 18:30:26 -04:00 committed by Brian Warner
parent 2ab6172302
commit e594f2b1ab

View File

@ -1887,11 +1887,7 @@ class EncodingParameters(GridTestMixin, unittest.TestCase, SetDEPMixin,
self._add_server_with_share(server_number=3, share_number=1) self._add_server_with_share(server_number=3, share_number=1)
# Copy shares # Copy shares
self._copy_share_to_server(3, 1) self._copy_share_to_server(3, 1)
storedir = self.get_serverdir(0) self.delete_all_shares(self.get_serverdir(0))
# remove the storedir, wiping out any existing shares
shutil.rmtree(storedir)
# create an empty storedir to replace the one we just removed
os.mkdir(storedir)
client = self.g.clients[0] client = self.g.clients[0]
client.encoding_params['happy'] = 4 client.encoding_params['happy'] = 4
return client return client
@ -1929,10 +1925,7 @@ class EncodingParameters(GridTestMixin, unittest.TestCase, SetDEPMixin,
# Copy shares # Copy shares
self._copy_share_to_server(3, 1) self._copy_share_to_server(3, 1)
#Remove shares from server 0 #Remove shares from server 0
sharedir = os.path.join(self.get_serverdir(0), "shares") self.delete_all_shares(self.get_serverdir(0))
for prefixdir in os.listdir(sharedir):
if prefixdir != 'incoming':
fileutil.rm_dir(os.path.join(sharedir, prefixdir))
client = self.g.clients[0] client = self.g.clients[0]
client.encoding_params['happy'] = 4 client.encoding_params['happy'] = 4
return client return client