From 677f3b1f63f549fc3f1bd04d3613d0baf57ea57c Mon Sep 17 00:00:00 2001 From: Kevan Carstensen Date: Thu, 15 Jul 2010 16:21:48 -0700 Subject: [PATCH] test/test_storage.py: test for the new remote_abort semantics. --- src/allmydata/test/test_storage.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/allmydata/test/test_storage.py b/src/allmydata/test/test_storage.py index 594c536a..c3153e85 100644 --- a/src/allmydata/test/test_storage.py +++ b/src/allmydata/test/test_storage.py @@ -321,6 +321,20 @@ class Server(unittest.TestCase): self.failIf(os.path.exists(incoming_prefix_dir), incoming_prefix_dir) self.failUnless(os.path.exists(incoming_dir), incoming_dir) + def test_abort(self): + # remote_abort, when called on a writer, should make sure that + # the allocated size of the bucket is not counted by the storage + # server when accounting for space. + ss = self.create("test_abort") + already, writers = self.allocate(ss, "allocate", [0, 1, 2], 150) + self.failIfEqual(ss.allocated_size(), 0) + + # Now abort the writers. + for writer in writers.itervalues(): + writer.remote_abort() + self.failUnlessEqual(ss.allocated_size(), 0) + + def test_allocate(self): ss = self.create("test_allocate") -- 2.45.2