From 82e213be488e1145de67fed5198ace89df14b117 Mon Sep 17 00:00:00 2001 From: Amir Shehata Date: Tue, 21 Dec 2021 21:42:32 -0800 Subject: [PATCH] LU-10973 lnet: Various test cleanups Cleaning up some of the LUTF test failures Test-Parameters: @lnet Signed-off-by: Amir Shehata Change-Id: I529d3f171357255d04991293a5df4c7b41622d07 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/45915 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Serguei Smirnov Reviewed-by: Frank Sehr Reviewed-by: jsimmons Reviewed-by: Oleg Drokin --- lustre/tests/lutf/python/tests-infra/lnet_helpers.py | 8 ++++++++ .../lutf/python/tests/suite_dlc/test_dlc_libconfig_16.py | 13 +++++++++++-- .../lutf/python/tests/suite_dlc/test_dlc_libconfig_22.py | 11 ++++++++++- .../tests/suite_dynamic-discovery/test_dd_UT-DD-CFG-0005.py | 6 +++--- .../tests/suite_dynamic-discovery/test_dd_UT-DD-CFG-0006.py | 4 +++- 5 files changed, 35 insertions(+), 7 deletions(-) diff --git a/lustre/tests/lutf/python/tests-infra/lnet_helpers.py b/lustre/tests/lutf/python/tests-infra/lnet_helpers.py index e113338..7dec525 100644 --- a/lustre/tests/lutf/python/tests-infra/lnet_helpers.py +++ b/lustre/tests/lutf/python/tests-infra/lnet_helpers.py @@ -15,6 +15,8 @@ LNET_NRB_SMALL = LNET_NRB_SMALL_MIN * 4 LNET_NRB_LARGE_MIN = 256 LNET_NRB_LARGE = LNET_NRB_LARGE_MIN * 4 +LNET_ROUTER_MEMORY = 3221225472 + class LNetHelpers(BaseTest): def __init__(self, script=os.path.abspath(__file__), target=None, exceptions=True): @@ -36,6 +38,12 @@ class LNetHelpers(BaseTest): logging.debug('uninit: Uninitializing LNetHelper') lnetconfig.lustre_lnet_config_lib_uninit() + # a router must have at least 3 GB of RAM + def can_be_router(self): + if psutil.virtual_memory().total > LNET_ROUTER_MEMORY: + return True + return False + def set_exception(self, exception): self.exceptions = exception diff --git a/lustre/tests/lutf/python/tests/suite_dlc/test_dlc_libconfig_16.py b/lustre/tests/lutf/python/tests/suite_dlc/test_dlc_libconfig_16.py index 3a88c1e..e0e719a 100644 --- a/lustre/tests/lutf/python/tests/suite_dlc/test_dlc_libconfig_16.py +++ b/lustre/tests/lutf/python/tests/suite_dlc/test_dlc_libconfig_16.py @@ -20,9 +20,18 @@ def run(): la = agents.keys() if len(la) < 1: return lutfrc(LUTF_TEST_SKIP, "No agents to run test") - t = LNetHelpers(target=la[0]) + t = None + for agent in la: + t = LNetHelpers(target=agent) + if t.can_be_router(): + break + else: + t = None + if not t: + return lutfrc(LUTF_TEST_SKIP, + comment="no routers found") try: - t = LNetHelpers(target=la[0]) + t = LNetHelpers(target=agent) t.configure_lnet() t.api_set_routing(True) t.set_exception(False) diff --git a/lustre/tests/lutf/python/tests/suite_dlc/test_dlc_libconfig_22.py b/lustre/tests/lutf/python/tests/suite_dlc/test_dlc_libconfig_22.py index 6f6d5b0..5c0cca0 100644 --- a/lustre/tests/lutf/python/tests/suite_dlc/test_dlc_libconfig_22.py +++ b/lustre/tests/lutf/python/tests/suite_dlc/test_dlc_libconfig_22.py @@ -33,7 +33,16 @@ def run(): # peer1 = TestTraffic(target=la[0]) peer2 = TestTraffic(target=la[1]) - rtr = TestTraffic(target=la[2]) + rtr = None + for agent in la[2:]: + rtr = LNetHelpers(target=agent) + if rtr.can_be_router(): + break + else: + rtr = None + if not rtr: + return lutfrc(LUTF_TEST_SKIP, + comment="no routers found") try: peer1.lh.configure_net('tcp') peer2.lh.configure_net('tcp2') diff --git a/lustre/tests/lutf/python/tests/suite_dynamic-discovery/test_dd_UT-DD-CFG-0005.py b/lustre/tests/lutf/python/tests/suite_dynamic-discovery/test_dd_UT-DD-CFG-0005.py index d0748ff..a7e57cc 100644 --- a/lustre/tests/lutf/python/tests/suite_dynamic-discovery/test_dd_UT-DD-CFG-0005.py +++ b/lustre/tests/lutf/python/tests/suite_dynamic-discovery/test_dd_UT-DD-CFG-0005.py @@ -25,11 +25,11 @@ def run(): t.configure_lnet() intfs = t.get_available_devs() t.configure_net('tcp', intfs) - t.set_max_intf(500) + t.set_max_intf(800) cfg = t.get_globals() - if not cfg['global']['max_intf'] == 500: + if not cfg['global']['max_interfaces'] == 800: return lutfrc(LUTF_TEST_FAIL, "max_intf wasn't set properly", - intended_value=500, actual_value=cfg['global']['max_intf']) + intended_value=800, actual_value=cfg['global']['max_interfaces']) t.unconfigure_lnet() return lutfrc(LUTF_TEST_PASS) diff --git a/lustre/tests/lutf/python/tests/suite_dynamic-discovery/test_dd_UT-DD-CFG-0006.py b/lustre/tests/lutf/python/tests/suite_dynamic-discovery/test_dd_UT-DD-CFG-0006.py index a3357ab..50ca832 100644 --- a/lustre/tests/lutf/python/tests/suite_dynamic-discovery/test_dd_UT-DD-CFG-0006.py +++ b/lustre/tests/lutf/python/tests/suite_dynamic-discovery/test_dd_UT-DD-CFG-0006.py @@ -29,7 +29,9 @@ def set_check(target, helper, value): helper.api_yaml_cfg(tmp.get_full_path(), 1, delete=False) tmp.remove() cfg = helper.get_globals() - return cfg['global']['max_intf'] == value, cfg + # TODO: Why can we set it with max_intf but when we show it we + # have to use max_interfaces + return cfg['global']['max_interfaces'] == value, cfg def run(): la = agents.keys() -- 1.8.3.1