]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Fixes tests which were improperly deleting shares
authorMark Berger <mark.berger.j@gmail.com>
Mon, 24 Jun 2013 22:30:26 +0000 (18:30 -0400)
committerBrian Warner <warner@lothar.com>
Wed, 3 Sep 2014 01:48:39 +0000 (18:48 -0700)
src/allmydata/test/test_upload.py

index b6ca3bbf4342cdef0b3a0ff21cc7085d5f17b6b6..865eec28ef62559104f9ef775e52c6aaba07791b 100644 (file)
@@ -1887,11 +1887,7 @@ class EncodingParameters(GridTestMixin, unittest.TestCase, SetDEPMixin,
             self._add_server_with_share(server_number=3, share_number=1)
             # Copy shares
             self._copy_share_to_server(3, 1)
-            storedir = 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)
+            self.delete_all_shares(self.get_serverdir(0))
             client = self.g.clients[0]
             client.encoding_params['happy'] = 4
             return client
@@ -1929,10 +1925,7 @@ class EncodingParameters(GridTestMixin, unittest.TestCase, SetDEPMixin,
             # Copy shares
             self._copy_share_to_server(3, 1)
             #Remove shares from server 0
-            sharedir = os.path.join(self.get_serverdir(0), "shares")
-            for prefixdir in os.listdir(sharedir):
-                if prefixdir != 'incoming':
-                    fileutil.rm_dir(os.path.join(sharedir, prefixdir))
+            self.delete_all_shares(self.get_serverdir(0))
             client = self.g.clients[0]
             client.encoding_params['happy'] = 4
             return client