Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Felix Seibert
xtreemfs_client
Commits
3491b5b6
Commit
3491b5b6
authored
Apr 10, 2018
by
Felix Seibert
Browse files
implement test for random assignment respecting osd capacities
parent
dfd0f44d
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_dataDistribution.py
View file @
3491b5b6
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment