Skip to content

Commit

Permalink
DAOS-15953 test: update online_drain to use config values
Browse files Browse the repository at this point in the history
Test-repeat: 3
Skip-unit-tests: true
Skip-fault-injection-test: true

Get the targets and ranks from the config instead of hardcoding.
Also use self.random instead of direct random.

Required-githooks: true

Signed-off-by: Dalton Bohning <dalton.bohning@intel.com>
  • Loading branch information
daltonbohning committed Jun 24, 2024
1 parent 2cffb26 commit eb6cf17
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
21 changes: 8 additions & 13 deletions src/tests/ftest/osa/online_drain.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""
(C) Copyright 2020-2023 Intel Corporation.
(C) Copyright 2020-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import random
import threading
import time

Expand Down Expand Up @@ -42,20 +41,16 @@ def run_online_drain_test(self, num_pool, oclass=None, app_name="ior"):
"""
# Create a pool
pool = {}
target_list = []
if oclass is None:
oclass = self.ior_cmd.dfs_oclass.value
test_seq = self.ior_test_sequence[0]
drain_servers = (len(self.hostlist_servers) * 2) - 1

# Exclude target : random two targets (target idx : 0-7)
exc = random.randint(0, 6) # nosec
target_list.append(exc)
target_list.append(exc + 1)
t_string = "{},{}".format(target_list[0], target_list[1])
# Exclude two random targets
targets = int(self.server_managers[-1].get_config_value('targets'))
t_string = ','.join(map(str, self.random.sample(range(targets), 2)))

# Drain one of the ranks (or server)
rank = random.randint(1, drain_servers) # nosec
rank = self.random.choice(list(self.server_managers[0].ranks.keys()))

for val in range(0, num_pool):
pool[val] = add_pool(self, connect=False)
Expand Down Expand Up @@ -98,9 +93,9 @@ def run_online_drain_test(self, num_pool, oclass=None, app_name="ior"):
pver_drain = self.pool.get_version(True)
self.log.info("Pool Version after drain %s", pver_drain)
# Check pool version incremented after pool exclude
self.assertTrue(pver_drain > pver_begin, "Pool Version Error: After drain")
self.assertTrue(initial_free_space > free_space_after_drain,
"Expected free space after drain is less than initial")
self.assertGreater(pver_drain, pver_begin, "Pool Version Error: After drain")
self.assertGreater(initial_free_space, free_space_after_drain,
"Expected free space after drain is less than initial")
# Wait to finish the threads
for thrd in threads:
thrd.join()
Expand Down
15 changes: 5 additions & 10 deletions src/tests/ftest/osa/online_drain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ server_config:
- DD_MASK=mgmt,md,rebuild
storage: auto
pool:
scm_size: 12000000000
nvme_size: 108000000000
svcn: 4
control_method: dmg
scm_size: 12G
nvme_size: 108G
rebuild_timeout: 120
pool_query_timeout: 30
properties: scrub:timed,scrub_freq:1
Expand All @@ -55,9 +53,9 @@ ior:
iorflags:
write_flags: "-w -F -k -G 1"
read_flags: "-F -r -R -k -G 1"
api: DFS
dfs_oclass: RP_2G4
dfs_dir_oclass: RP_2G4
api: DFS
dfs_oclass: RP_2G4
dfs_dir_oclass: RP_2G4
ior_test_sequence:
# - [scmsize, nvmesize, transfersize, blocksize, PASS/FAIL(Expected) ]
# The values are set to be in the multiples of 10.
Expand All @@ -81,9 +79,6 @@ mdtest:
read_bytes: 32768
verbosity_value: 1
depth: 0
daos_racer:
runtime: 480
clush_timeout: 1000
test_obj_class:
oclass:
- RP_3G6
Expand Down

0 comments on commit eb6cf17

Please sign in to comment.