Skip to content

Commit

Permalink
DAOS-11283 test: Add bring_network_interface[down_up]
Browse files Browse the repository at this point in the history
Skip-tests: True

Signed-off-by: Padmanabhan <ravindran.padmanabhan@intel.com>
  • Loading branch information
rpadma2 committed Jul 17, 2023
1 parent 58c529b commit efeb375
Showing 1 changed file with 35 additions and 12 deletions.
47 changes: 35 additions & 12 deletions src/tests/ftest/deployment/network_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,38 @@ def wait_for_ranks_to_join(self):
self.log.info("One or more servers crashed. Check system query again.")

return False

Check warning on line 166 in src/tests/ftest/deployment/network_failure.py

View workflow job for this annotation

GitHub Actions / Flake8 check

W293 blank line contains whitespace

Check warning on line 166 in src/tests/ftest/deployment/network_failure.py

View workflow job for this annotation

GitHub Actions / Pylint check

trailing-whitespace, Trailing whitespace
def bring_network_interface_up(self, test_env):
"""Bring the network interface up.
"""
errors = []
if test_env == "ci":
# wolf
update_network_interface(
interface=self.interface, state="up", hosts=self.network_down_host,
errors=errors)
else:
# Aurora. Manually run the command.
command = f"sudo ip link set {self.interface} up"
self.log.debug("## Call %s on %s", command, self.network_down_host)
time.sleep(30)
return errors

Check warning on line 182 in src/tests/ftest/deployment/network_failure.py

View workflow job for this annotation

GitHub Actions / Flake8 check

W293 blank line contains whitespace

Check warning on line 182 in src/tests/ftest/deployment/network_failure.py

View workflow job for this annotation

GitHub Actions / Pylint check

trailing-whitespace, Trailing whitespace
def bring_network_interface_down(self, test_env):
"""Bring the network interface down.
"""
errors = []
if test_env == "ci":
# wolf
update_network_interface(
interface=self.interface, state="down", hosts=self.network_down_host,
errors=errors)
else:
# Aurora. Manually run the command.
command = f"sudo ip link set {self.interface} up"
self.log.debug("## Call %s on %s", command, self.network_down_host)
time.sleep(30)
return errors

def verify_network_failure(self, ior_namespace, container_namespace, with_io=False):
"""Verify network failure can be recovered with some user interventions with
Expand Down Expand Up @@ -207,7 +239,7 @@ def verify_network_failure(self, ior_namespace, container_namespace, with_io=Fal

# For non-IO testing, bring the network interface down now.
if with_io is False:
self.bring_network_interface_down()
errors = self.bring_network_interface_down(self.test_env)

# 3. Run IOR with given object class. It should fail.
threads = []
Expand All @@ -230,24 +262,15 @@ def verify_network_failure(self, ior_namespace, container_namespace, with_io=Fal

# For I/O testing, bring the network interface after starting IOR.
if with_io is True:
self.bring_network_interface_down()
errors = self.bring_network_interface_down(self.test_env)

# Wait to finish the threads
for thrd in threads:
thrd.join()
self.log.info(ior_results)

# 4. Bring up the network interface.
if self.test_env == "ci":
# wolf
update_network_interface(
interface=self.interface, state="up", hosts=self.network_down_host,
errors=errors)
else:
# Aurora. Manually run the command.
command = f"sudo ip link set {self.interface} up"
self.log.debug("## Call %s on %s", command, self.network_down_host)
time.sleep(20)
errors = self.bring_network_interface_up(self.test_env)

# 5. Restart DAOS with dmg.
self.log.info("Wait for 5 sec for the network to come back up")
Expand Down

0 comments on commit efeb375

Please sign in to comment.