Commit 3491b5b6 authored by Felix Seibert's avatar Felix Seibert
Browse files

implement test for random assignment respecting osd capacities

parent dfd0f44d
......@@ -74,7 +74,27 @@ class TestDataDistribution(unittest.TestCase):
self.fail("expect value error!")
def test_random_distribution_respecting_capacities(self):
pass
# generate some random distributions and check whether they all respect the OSD capacities
max_osd_total_folder_size = 0
num_osds = 3
osd_capacity = 100
num_folders = 10
folder_size = 20
for i in range(0, 100):
distribution = dataDistribution.DataDistribution()
distribution.add_osd_list(create_test_osd_list(num_osds))
distribution.add_folders(create_test_folder_list(num_folders, folder_size),
random_osd_assignment=True,
ignore_osd_capacities=False,
osd_information=create_osd_information(num_osds, osd_capacity),
capacity=osd_capacity_key)
osds = distribution.get_osd_list()
total_folder_sizes = list(map(lambda x: distribution.OSDs[x].total_folder_size, osds))
max_osd_total_folder_size = max(max(total_folder_sizes), max_osd_total_folder_size)
self.assertTrue(max_osd_total_folder_size <= osd_capacity)
def test_round_robin_distribution(self):
pass
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment