-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DAOS-6923 test: Offline Reintegration - More tests #4835
Changes from 8 commits
112adfa
8e7300e
9bc2302
d0a22c2
7225a5b
77f8c65
b2cb8c6
078065e
c072ccb
94f82fb
1ed510e
f2cedae
3b2b7b7
070af59
7b83df8
68f9753
77e73d2
85434c3
b07b581
8298076
54115d6
01c9e28
5ac7f75
3a080fc
fecfde7
b507f47
4973847
f4b3a43
5b9e8e4
ff074fc
189be59
a0f9a04
a557e80
a5e64fa
7684221
33406af
0629c3a
6188da1
4983019
2e6461a
9fe0d4b
396cdea
1ccb85e
aa50cc5
29d61e9
f11419b
ac0c39b
ff2148d
b440a11
a6e8545
8349efa
3787a55
de979b5
d17a081
3ef55fe
e975b4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,10 @@ | |
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
""" | ||
import random | ||
import time | ||
from osa_utils import OSAUtils | ||
from test_utils_pool import TestPool | ||
from apricot import skipForTicket | ||
from write_host_file import write_host_file | ||
|
||
|
||
class OSAOfflineDrain(OSAUtils): | ||
|
@@ -22,28 +23,38 @@ def setUp(self): | |
"""Set up for test case.""" | ||
super(OSAOfflineDrain, self).setUp() | ||
self.dmg_command = self.get_dmg_command() | ||
self.ior_test_sequence = self.params.get( | ||
"ior_test_sequence", '/run/ior/iorflags/*') | ||
# Recreate the client hostfile without slots defined | ||
self.hostfile_clients = write_host_file( | ||
self.hostlist_clients, self.workdir, None) | ||
|
||
def run_offline_drain_test(self, num_pool, data=False): | ||
def run_offline_drain_test(self, num_pool, data=False, | ||
oclass=None, drain_during_aggregation=False): | ||
"""Run the offline drain without data. | ||
Args: | ||
num_pool (int) : total pools to create for testing purposes. | ||
data (bool) : whether pool has no data or to create | ||
some data in pool. Defaults to False. | ||
oclass (str): DAOS object class (eg: RP_2G1,etc) | ||
drain_during_aggregation (bool) : Perform drain and aggregation | ||
in parallel | ||
""" | ||
# Create a pool | ||
pool = {} | ||
rpadma2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
pool_uuid = [] | ||
target_list = [] | ||
drain_servers = (len(self.hostlist_servers) * 2) - 1 | ||
|
||
if oclass is None: | ||
oclass = self.ior_cmd.dfs_oclass.value | ||
|
||
# Exclude target : random two targets (target idx : 0-7) | ||
n = random.randint(0, 6) | ||
target_list.append(n) | ||
target_list.append(n+1) | ||
t_string = "{},{}".format(target_list[0], target_list[1]) | ||
|
||
# Drain a rank (or server) | ||
rank = random.randint(1, drain_servers) | ||
# Drain a rank 1 (or server) | ||
rank = 1 | ||
|
||
for val in range(0, num_pool): | ||
pool[val] = TestPool(self.context, dmg_command=self.dmg_command) | ||
|
@@ -54,17 +65,27 @@ def run_offline_drain_test(self, num_pool, data=False): | |
pool[val].nvme_size.value = int(pool[val].nvme_size.value / | ||
num_pool) | ||
pool[val].create() | ||
pool_uuid.append(pool[val].uuid) | ||
self.pool = pool[val] | ||
if drain_during_aggregation is True: | ||
test_seq = self.ior_test_sequence[1] | ||
self.pool.set_property("reclaim", "disabled") | ||
else: | ||
test_seq = self.ior_test_sequence[0] | ||
|
||
rpadma2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if data: | ||
self.write_single_object() | ||
self.run_ior_thread("Write", oclass, test_seq) | ||
self.run_mdtest_thread() | ||
|
||
# Drain the pool_uuid, rank and targets | ||
# Drain rank and targets | ||
for val in range(0, num_pool): | ||
self.pool = pool[val] | ||
rank = rank + val | ||
self.pool.display_pool_daos_space("Pool space: Beginning") | ||
pver_begin = self.get_pool_version() | ||
self.log.info("Pool Version at the beginning %s", pver_begin) | ||
if drain_during_aggregation is True: | ||
self.pool.set_property("reclaim", "time") | ||
rpadma2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
time.sleep(90) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious, why sleep(90) here? Then aggregation might already finish its job before drain? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed, let me constantly, loop the exclude, reintegration operations for 180 seconds and see whether aggregation kicks in... Lot of aggregation scripts have this time delay for the aggregation to kick in after an IO operation is performed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If aggregation scripts have sleep in them, i think it's not a good approach. There is no concrete way we can determine with a sleep if aggregation started or finished. Ravi> I am removing the sleep time... Instead we will be doing exclude,reintegrate in a loop for 100 seconds... In this way, we are sure aggregation is going to happen during the OSA exclud/reintegrate process. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed sleep and added the new method. Write ior data and delete the container to make sure aggregation happens. |
||
output = self.dmg_command.pool_drain(self.pool.uuid, | ||
rank, t_string) | ||
self.log.info(output) | ||
|
@@ -82,9 +103,9 @@ def run_offline_drain_test(self, num_pool, data=False): | |
pool[val].display_pool_daos_space(display_string) | ||
|
||
if data: | ||
self.verify_single_object() | ||
self.run_ior_thread("Read", oclass, test_seq) | ||
self.run_mdtest_thread() | ||
|
||
@skipForTicket("DAOS-6668") | ||
def test_osa_offline_drain(self): | ||
""" | ||
JIRA ID: DAOS-4750 | ||
|
@@ -94,5 +115,4 @@ def test_osa_offline_drain(self): | |
:avocado: tags=all,daily_regression,hw,medium,ib2 | ||
:avocado: tags=osa,osa_drain,offline_drain | ||
""" | ||
for pool_num in range(1, 3): | ||
self.run_offline_drain_test(pool_num, True) | ||
self.run_offline_drain_test(1, True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(pylint-unused-import) Unused import time