summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/conf/fs.conf9
-rw-r--r--test/unit/common/test_diskdir.py10
-rw-r--r--test/unit/common/test_utils.py9
3 files changed, 16 insertions, 12 deletions
diff --git a/test/functional/conf/fs.conf b/test/functional/conf/fs.conf
index 43f9b45..b06a854 100644
--- a/test/functional/conf/fs.conf
+++ b/test/functional/conf/fs.conf
@@ -4,11 +4,6 @@
# volumes to be served via Swift API.
mount_ip = localhost
-# By default it is assumed the Gluster volumes can be accessed using other
-# methods besides UFO (not object only), which disables a caching
-# optimizations in order to keep in sync with file system changes.
-object_only = yes
-
# Performance optimization parameter. When turned off, the filesystem will
# see a reduced number of stat calls, resulting in substantially faster
# response time for GET and HEAD container requests on containers with large
@@ -18,3 +13,7 @@ object_only = yes
#
# *** Keep on for Functional Tests ***
accurate_size_in_listing = on
+
+# *** Keep on for Functional Tests ***
+container_update_object_count = on
+account_update_container_count = on
diff --git a/test/unit/common/test_diskdir.py b/test/unit/common/test_diskdir.py
index be0c922..bbdb168 100644
--- a/test/unit/common/test_diskdir.py
+++ b/test/unit/common/test_diskdir.py
@@ -468,6 +468,9 @@ class TestContainerBroker(unittest.TestCase):
def test_get_info(self):
# Test swift.common.db.ContainerBroker.get_info
+ __save_config = \
+ gluster.swift.common.Glusterfs._container_update_object_count
+ gluster.swift.common.Glusterfs._container_update_object_count = True
broker = self._get_broker(account='test1',
container='test2')
broker.initialize(self.initial_ts)
@@ -513,6 +516,8 @@ class TestContainerBroker(unittest.TestCase):
info = broker.get_info()
self.assertEquals(info['x_container_sync_point1'], -1)
self.assertEquals(info['x_container_sync_point2'], -1)
+ gluster.swift.common.Glusterfs._container_update_object_count = \
+ __save_config
def test_get_info_nonexistent_container(self):
broker = dd.DiskDir(self.path, self.drive, account='no_account',
@@ -1046,6 +1051,9 @@ class TestAccountBroker(unittest.TestCase):
def test_get_info(self):
# Test swift.common.db.AccountBroker.get_info
+ __save_config = \
+ gluster.swift.common.Glusterfs._account_update_container_count
+ gluster.swift.common.Glusterfs._account_update_container_count = True
broker = self._get_broker(account='test1')
broker.initialize(self.initial_ts)
@@ -1074,6 +1082,8 @@ class TestAccountBroker(unittest.TestCase):
os.rmdir(c2)
info = broker.get_info()
self.assertEquals(info['container_count'], 0)
+ gluster.swift.common.Glusterfs._account_update_container_count = \
+ __save_config
def test_list_containers_iter(self):
# Test swift.common.db.AccountBroker.list_containers_iter
diff --git a/test/unit/common/test_utils.py b/test/unit/common/test_utils.py
index 6d6319d..4aae4c3 100644
--- a/test/unit/common/test_utils.py
+++ b/test/unit/common/test_utils.py
@@ -585,23 +585,19 @@ class TestUtils(unittest.TestCase):
os.chdir(orig_cwd)
shutil.rmtree(td)
- def test_get_container_details_ufo(self):
+ def test_get_container_details(self):
orig_cwd = os.getcwd()
- __obj_only = Glusterfs.OBJECT_ONLY
td = tempfile.mkdtemp()
try:
tf = tarfile.open("common/data/container_tree.tar.bz2", "r:bz2")
os.chdir(td)
tf.extractall()
- Glusterfs.OBJECT_ONLY = False
-
obj_list, object_count, bytes_used = \
utils.get_container_details(td)
assert bytes_used == 0, repr(bytes_used)
- assert object_count == 8, repr(object_count)
+ assert object_count == 5, repr(object_count)
assert set(obj_list) == set(['file1', 'file3', 'file2',
- 'dir3', 'dir1', 'dir2',
'dir1/file1', 'dir1/file2'
]), repr(obj_list)
@@ -616,7 +612,6 @@ class TestUtils(unittest.TestCase):
finally:
os.chdir(orig_cwd)
shutil.rmtree(td)
- Glusterfs.OBJECT_ONLY = __obj_only
def test_get_container_details_from_fs_do_getsize_true(self):
orig_cwd = os.getcwd()