From 44bd102c11c82e34a2069f7a2f06fa05b3338258 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Wed, 27 Jan 2021 22:57:15 +0000 Subject: [PATCH 01/34] CART-831 tests: Add special other_env_vars param Add special other_env_vars param, which takes a newline separated list of env-var=value pairs to add to the python testing environment. Include a simple example use-case in nopmix_multictx yaml file. Skip-build-leap15-rpm: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-func-test-leap15: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- .../no_pmix/cart_nopmix_multictx_one_node.py | 2 ++ .../cart_nopmix_multictx_one_node.yaml | 4 +++ src/tests/ftest/cart/util/cart_utils.py | 28 +++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py index b68e87fe69d..11f36bcb796 100755 --- a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py +++ b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py @@ -46,6 +46,7 @@ def setUp(self): print("Running setup\n") self.utils = CartUtils() self.env = self.utils.get_env(self) + self.utils.set_other_env_vars(self) crt_phy_addr = self.params.get("CRT_PHY_ADDR_STR", '/run/defaultENV/') ofi_interface = self.params.get("OFI_INTERFACE", '/run/defaultENV/') ofi_ctx_num = self.params.get("CRT_CTX_NUM", '/run/defaultENV/') @@ -61,6 +62,7 @@ def tearDown(self): super(CartNoPmixOneNodeTest, self).tearDown() self.utils.cleanup_processes() + self.utils.unset_other_env_vars(self) def test_cart_no_pmix(self): """ diff --git a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml index 06c51b901e1..2eebe418d8b 100644 --- a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml +++ b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml @@ -8,6 +8,10 @@ defaultENV: OFI_INTERFACE: "eth0" CRT_CTX_NUM: "8" CRT_CTX_SHARE_ADDR: "0" + other_env_vars: " + ARBITRARY_ENV_VAR1=apple + ARBITRARY_ENV_VAR2=orange + ARBITRARY_ENV_VAR3=\"banana pear\"" tests: !mux no_pmix_multi_ctx: name: no_pmix_multi_ctx diff --git a/src/tests/ftest/cart/util/cart_utils.py b/src/tests/ftest/cart/util/cart_utils.py index 9f72759a78d..0a4972c4308 100755 --- a/src/tests/ftest/cart/util/cart_utils.py +++ b/src/tests/ftest/cart/util/cart_utils.py @@ -36,6 +36,7 @@ import logging import cart_logparse import cart_logtest +import shlex from general_utils import stop_processes @@ -105,6 +106,33 @@ def stop_process(proc): return procrtn + def set_other_env_vars(self, cartobj): + """ import env vars from other_env_var param """ + other_env_vars = cartobj.params.get("other_env_vars", "/run/defaultENV/") + if other_env_vars is None: + self.print("other_env_vars was not set in yaml file.\n") + return + + other_env_vars_split = shlex.split(other_env_vars) + for kv_pair in other_env_vars_split: + key, value = kv_pair.split('=', 2) + self.print("Adding {}={} to environment.\n".format(key, value)) + print("Adding {}={} to environment.\n".format(key, value)) + os.environ[key] = value + + def unset_other_env_vars(self, cartobj): + """ import env vars from other_env_var param """ + other_env_vars = cartobj.params.get("other_env_vars", "/run/defaultENV/") + if other_env_vars is None: + print("other_env_vars was not set in yaml file.\n") + return + + for kv_pair in shlex.split(other_env_vars): + key, value = kv_pair.split('=', 2) + print("Removing key {} from environment.\n".format(key)) + del os.environ[key] + + # What is special about pylint's 15 variable limit? # pylint: disable=too-many-locals def get_env(self, cartobj): From d102ccbb82822a24aaa356b26aa4f82a46094645 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Thu, 28 Jan 2021 15:54:24 +0000 Subject: [PATCH 02/34] CART-831 tests: Use Yaml array syntax Use Yaml array syntax, instead of multi-line string param. Test-tag: cart Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- .../cart/no_pmix/cart_nopmix_multictx_one_node.yaml | 8 ++++---- src/tests/ftest/cart/util/cart_utils.py | 10 ++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml index 2eebe418d8b..29456193a97 100644 --- a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml +++ b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml @@ -8,10 +8,10 @@ defaultENV: OFI_INTERFACE: "eth0" CRT_CTX_NUM: "8" CRT_CTX_SHARE_ADDR: "0" - other_env_vars: " - ARBITRARY_ENV_VAR1=apple - ARBITRARY_ENV_VAR2=orange - ARBITRARY_ENV_VAR3=\"banana pear\"" + other_env_vars: + - ARBITRARY_ENV_VAR1: apple + - ARBITRARY_ENV_VAR2: orange + - ARBITRARY_ENV_VAR3: banana pear tests: !mux no_pmix_multi_ctx: name: no_pmix_multi_ctx diff --git a/src/tests/ftest/cart/util/cart_utils.py b/src/tests/ftest/cart/util/cart_utils.py index 0a4972c4308..7be38f85119 100755 --- a/src/tests/ftest/cart/util/cart_utils.py +++ b/src/tests/ftest/cart/util/cart_utils.py @@ -113,9 +113,8 @@ def set_other_env_vars(self, cartobj): self.print("other_env_vars was not set in yaml file.\n") return - other_env_vars_split = shlex.split(other_env_vars) - for kv_pair in other_env_vars_split: - key, value = kv_pair.split('=', 2) + for kv_pair in other_env_vars: + key, value = kv_pair[0] self.print("Adding {}={} to environment.\n".format(key, value)) print("Adding {}={} to environment.\n".format(key, value)) os.environ[key] = value @@ -127,12 +126,11 @@ def unset_other_env_vars(self, cartobj): print("other_env_vars was not set in yaml file.\n") return - for kv_pair in shlex.split(other_env_vars): - key, value = kv_pair.split('=', 2) + for kv_pair in other_env_vars: + key, value = kv_pair[0] print("Removing key {} from environment.\n".format(key)) del os.environ[key] - # What is special about pylint's 15 variable limit? # pylint: disable=too-many-locals def get_env(self, cartobj): From cc9d1274073a1db026229ee4e47b8c3aefb663dc Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Fri, 29 Jan 2021 19:22:55 +0000 Subject: [PATCH 03/34] CART-831 tests: Fix pylint messages Test-tag: cart Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- src/tests/ftest/cart/util/cart_utils.py | 34 +++++++++++++------------ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/tests/ftest/cart/util/cart_utils.py b/src/tests/ftest/cart/util/cart_utils.py index 7be38f85119..4b5dfc9b987 100755 --- a/src/tests/ftest/cart/util/cart_utils.py +++ b/src/tests/ftest/cart/util/cart_utils.py @@ -36,7 +36,6 @@ import logging import cart_logparse import cart_logtest -import shlex from general_utils import stop_processes @@ -108,28 +107,31 @@ def stop_process(proc): def set_other_env_vars(self, cartobj): """ import env vars from other_env_var param """ - other_env_vars = cartobj.params.get("other_env_vars", "/run/defaultENV/") + other_env_vars = cartobj.params.get("other_env_vars", + "/run/defaultENV/") + print('DEBUG log: line 111, other_env_vars = ', other_env_vars ) if other_env_vars is None: - self.print("other_env_vars was not set in yaml file.\n") - return - + self.print("other_env_vars was not set in yaml file.\n") + return + for kv_pair in other_env_vars: - key, value = kv_pair[0] - self.print("Adding {}={} to environment.\n".format(key, value)) - print("Adding {}={} to environment.\n".format(key, value)) - os.environ[key] = value + key, value = kv_pair[0] + self.print("Adding {}={} to environment.\n".format(key, value)) + print("Adding {}={} to environment.\n".format(key, value)) + os.environ[key] = value def unset_other_env_vars(self, cartobj): """ import env vars from other_env_var param """ - other_env_vars = cartobj.params.get("other_env_vars", "/run/defaultENV/") + other_env_vars = cartobj.params.get("other_env_vars", + "/run/defaultENV/") if other_env_vars is None: - print("other_env_vars was not set in yaml file.\n") - return - + print("other_env_vars was not set in yaml file.\n") + return + for kv_pair in other_env_vars: - key, value = kv_pair[0] - print("Removing key {} from environment.\n".format(key)) - del os.environ[key] + key, value = kv_pair[0] + print("Removing key {} from environment.\n".format(key)) + del os.environ[key] # What is special about pylint's 15 variable limit? # pylint: disable=too-many-locals From 3de71a551d14c4dd0347300c995a2f5dce78aa49 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Mon, 1 Feb 2021 17:58:09 +0000 Subject: [PATCH 04/34] CART-831 tests: Resolve pylint warnings * unused vars * trailing whitespace * remove trace line Skip-build-leap15-rpm: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- src/tests/ftest/cart/util/cart_utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/tests/ftest/cart/util/cart_utils.py b/src/tests/ftest/cart/util/cart_utils.py index 4b5dfc9b987..b8ec3ddf110 100755 --- a/src/tests/ftest/cart/util/cart_utils.py +++ b/src/tests/ftest/cart/util/cart_utils.py @@ -107,9 +107,8 @@ def stop_process(proc): def set_other_env_vars(self, cartobj): """ import env vars from other_env_var param """ - other_env_vars = cartobj.params.get("other_env_vars", + other_env_vars = cartobj.params.get("other_env_vars", "/run/defaultENV/") - print('DEBUG log: line 111, other_env_vars = ', other_env_vars ) if other_env_vars is None: self.print("other_env_vars was not set in yaml file.\n") return @@ -129,7 +128,7 @@ def unset_other_env_vars(self, cartobj): return for kv_pair in other_env_vars: - key, value = kv_pair[0] + key = kv_pair[0][0] print("Removing key {} from environment.\n".format(key)) del os.environ[key] From cf43b31c180a4a913fd7e7c0a3ea31773f338f60 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Wed, 3 Feb 2021 13:42:47 +0000 Subject: [PATCH 05/34] CART-831 tests: Method can be a function Address this pylint message: (pylint-no-self-use) Method could be a function Method doesn't use instance data vars, so make it a function. Skip-build-leap15-rpm: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- src/tests/ftest/cart/util/cart_utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/tests/ftest/cart/util/cart_utils.py b/src/tests/ftest/cart/util/cart_utils.py index b8ec3ddf110..74649d4fd08 100755 --- a/src/tests/ftest/cart/util/cart_utils.py +++ b/src/tests/ftest/cart/util/cart_utils.py @@ -105,21 +105,22 @@ def stop_process(proc): return procrtn - def set_other_env_vars(self, cartobj): + @staticmethod + def set_other_env_vars(cartobj): """ import env vars from other_env_var param """ other_env_vars = cartobj.params.get("other_env_vars", "/run/defaultENV/") if other_env_vars is None: - self.print("other_env_vars was not set in yaml file.\n") + print("other_env_vars was not set in yaml file.\n") return for kv_pair in other_env_vars: key, value = kv_pair[0] - self.print("Adding {}={} to environment.\n".format(key, value)) print("Adding {}={} to environment.\n".format(key, value)) os.environ[key] = value - def unset_other_env_vars(self, cartobj): + @staticmethod + def unset_other_env_vars(cartobj): """ import env vars from other_env_var param """ other_env_vars = cartobj.params.get("other_env_vars", "/run/defaultENV/") From ef8c5fe5d3dc7a9c14f92ef747fbb501797cfc3f Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Thu, 4 Feb 2021 15:17:55 +0000 Subject: [PATCH 06/34] CART-831 tests: Add set_other_env_vars test Back out demonstration code in cart_nopmix_multictx_one_node Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- .../no_pmix/cart_nopmix_multictx_one_node.py | 2 - .../cart_nopmix_multictx_one_node.yaml | 4 - .../cart/utils_test/set_other_env_vars.py | 73 +++++++++++++++++++ .../cart/utils_test/set_other_env_vars.yaml | 13 ++++ 4 files changed, 86 insertions(+), 6 deletions(-) create mode 100644 src/tests/ftest/cart/utils_test/set_other_env_vars.py create mode 100644 src/tests/ftest/cart/utils_test/set_other_env_vars.yaml diff --git a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py index 11f36bcb796..b68e87fe69d 100755 --- a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py +++ b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py @@ -46,7 +46,6 @@ def setUp(self): print("Running setup\n") self.utils = CartUtils() self.env = self.utils.get_env(self) - self.utils.set_other_env_vars(self) crt_phy_addr = self.params.get("CRT_PHY_ADDR_STR", '/run/defaultENV/') ofi_interface = self.params.get("OFI_INTERFACE", '/run/defaultENV/') ofi_ctx_num = self.params.get("CRT_CTX_NUM", '/run/defaultENV/') @@ -62,7 +61,6 @@ def tearDown(self): super(CartNoPmixOneNodeTest, self).tearDown() self.utils.cleanup_processes() - self.utils.unset_other_env_vars(self) def test_cart_no_pmix(self): """ diff --git a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml index 29456193a97..06c51b901e1 100644 --- a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml +++ b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml @@ -8,10 +8,6 @@ defaultENV: OFI_INTERFACE: "eth0" CRT_CTX_NUM: "8" CRT_CTX_SHARE_ADDR: "0" - other_env_vars: - - ARBITRARY_ENV_VAR1: apple - - ARBITRARY_ENV_VAR2: orange - - ARBITRARY_ENV_VAR3: banana pear tests: !mux no_pmix_multi_ctx: name: no_pmix_multi_ctx diff --git a/src/tests/ftest/cart/utils_test/set_other_env_vars.py b/src/tests/ftest/cart/utils_test/set_other_env_vars.py new file mode 100644 index 00000000000..6536082a8a6 --- /dev/null +++ b/src/tests/ftest/cart/utils_test/set_other_env_vars.py @@ -0,0 +1,73 @@ +#!/usr/bin/python +''' + (C) Copyright 2018-2021 Intel Corporation. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE + The Government's rights to use, modify, reproduce, release, perform, display, + or disclose this software are subject to the terms of the Apache License as + provided in Contract No. B609815. + Any reproduction of computer software, computer software documentation, or + portions thereof marked with this legend must also reproduce the markings. +''' + +from __future__ import print_function + +import sys +import subprocess + +from apricot import TestWithoutServers + +sys.path.append('./util') + +# Can't all this import before setting sys.path +# pylint: disable=wrong-import-position +from cart_utils import CartUtils + +class SetOtherEnvVars(TestWithoutServers): + """ + Runs basic test of cart_utils.py:set_other_env_vars + + :avocado: recursive + """ + def setUp(self): + """ Test setup """ + print("Running setup\n") + self.utils = CartUtils() + + def tearDown(self): + """ Tear down """ + print("Running tearDown\n") + + def test_cart_no_pmix(self): + """ + Test set_other_env_vars + + :avocado: tags=set_other_env_vars + """ + + print("Before set_other_env_vars\n") + print(subprocess.check_output("env", shell=True)) + self.utils.set_other_env_vars(self) + print("After set_other_env_vars\n") + print(subprocess.check_output("env", shell=True)) + + print("Before unset_other_env_vars\n") + print(subprocess.check_output("env", shell=True)) + self.utils.unset_other_env_vars(self) + print("After unset_other_env_vars\n") + print(subprocess.check_output("env", shell=True)) + +if __name__ == "__main__": + main() diff --git a/src/tests/ftest/cart/utils_test/set_other_env_vars.yaml b/src/tests/ftest/cart/utils_test/set_other_env_vars.yaml new file mode 100644 index 00000000000..efa6403dff0 --- /dev/null +++ b/src/tests/ftest/cart/utils_test/set_other_env_vars.yaml @@ -0,0 +1,13 @@ +defaultENV: + D_LOG_MASK: "WARN" + CRT_PHY_ADDR_STR: "ofi+sockets" + OFI_INTERFACE: "eth0" + CRT_CTX_NUM: "8" + CRT_CTX_SHARE_ADDR: "0" + other_env_vars: + - ARBITRARY_ENV_VAR1: apple + - ARBITRARY_ENV_VAR2: orange + - ARBITRARY_ENV_VAR3: banana pear +tests: !mux + set_other_env_vars: + name: set_other_env_var From 9430ca3d6a61f4d7e28ae177e04ad7afb15d2f4e Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Fri, 5 Feb 2021 00:12:35 +0000 Subject: [PATCH 07/34] CART-831 tests: main() is not needed Remedy this pylint error: (pylint-undefined-variable) Undefined variable 'main' Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- src/tests/ftest/cart/utils_test/set_other_env_vars.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/tests/ftest/cart/utils_test/set_other_env_vars.py b/src/tests/ftest/cart/utils_test/set_other_env_vars.py index 6536082a8a6..21d06d5feb2 100644 --- a/src/tests/ftest/cart/utils_test/set_other_env_vars.py +++ b/src/tests/ftest/cart/utils_test/set_other_env_vars.py @@ -68,6 +68,3 @@ def test_cart_no_pmix(self): self.utils.unset_other_env_vars(self) print("After unset_other_env_vars\n") print(subprocess.check_output("env", shell=True)) - -if __name__ == "__main__": - main() From 7cecc44656d8e965d3800ee1742d815b464f5bda Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Tue, 9 Feb 2021 03:45:07 +0000 Subject: [PATCH 08/34] CART-831 tests: Put all env vars in one yaml param YAML env var settings all go in one YAML param. The addition of new env vars will no longer require changes to cart_utils.py. Move env var processing to apricot/test.py setUp(), so that test writers don't need to call set_env routines in their test py scripts. Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- .../cart/corpc/cart_corpc_five_node.yaml | 15 ++++--- .../ftest/cart/corpc/cart_corpc_one_node.yaml | 15 ++++--- .../ftest/cart/corpc/cart_corpc_two_node.yaml | 15 ++++--- .../ftest/cart/ctl/cart_ctl_five_node.yaml | 17 ++++---- .../ftest/cart/ctl/cart_ctl_one_node.yaml | 17 ++++---- .../cart_ghost_rank_prc_one_node.yaml | 15 ++++--- .../ftest/cart/group_test/group_test.yaml | 11 ++--- src/tests/ftest/cart/iv/cart_iv_one_node.yaml | 17 ++++---- src/tests/ftest/cart/iv/cart_iv_two_node.yaml | 17 ++++---- .../no_pmix/cart_nopmix_multictx_one_node.py | 28 ++++++------ .../cart_nopmix_multictx_one_node.yaml | 16 ++++--- .../cart_nopmix_launcher_one_node.py | 8 ++-- .../cart_nopmix_launcher_one_node.yaml | 11 ++--- .../ftest/cart/rpc/cart_rpc_one_node.yaml | 19 ++++---- .../ftest/cart/rpc/cart_rpc_two_node.yaml | 17 ++++---- .../selftest/cart_selftest_three_node.yaml | 17 ++++---- src/tests/ftest/cart/util/cart_utils.py | 43 +++---------------- src/tests/ftest/util/apricot/apricot/test.py | 28 ++++++++++++ 18 files changed, 169 insertions(+), 157 deletions(-) diff --git a/src/tests/ftest/cart/corpc/cart_corpc_five_node.yaml b/src/tests/ftest/cart/corpc/cart_corpc_five_node.yaml index 6f72abc5163..f4f344a3821 100644 --- a/src/tests/ftest/cart/corpc/cart_corpc_five_node.yaml +++ b/src/tests/ftest/cart/corpc/cart_corpc_five_node.yaml @@ -1,13 +1,14 @@ # change host names to your reserved nodes, the # required quantity is indicated by the placeholders -defaultENV: - #!filter-only : /run/envs_CRT_CTX_SHARE_ADDR/no_sep - #!filter-only : /run/tests/corpc_prefwd - D_LOG_MASK: "WARN,CORPC=DEBUG" - CRT_PHY_ADDR_STR: "ofi+sockets" - OFI_INTERFACE: "eth0" - test_servers_CRT_CTX_NUM: "0" +ENV: + default: + #!filter-only : /run/envs_CRT_CTX_SHARE_ADDR/no_sep + #!filter-only : /run/tests/corpc_prefwd + - D_LOG_MASK: "WARN,CORPC=DEBUG" + - CRT_PHY_ADDR_STR: "ofi+sockets" + - OFI_INTERFACE: "eth0" + - test_servers_CRT_CTX_NUM: "0" env_CRT_CTX_SHARE_ADDR: !mux no_sep: env: no_sep diff --git a/src/tests/ftest/cart/corpc/cart_corpc_one_node.yaml b/src/tests/ftest/cart/corpc/cart_corpc_one_node.yaml index 34e38357db6..9221a5a6a3e 100644 --- a/src/tests/ftest/cart/corpc/cart_corpc_one_node.yaml +++ b/src/tests/ftest/cart/corpc/cart_corpc_one_node.yaml @@ -1,13 +1,14 @@ # change host names to your reserved nodes, the # required quantity is indicated by the placeholders -defaultENV: - #!filter-only : /run/envs_CRT_CTX_SHARE_ADDR/sep - #!filter-only : /run/tests/corpc_prefwd - D_LOG_MASK: "WARN,CORPC=DEBUG" - CRT_PHY_ADDR_STR: "ofi+sockets" - OFI_INTERFACE: "eth0" - test_servers_CRT_CTX_NUM: "16" +ENV: + default: + #!filter-only : /run/envs_CRT_CTX_SHARE_ADDR/sep + #!filter-only : /run/tests/corpc_prefwd + - D_LOG_MASK: "WARN,CORPC=DEBUG" + - CRT_PHY_ADDR_STR: "ofi+sockets" + - OFI_INTERFACE: "eth0" + - test_servers_CRT_CTX_NUM: "16" env_CRT_CTX_SHARE_ADDR: !mux sep: env: sep diff --git a/src/tests/ftest/cart/corpc/cart_corpc_two_node.yaml b/src/tests/ftest/cart/corpc/cart_corpc_two_node.yaml index ab2c16f2284..c9731c1ff7d 100644 --- a/src/tests/ftest/cart/corpc/cart_corpc_two_node.yaml +++ b/src/tests/ftest/cart/corpc/cart_corpc_two_node.yaml @@ -1,13 +1,14 @@ # change host names to your reserved nodes, the # required quantity is indicated by the placeholders -defaultENV: - #!filter-only : /run/envs_CRT_CTX_SHARE_ADDR/sep - #!filter-only : /run/tests/corpc_prefwd - D_LOG_MASK: "WARN,CORPC=DEBUG" - CRT_PHY_ADDR_STR: "ofi+sockets" - OFI_INTERFACE: "eth0" - test_servers_CRT_CTX_NUM: "16" +ENV: + default: + #!filter-only : /run/envs_CRT_CTX_SHARE_ADDR/sep + #!filter-only : /run/tests/corpc_prefwd + - D_LOG_MASK: "WARN,CORPC=DEBUG" + - CRT_PHY_ADDR_STR: "ofi+sockets" + - OFI_INTERFACE: "eth0" + - test_servers_CRT_CTX_NUM: "16" env_CRT_CTX_SHARE_ADDR: !mux sep: env: sep diff --git a/src/tests/ftest/cart/ctl/cart_ctl_five_node.yaml b/src/tests/ftest/cart/ctl/cart_ctl_five_node.yaml index 17472a350de..3b2f479d2fe 100644 --- a/src/tests/ftest/cart/ctl/cart_ctl_five_node.yaml +++ b/src/tests/ftest/cart/ctl/cart_ctl_five_node.yaml @@ -1,14 +1,15 @@ # change host names to your reserved nodes, the # required quantity is indicated by the placeholders -defaultENV: - #!filter-only : /run/env_CRT_CTX_SHARE_ADDR/sep - #!filter-only : /run/tests/ctl - D_LOG_MASK: "WARN" - CRT_PHY_ADDR_STR: "ofi+sockets" - OFI_INTERFACE: "eth0" - test_servers_CRT_CTX_NUM: "0" - test_clients_CRT_CTX_NUM: "0" +ENV: + default: + #!filter-only : /run/env_CRT_CTX_SHARE_ADDR/sep + #!filter-only : /run/tests/ctl + - D_LOG_MASK: "WARN" + - CRT_PHY_ADDR_STR: "ofi+sockets" + - OFI_INTERFACE: "eth0" + - test_servers_CRT_CTX_NUM: "0" + - test_clients_CRT_CTX_NUM: "0" env_CRT_CTX_SHARE_ADDR: !mux no_sep: env: no_sep diff --git a/src/tests/ftest/cart/ctl/cart_ctl_one_node.yaml b/src/tests/ftest/cart/ctl/cart_ctl_one_node.yaml index dd2635028ad..1f6c5ab148e 100644 --- a/src/tests/ftest/cart/ctl/cart_ctl_one_node.yaml +++ b/src/tests/ftest/cart/ctl/cart_ctl_one_node.yaml @@ -1,14 +1,15 @@ # change host names to your reserved nodes, the # required quantity is indicated by the placeholders -defaultENV: - #!filter-only : /run/env_CRT_CTX_SHARE_ADDR/sep - #!filter-only : /run/tests/ctl - D_LOG_MASK: "WARN" - CRT_PHY_ADDR_STR: "ofi+sockets" - OFI_INTERFACE: "eth0" - test_servers_CRT_CTX_NUM: "16" - test_clients_CRT_CTX_NUM: "16" +ENV: + default: + #!filter-only : /run/env_CRT_CTX_SHARE_ADDR/sep + #!filter-only : /run/tests/ctl + - D_LOG_MASK: "WARN" + - CRT_PHY_ADDR_STR: "ofi+sockets" + - OFI_INTERFACE: "eth0" + - test_servers_CRT_CTX_NUM: "16" + - test_clients_CRT_CTX_NUM: "16" env_CRT_CTX_SHARE_ADDR: !mux sep: env: sep diff --git a/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.yaml b/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.yaml index 764103432dd..a41ca0bbe87 100644 --- a/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.yaml +++ b/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.yaml @@ -1,13 +1,14 @@ # change host names to your reserved nodes, the # required quantity is indicated by the placeholders -defaultENV: - #!filter-only : /run/envs_CRT_CTX_SHARE_ADDR/sep - #!filter-only : /run/tests/corpc_prefwd - D_LOG_MASK: "WARN,RPC=DEBUG,HG=DEBUG" - CRT_PHY_ADDR_STR: "ofi+sockets" - OFI_INTERFACE: "eth0" - test_servers_CRT_CTX_NUM: "16" +ENV: + default: + #!filter-only : /run/envs_CRT_CTX_SHARE_ADDR/sep + #!filter-only : /run/tests/corpc_prefwd + - D_LOG_MASK: "WARN,RPC=DEBUG,HG=DEBUG" + - CRT_PHY_ADDR_STR: "ofi+sockets" + - OFI_INTERFACE: "eth0" + - test_servers_CRT_CTX_NUM: "16" env_CRT_CTX_SHARE_ADDR: !mux sep: env: sep diff --git a/src/tests/ftest/cart/group_test/group_test.yaml b/src/tests/ftest/cart/group_test/group_test.yaml index b1494cc0abf..f7432d3ab56 100644 --- a/src/tests/ftest/cart/group_test/group_test.yaml +++ b/src/tests/ftest/cart/group_test/group_test.yaml @@ -1,11 +1,12 @@ # change host names to your reserved nodes, the # required quantity is indicated by the placeholders -defaultENV: - #!filter-only : /run/tests/no_pmix_launcher - D_LOG_MASK: "WARN,RPC=DEBUG,HG=DEBUG" - CRT_PHY_ADDR_STR: "ofi+sockets" - OFI_INTERFACE: "eth0" +ENV: + default: + #!filter-only : /run/tests/no_pmix_launcher + - D_LOG_MASK: "WARN,RPC=DEBUG,HG=DEBUG" + - CRT_PHY_ADDR_STR: "ofi+sockets" + - OFI_INTERFACE: "eth0" hosts: !mux hosts_1: config: one_node diff --git a/src/tests/ftest/cart/iv/cart_iv_one_node.yaml b/src/tests/ftest/cart/iv/cart_iv_one_node.yaml index b12ea20236e..f940f667325 100644 --- a/src/tests/ftest/cart/iv/cart_iv_one_node.yaml +++ b/src/tests/ftest/cart/iv/cart_iv_one_node.yaml @@ -1,14 +1,15 @@ # change host names to your reserved nodes, the # required quantity is indicated by the placeholders -defaultENV: - #!filter-only : /run/env_CRT_CTX_SHARE_ADDR/no_sep - #!filter-only : /run/tests/iv - D_LOG_MASK: "WARN,IV=DEBUG" - CRT_PHY_ADDR_STR: "ofi+sockets" - OFI_INTERFACE: "eth0" - test_servers_CRT_CTX_NUM: "2" - test_clients_CRT_CTX_NUM: "2" +ENV: + default: + #!filter-only : /run/env_CRT_CTX_SHARE_ADDR/no_sep + #!filter-only : /run/tests/iv + - D_LOG_MASK: "WARN,IV=DEBUG" + - CRT_PHY_ADDR_STR: "ofi+sockets" + - OFI_INTERFACE: "eth0" + - test_servers_CRT_CTX_NUM: "2" + - test_clients_CRT_CTX_NUM: "2" env_CRT_CTX_SHARE_ADDR: !mux sep: env: sep diff --git a/src/tests/ftest/cart/iv/cart_iv_two_node.yaml b/src/tests/ftest/cart/iv/cart_iv_two_node.yaml index 175bf950543..7b6d4308295 100644 --- a/src/tests/ftest/cart/iv/cart_iv_two_node.yaml +++ b/src/tests/ftest/cart/iv/cart_iv_two_node.yaml @@ -1,14 +1,15 @@ # change host names to your reserved nodes, the # required quantity is indicated by the placeholders -defaultENV: - #!filter-only : /run/env_CRT_CTX_SHARE_ADDR/no_sep - #!filter-only : /run/tests/iv - D_LOG_MASK: "WARN,IV=DEBUG" - CRT_PHY_ADDR_STR: "ofi+sockets" - OFI_INTERFACE: "eth0" - test_servers_CRT_CTX_NUM: "2" - test_clients_CRT_CTX_NUM: "2" +ENV: + default: + #!filter-only : /run/env_CRT_CTX_SHARE_ADDR/no_sep + #!filter-only : /run/tests/iv + - D_LOG_MASK: "WARN,IV=DEBUG" + - CRT_PHY_ADDR_STR: "ofi+sockets" + - OFI_INTERFACE: "eth0" + - test_servers_CRT_CTX_NUM: "2" + - test_clients_CRT_CTX_NUM: "2" env_CRT_CTX_SHARE_ADDR: !mux sep: env: sep diff --git a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py index b68e87fe69d..e5eb0b50438 100755 --- a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py +++ b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py @@ -26,8 +26,9 @@ import sys import subprocess +import os -from apricot import TestWithoutServers +from apricot import TestWithoutServers sys.path.append('./util') @@ -45,16 +46,7 @@ def setUp(self): """ Test setup """ print("Running setup\n") self.utils = CartUtils() - self.env = self.utils.get_env(self) - crt_phy_addr = self.params.get("CRT_PHY_ADDR_STR", '/run/defaultENV/') - ofi_interface = self.params.get("OFI_INTERFACE", '/run/defaultENV/') - ofi_ctx_num = self.params.get("CRT_CTX_NUM", '/run/defaultENV/') - ofi_share_addr = self.params.get("CRT_CTX_SHARE_ADDR", - '/run/defaultENV/') - self.pass_env = {"CRT_PHY_ADDR_STR": crt_phy_addr, - "OFI_INTERFACE": ofi_interface, - "CRT_CTX_SHARE_ADDR": ofi_share_addr, - "CRT_CTX_NUM": ofi_ctx_num} + super(CartNoPmixOneNodeTest, self).setUp() def tearDown(self): """ Tear down """ @@ -69,6 +61,16 @@ def test_cart_no_pmix(self): :avocado: tags=all,cart,pr,daily_regression,no_pmix,one_node """ + crt_phy_addr = os.environ["CRT_PHY_ADDR_STR"] + ofi_interface = os.environ["OFI_INTERFACE"] + ofi_ctx_num = os.environ["CRT_CTX_NUM"] + ofi_share_addr = os.environ["CRT_CTX_SHARE_ADDR"] + + self.pass_env = {"CRT_PHY_ADDR_STR": crt_phy_addr, + "OFI_INTERFACE": ofi_interface, + "CRT_CTX_SHARE_ADDR": ofi_share_addr, + "CRT_CTX_NUM": ofi_ctx_num} + cmd = self.params.get("tst_bin", '/run/tests/*/') self.utils.print("\nTest cmd : %s\n" % cmd) @@ -83,7 +85,3 @@ def test_cart_no_pmix(self): self.fail("Test failed.\n") self.utils.print("Finished waiting for {}".format(p)) - - -if __name__ == "__main__": - main() diff --git a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml index 06c51b901e1..d02602bb4f3 100644 --- a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml +++ b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.yaml @@ -1,13 +1,15 @@ # change host names to your reserved nodes, the # required quantity is indicated by the placeholders -defaultENV: - #!filter-only : /run/tests/no_pmix_multi_ctx - D_LOG_MASK: "WARN" - CRT_PHY_ADDR_STR: "ofi+sockets" - OFI_INTERFACE: "eth0" - CRT_CTX_NUM: "8" - CRT_CTX_SHARE_ADDR: "0" +ENV: + default: + #!filter-only : /run/env_CRT_CTX_SHARE_ADDR/sep + #!filter-only : /run/tests/rpc_error + - D_LOG_MASK: "WARN" + - CRT_PHY_ADDR_STR: "ofi+sockets" + - OFI_INTERFACE: "eth0" + - CRT_CTX_NUM: "8" + - CRT_CTX_SHARE_ADDR: "0" tests: !mux no_pmix_multi_ctx: name: no_pmix_multi_ctx diff --git a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py index 40af833ee79..9d4ba3c28c5 100755 --- a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py +++ b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py @@ -61,10 +61,10 @@ def test_cart_no_pmix_launcher(self): cli_bin = self.params.get("test_clients_bin", '/run/tests/*/') cli_arg = self.params.get("test_clients_arg", '/run/tests/*/') cli_ppn = self.params.get("test_clients_ppn", '/run/tests/*/') - log_mask = self.params.get("D_LOG_MASK", "/run/defaultENV/") - crt_phy_addr = self.params.get("CRT_PHY_ADDR_STR", - "/run/defaultENV/") - ofi_interface = self.params.get("OFI_INTERFACE", "/run/defaultENV/") + + log_mask = os.environ["D_LOG_MASK"] + crt_phy_addr = os.environ["CRT_PHY_ADDR_STR"] + ofi_interface = os.environ["OFI_INTERFACE"] srv_cmd = self.utils.build_cmd(self, self.env, "test_servers") diff --git a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.yaml b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.yaml index 686b84f7ca9..08cadc4b719 100644 --- a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.yaml +++ b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.yaml @@ -1,11 +1,12 @@ # change host names to your reserved nodes, the # required quantity is indicated by the placeholders -defaultENV: - #!filter-only : /run/tests/no_pmix_launcher - D_LOG_MASK: "WARN" - CRT_PHY_ADDR_STR: "ofi+sockets" - OFI_INTERFACE: "eth0" +ENV: + default: + #!filter-only : /run/tests/no_pmix_launcher + - D_LOG_MASK: "WARN" + - CRT_PHY_ADDR_STR: "ofi+sockets" + - OFI_INTERFACE: "eth0" hosts: !mux hosts_1: config: one_node diff --git a/src/tests/ftest/cart/rpc/cart_rpc_one_node.yaml b/src/tests/ftest/cart/rpc/cart_rpc_one_node.yaml index 05913bf6d38..e9eb10537d4 100644 --- a/src/tests/ftest/cart/rpc/cart_rpc_one_node.yaml +++ b/src/tests/ftest/cart/rpc/cart_rpc_one_node.yaml @@ -1,14 +1,17 @@ # change host names to your reserved nodes, the # required quantity is indicated by the placeholders -defaultENV: - #!filter-only : /run/env_CRT_CTX_SHARE_ADDR/sep - #!filter-only : /run/tests/proto_np - D_LOG_MASK: "WARN,RPC=DEBUG,HG=DEBUG" - CRT_PHY_ADDR_STR: "ofi+sockets" - OFI_INTERFACE: "eth0" - test_servers_CRT_CTX_NUM: "16" - test_clients_CRT_CTX_NUM: "16" +customENV: + MY_CUSTOM_ENV: "pineapple" +ENV: + default: + #!filter-only : /run/env_CRT_CTX_SHARE_ADDR/sep + #!filter-only : /run/tests/proto_np + - D_LOG_MASK: "WARN,RPC=DEBUG,HG=DEBUG" + - CRT_PHY_ADDR_STR: "ofi+sockets" + - OFI_INTERFACE: "eth0" + - test_servers_CRT_CTX_NUM: "16" + - test_clients_CRT_CTX_NUM: "16" env_CRT_CTX_SHARE_ADDR: !mux sep: env: sep diff --git a/src/tests/ftest/cart/rpc/cart_rpc_two_node.yaml b/src/tests/ftest/cart/rpc/cart_rpc_two_node.yaml index a2c772ba850..ae3c0dd7e61 100644 --- a/src/tests/ftest/cart/rpc/cart_rpc_two_node.yaml +++ b/src/tests/ftest/cart/rpc/cart_rpc_two_node.yaml @@ -1,14 +1,15 @@ # change host names to your reserved nodes, the # required quantity is indicated by the placeholders -defaultENV: - #!filter-only : /run/env_CRT_CTX_SHARE_ADDR/sep - #!filter-only : /run/tests/rpc_error - D_LOG_MASK: "WARN,RPC=DEBUG,HG=DEBUG" - CRT_PHY_ADDR_STR: "ofi+sockets" - OFI_INTERFACE: "eth0" - test_servers_CRT_CTX_NUM: "16" - test_clients_CRT_CTX_NUM: "16" +ENV: + default: + #!filter-only : /run/env_CRT_CTX_SHARE_ADDR/sep + #!filter-only : /run/tests/rpc_error + - D_LOG_MASK: "WARN,RPC=DEBUG,HG=DEBUG" + - CRT_PHY_ADDR_STR: "ofi+sockets" + - OFI_INTERFACE: "eth0" + - test_servers_CRT_CTX_NUM: "16" + - test_clients_CRT_CTX_NUM: "16" env_CRT_CTX_SHARE_ADDR: !mux sep: env: sep diff --git a/src/tests/ftest/cart/selftest/cart_selftest_three_node.yaml b/src/tests/ftest/cart/selftest/cart_selftest_three_node.yaml index 08e8ee71acb..fe5617d8236 100644 --- a/src/tests/ftest/cart/selftest/cart_selftest_three_node.yaml +++ b/src/tests/ftest/cart/selftest/cart_selftest_three_node.yaml @@ -1,14 +1,15 @@ # change host names to your reserved nodes, the # required quantity is indicated by the placeholders -defaultENV: - #!filter-only : /run/env_CRT_CTX_SHARE_ADDR/no_sep - #!filter-only : /run/tests/self_np - D_LOG_MASK: "WARN" - CRT_PHY_ADDR_STR: "ofi+sockets" - OFI_INTERFACE: "eth0" - test_servers_CRT_CTX_NUM: "16" - test_clients_CRT_CTX_NUM: "16" +ENV: + default: + #!filter-only : /run/env_CRT_CTX_SHARE_ADDR/no_sep + #!filter-only : /run/tests/self_np + - D_LOG_MASK: "WARN" + - CRT_PHY_ADDR_STR: "ofi+sockets" + - OFI_INTERFACE: "eth0" + - test_servers_CRT_CTX_NUM: "16" + - test_clients_CRT_CTX_NUM: "16" env_CRT_CTX_SHARE_ADDR: !mux sep: env: sep diff --git a/src/tests/ftest/cart/util/cart_utils.py b/src/tests/ftest/cart/util/cart_utils.py index 74649d4fd08..16510e7d31e 100755 --- a/src/tests/ftest/cart/util/cart_utils.py +++ b/src/tests/ftest/cart/util/cart_utils.py @@ -105,34 +105,6 @@ def stop_process(proc): return procrtn - @staticmethod - def set_other_env_vars(cartobj): - """ import env vars from other_env_var param """ - other_env_vars = cartobj.params.get("other_env_vars", - "/run/defaultENV/") - if other_env_vars is None: - print("other_env_vars was not set in yaml file.\n") - return - - for kv_pair in other_env_vars: - key, value = kv_pair[0] - print("Adding {}={} to environment.\n".format(key, value)) - os.environ[key] = value - - @staticmethod - def unset_other_env_vars(cartobj): - """ import env vars from other_env_var param """ - other_env_vars = cartobj.params.get("other_env_vars", - "/run/defaultENV/") - if other_env_vars is None: - print("other_env_vars was not set in yaml file.\n") - return - - for kv_pair in other_env_vars: - key = kv_pair[0][0] - print("Removing key {} from environment.\n".format(key)) - del os.environ[key] - # What is special about pylint's 15 variable limit? # pylint: disable=too-many-locals def get_env(self, cartobj): @@ -157,13 +129,11 @@ def get_env(self, cartobj): log_file = os.path.join(log_path, log_dir, test_name + "_" + env_CCSA + "_cart.log") - log_mask = cartobj.params.get("D_LOG_MASK", "/run/defaultENV/") - self.provider = cartobj.params.get("CRT_PHY_ADDR_STR", - "/run/defaultENV/") - ofi_interface = cartobj.params.get("OFI_INTERFACE", "/run/defaultENV/") - ofi_domain = cartobj.params.get("OFI_DOMAIN", "/run/defaultENV/") - ofi_share_addr = cartobj.params.get("CRT_CTX_SHARE_ADDR", - "/run/env_CRT_CTX_SHARE_ADDR/*/") + log_mask = os.environ["D_LOG_MASK"] + self.provider = os.environ["CRT_PHY_ADDR_STR"] + ofi_interface = os.environ["OFI_INTERFACE"] + ofi_domain = os.environ["OFI_DOMAIN"] + ofi_share_addr = os.environ["CRT_CTX_SHARE_ADDR"] # Do not use the standard .log file extension, otherwise it'll get # removed (cleaned up for disk space savings) before we can archive it. @@ -268,8 +238,7 @@ def build_cmd(self, cartobj, env, host, **kwargs): "/run/tests/*/") _tst_slt = cartobj.params.get("{}_slt".format(host), "/run/tests/*/") - _tst_ctx = cartobj.params.get("{}_CRT_CTX_NUM".format(host), - "/run/defaultENV/") + _tst_ctx = os.environ["{}_CRT_CTX_NUM".format(host)] # If the yaml parameter is a list, return the n-th element tst_bin = self.get_yaml_list_elem(_tst_bin, index) diff --git a/src/tests/ftest/util/apricot/apricot/test.py b/src/tests/ftest/util/apricot/apricot/test.py index b40f0ee39a4..03ca038b044 100644 --- a/src/tests/ftest/util/apricot/apricot/test.py +++ b/src/tests/ftest/util/apricot/apricot/test.py @@ -359,6 +359,21 @@ def setUp(self): self.d_log = DaosLog(self.context) self.test_log.daos_log = self.d_log + # import and set env vars from yaml file + defaultENV = self.params.get("default", "/run/ENV/") + if defaultENV is None: + print("defaultENV was not set in yaml file.\n") + return + + for kv_pair in defaultENV: + key, value = kv_pair[0] + print("Adding {}={} to environment.\n".format(key, value)) + os.environ[key] = value + + # For compatibility with cart tests, whch set env vars in oretrun + # command via -x options + self.env = os.environ + def tearDown(self): """Tear down after each test case.""" self.report_timeout() @@ -373,6 +388,19 @@ def tearDown(self): super(TestWithoutServers, self).tearDown() + def unset_other_env_vars(self): + """ import env vars from other_env_var param """ + defaultENV = self.params.get("default", "/run/ENV/") + if defaultENV is None: + print("defaultENV was not set in yaml file.\n") + return + + for kv_pair in defaultENV: + key = kv_pair[0][0] + print("Removing key {} from environment.\n".format(key)) + del os.environ[key] + + class TestWithServers(TestWithoutServers): # pylint: disable=too-many-public-methods """Run tests with DAOS servers and at least one client. From 862cfdee968537bceb3a1a780319c4e299c1f00a Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Tue, 9 Feb 2021 15:50:29 +0000 Subject: [PATCH 09/34] CART-831 tests: Merge master. Rerun CI tests. Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove From e2f522d7e1d6b30576594819b4ed5325712506b8 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Tue, 9 Feb 2021 21:06:20 +0000 Subject: [PATCH 10/34] CART-831 tests: Protect against null env vars Protect against null env vars (which result in Python fatal KeyError's). Set most common values as defaults. Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- src/tests/ftest/cart/util/cart_utils.py | 31 ++++++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/tests/ftest/cart/util/cart_utils.py b/src/tests/ftest/cart/util/cart_utils.py index fe96427c328..c086c3277b0 100755 --- a/src/tests/ftest/cart/util/cart_utils.py +++ b/src/tests/ftest/cart/util/cart_utils.py @@ -112,11 +112,27 @@ def get_env(self, cartobj): log_file = os.path.join(log_path, log_dir, test_name + "_" + env_CCSA + "_cart.log") - log_mask = os.environ["D_LOG_MASK"] - self.provider = os.environ["CRT_PHY_ADDR_STR"] - ofi_interface = os.environ["OFI_INTERFACE"] - ofi_domain = os.environ["OFI_DOMAIN"] - ofi_share_addr = os.environ["CRT_CTX_SHARE_ADDR"] + # Default env vars for orterun + log_mask = "WARN" + self.provider = "ofi+sockets" + ofi_interface = "eth0" + ofi_domain = "mlx5_0" + ofi_share_addr = "0" + + if "D_LOG_MASK" in os.environ: + log_mask = os.environ["D_LOG_MASK"] + + if "CRT_PHY_ADDR_STR" in os.environ: + self.provider = os.environ["CRT_PHY_ADDR_STR"] + + if "OFI_INTERFACE" in os.environ: + ofi_interface = os.environ["OFI_INTERFACE"] + + if "OFI_DOMAIN" in os.environ: + ofi_domain = os.environ["OFI_DOMAIN"] + + if "CRT_CTX_SHARE_ADDR" in os.environ: + ofi_share_addr = os.environ["CRT_CTX_SHARE_ADDR"] # Do not use the standard .log file extension, otherwise it'll get # removed (cleaned up for disk space savings) before we can archive it. @@ -221,7 +237,10 @@ def build_cmd(self, cartobj, env, host, **kwargs): "/run/tests/*/") _tst_slt = cartobj.params.get("{}_slt".format(host), "/run/tests/*/") - _tst_ctx = os.environ["{}_CRT_CTX_NUM".format(host)] + + _tst_ctx = "16" + if "{}_CRT_CTX_NUM".format(host) in os.environ: + _tst_ctx = os.environ["{}_CRT_CTX_NUM".format(host)] # If the yaml parameter is a list, return the n-th element tst_bin = self.get_yaml_list_elem(_tst_bin, index) From e1f9f3c094d9cabcab4a78848bb3e30a7439d0b5 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Wed, 10 Feb 2021 15:49:52 +0000 Subject: [PATCH 11/34] CART-831 tests: Remove set_other_env_vars script Remove set_other_env_vars script -- demonstration code is in all other cart python test scripts. (Jenkins dashboard showed for previous run "Jenkins will shutdown". Re-run.) Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- .../cart/utils_test/set_other_env_vars.py | 70 ------------------- 1 file changed, 70 deletions(-) delete mode 100644 src/tests/ftest/cart/utils_test/set_other_env_vars.py diff --git a/src/tests/ftest/cart/utils_test/set_other_env_vars.py b/src/tests/ftest/cart/utils_test/set_other_env_vars.py deleted file mode 100644 index 21d06d5feb2..00000000000 --- a/src/tests/ftest/cart/utils_test/set_other_env_vars.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/python -''' - (C) Copyright 2018-2021 Intel Corporation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE - The Government's rights to use, modify, reproduce, release, perform, display, - or disclose this software are subject to the terms of the Apache License as - provided in Contract No. B609815. - Any reproduction of computer software, computer software documentation, or - portions thereof marked with this legend must also reproduce the markings. -''' - -from __future__ import print_function - -import sys -import subprocess - -from apricot import TestWithoutServers - -sys.path.append('./util') - -# Can't all this import before setting sys.path -# pylint: disable=wrong-import-position -from cart_utils import CartUtils - -class SetOtherEnvVars(TestWithoutServers): - """ - Runs basic test of cart_utils.py:set_other_env_vars - - :avocado: recursive - """ - def setUp(self): - """ Test setup """ - print("Running setup\n") - self.utils = CartUtils() - - def tearDown(self): - """ Tear down """ - print("Running tearDown\n") - - def test_cart_no_pmix(self): - """ - Test set_other_env_vars - - :avocado: tags=set_other_env_vars - """ - - print("Before set_other_env_vars\n") - print(subprocess.check_output("env", shell=True)) - self.utils.set_other_env_vars(self) - print("After set_other_env_vars\n") - print(subprocess.check_output("env", shell=True)) - - print("Before unset_other_env_vars\n") - print(subprocess.check_output("env", shell=True)) - self.utils.unset_other_env_vars(self) - print("After unset_other_env_vars\n") - print(subprocess.check_output("env", shell=True)) From 6cc1e12e66e6d772ce85cd271c72b68d3c998a7d Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Wed, 10 Feb 2021 22:23:58 +0000 Subject: [PATCH 12/34] CART-654 tests: Artifact archival issue? Re-try. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Something seems to have gone wrong in the Jenkins artifact archival step. Fourteen avocado run commands dislpay in the consoleText, but then there's a hudson Exception: ``` Archiving artifacts ‘Functional on CentOS 7/**’ doesn’t match anything, but ‘**’ does. Perhaps that’s what you mean? Error when executing always post condition: hudson.AbortException: No artifacts found that match the file pattern "Functional on CentOS 7/**". Configuration error? at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:280) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:99) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:69) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove From 7910a54ba3b0d9002bd8e2a5a898926c929de631 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Thu, 11 Feb 2021 02:59:39 +0000 Subject: [PATCH 13/34] CART-831 tests: merge w/ master, and re-run. Need to get artifact archiver patch in. Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove From 5bc5d572c7b514b5bbd58b338042489576191a58 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Thu, 11 Feb 2021 14:11:55 +0000 Subject: [PATCH 14/34] CART-831 tests: Merge w/ master. Re-run. Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove From 0c9c262e86e35502c220310213cd7f736f706e8e Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Thu, 11 Feb 2021 18:02:27 +0000 Subject: [PATCH 15/34] CART-831 tests: orterun CLI vars default to None Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- src/tests/ftest/cart/util/cart_utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tests/ftest/cart/util/cart_utils.py b/src/tests/ftest/cart/util/cart_utils.py index 45ad53d852a..10192dbee4e 100755 --- a/src/tests/ftest/cart/util/cart_utils.py +++ b/src/tests/ftest/cart/util/cart_utils.py @@ -134,12 +134,12 @@ def get_env(self, cartobj): log_file = os.path.join(log_path, log_dir, test_name + "_" + env_CCSA + "_cart.log") - # Default env vars for orterun - log_mask = "WARN" - self.provider = "ofi+sockets" - ofi_interface = "eth0" - ofi_domain = "mlx5_0" - ofi_share_addr = "0" + # Default env vars for orterun to None + log_mask = None + self.provider = None + ofi_interface = None + ofi_domain = None + ofi_share_addr = None if "D_LOG_MASK" in os.environ: log_mask = os.environ["D_LOG_MASK"] From 502210c392d62bda1350136179fc892be4757349 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Tue, 16 Feb 2021 16:03:07 +0000 Subject: [PATCH 16/34] CART-831 tests: Merge w/ master. Re-run. Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove From fd6637a2686dc4275bedf038ec686998b728c3c7 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Tue, 16 Feb 2021 20:46:24 +0000 Subject: [PATCH 17/34] CART-831 tests: Oops -- missing "import os" Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- .../ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py index 16aef990ec4..3340eb9d562 100755 --- a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py +++ b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py @@ -7,6 +7,7 @@ from __future__ import print_function +import os import sys from apricot import TestWithoutServers From 2e2ffda8d9f43d13df938523d093b11975bde3ed Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Tue, 16 Feb 2021 20:56:21 +0000 Subject: [PATCH 18/34] CART-831 tests: no camelCase, no aligning on '=' Various pylint issues: - Not allowed to visually align assignments (on '=') - Not allowed to use camelCase, e.g., defaultENV? - Spelling error whch => which Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- .../cart_nopmix_launcher_one_node.py | 4 ++-- src/tests/ftest/cart/util/cart_utils.py | 8 ++++---- src/tests/ftest/util/apricot/apricot/test.py | 18 +++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py index 3340eb9d562..906897eb14f 100755 --- a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py +++ b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py @@ -47,8 +47,8 @@ def test_cart_no_pmix_launcher(self): cli_arg = self.params.get("test_clients_arg", '/run/tests/*/') cli_ppn = self.params.get("test_clients_ppn", '/run/tests/*/') - log_mask = os.environ["D_LOG_MASK"] - crt_phy_addr = os.environ["CRT_PHY_ADDR_STR"] + log_mask = os.environ["D_LOG_MASK"] + crt_phy_addr = os.environ["CRT_PHY_ADDR_STR"] ofi_interface = os.environ["OFI_INTERFACE"] srv_cmd = self.utils.build_cmd(self, self.env, "test_servers") diff --git a/src/tests/ftest/cart/util/cart_utils.py b/src/tests/ftest/cart/util/cart_utils.py index 10192dbee4e..ccf262a6214 100755 --- a/src/tests/ftest/cart/util/cart_utils.py +++ b/src/tests/ftest/cart/util/cart_utils.py @@ -135,10 +135,10 @@ def get_env(self, cartobj): test_name + "_" + env_CCSA + "_cart.log") # Default env vars for orterun to None - log_mask = None - self.provider = None - ofi_interface = None - ofi_domain = None + log_mask = None + self.provider = None + ofi_interface = None + ofi_domain = None ofi_share_addr = None if "D_LOG_MASK" in os.environ: diff --git a/src/tests/ftest/util/apricot/apricot/test.py b/src/tests/ftest/util/apricot/apricot/test.py index fa8a756f344..9190b170971 100644 --- a/src/tests/ftest/util/apricot/apricot/test.py +++ b/src/tests/ftest/util/apricot/apricot/test.py @@ -353,17 +353,17 @@ def setUp(self): self.test_log.daos_log = self.d_log # import and set env vars from yaml file - defaultENV = self.params.get("default", "/run/ENV/") - if defaultENV is None: - print("defaultENV was not set in yaml file.\n") + default_env = self.params.get("default", "/run/ENV/") + if default_env is None: + print("default_env was not set in yaml file.\n") return - for kv_pair in defaultENV: + for kv_pair in default_env: key, value = kv_pair[0] print("Adding {}={} to environment.\n".format(key, value)) os.environ[key] = value - # For compatibility with cart tests, whch set env vars in oretrun + # For compatibility with cart tests, which set env vars in oretrun # command via -x options self.env = os.environ @@ -396,12 +396,12 @@ def stop_leftover_processes(self, processes, hosts): def unset_other_env_vars(self): """ import env vars from other_env_var param """ - defaultENV = self.params.get("default", "/run/ENV/") - if defaultENV is None: - print("defaultENV was not set in yaml file.\n") + default_env = self.params.get("default", "/run/ENV/") + if default_env is None: + print("default_env was not set in yaml file.\n") return - for kv_pair in defaultENV: + for kv_pair in default_env: key = kv_pair[0][0] print("Removing key {} from environment.\n".format(key)) del os.environ[key] From 8588d5e579d83ba71af5cb836c56d225c66cf33c Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Tue, 16 Feb 2021 21:01:45 +0000 Subject: [PATCH 19/34] CART-831 tests: pylint dislikes visual (=) align Again, pylint dislikes visual alignment on (=) assignments. Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- .../ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py index 9890f59f762..0d2062cf1e0 100755 --- a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py +++ b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py @@ -44,9 +44,9 @@ def test_cart_no_pmix(self): :avocado: tags=all,cart,pr,daily_regression,no_pmix,one_node """ - crt_phy_addr = os.environ["CRT_PHY_ADDR_STR"] - ofi_interface = os.environ["OFI_INTERFACE"] - ofi_ctx_num = os.environ["CRT_CTX_NUM"] + crt_phy_addr = os.environ["CRT_PHY_ADDR_STR"] + ofi_interface = os.environ["OFI_INTERFACE"] + ofi_ctx_num = os.environ["CRT_CTX_NUM"] ofi_share_addr = os.environ["CRT_CTX_SHARE_ADDR"] self.pass_env = {"CRT_PHY_ADDR_STR": crt_phy_addr, From 69f6b9ee66d4ba9ddfdacf4e29ea0bb1b6bb9bbf Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Tue, 16 Feb 2021 21:18:05 +0000 Subject: [PATCH 20/34] CART-831 tests: Pylint dislikes os.environ["F"] VSCode doesn't show this pylint message, but daosbuild1 does: (pylint-undefined-variable) Undefined variable 'os' Perhaps it's caused by directly accessing the os.environ dict? Try using os.environ.get("FOO") instead of os.environ["FOO"]. Example daosbuild1 error: https://github.com/daos-stack/daos/pull/4445/files#r574227029 Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- .../cart/no_pmix/cart_nopmix_multictx_one_node.py | 8 ++++---- .../nopmix_launcher/cart_nopmix_launcher_one_node.py | 6 +++--- src/tests/ftest/cart/util/cart_utils.py | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py index 0d2062cf1e0..87fc4ef7364 100755 --- a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py +++ b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py @@ -44,10 +44,10 @@ def test_cart_no_pmix(self): :avocado: tags=all,cart,pr,daily_regression,no_pmix,one_node """ - crt_phy_addr = os.environ["CRT_PHY_ADDR_STR"] - ofi_interface = os.environ["OFI_INTERFACE"] - ofi_ctx_num = os.environ["CRT_CTX_NUM"] - ofi_share_addr = os.environ["CRT_CTX_SHARE_ADDR"] + crt_phy_addr = os.environ.get("CRT_PHY_ADDR_STR") + ofi_interface = os.environ.get("OFI_INTERFACE") + ofi_ctx_num = os.environ.get("CRT_CTX_NUM") + ofi_share_addr = os.environ.get("CRT_CTX_SHARE_ADDR") self.pass_env = {"CRT_PHY_ADDR_STR": crt_phy_addr, "OFI_INTERFACE": ofi_interface, diff --git a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py index 906897eb14f..a7a3d5606be 100755 --- a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py +++ b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py @@ -47,9 +47,9 @@ def test_cart_no_pmix_launcher(self): cli_arg = self.params.get("test_clients_arg", '/run/tests/*/') cli_ppn = self.params.get("test_clients_ppn", '/run/tests/*/') - log_mask = os.environ["D_LOG_MASK"] - crt_phy_addr = os.environ["CRT_PHY_ADDR_STR"] - ofi_interface = os.environ["OFI_INTERFACE"] + log_mask = os.environ.get("D_LOG_MASK") + crt_phy_addr = os.environ.get("CRT_PHY_ADDR_STR") + ofi_interface = os.environ.get("OFI_INTERFACE") srv_cmd = self.utils.build_cmd(self, self.env, "test_servers") diff --git a/src/tests/ftest/cart/util/cart_utils.py b/src/tests/ftest/cart/util/cart_utils.py index ccf262a6214..6f1887b33c0 100755 --- a/src/tests/ftest/cart/util/cart_utils.py +++ b/src/tests/ftest/cart/util/cart_utils.py @@ -142,19 +142,19 @@ def get_env(self, cartobj): ofi_share_addr = None if "D_LOG_MASK" in os.environ: - log_mask = os.environ["D_LOG_MASK"] + log_mask = os.environ.get("D_LOG_MASK") if "CRT_PHY_ADDR_STR" in os.environ: - self.provider = os.environ["CRT_PHY_ADDR_STR"] + self.provider = os.environ.get("CRT_PHY_ADDR_STR") if "OFI_INTERFACE" in os.environ: - ofi_interface = os.environ["OFI_INTERFACE"] + ofi_interface = os.environ.get("OFI_INTERFACE") if "OFI_DOMAIN" in os.environ: - ofi_domain = os.environ["OFI_DOMAIN"] + ofi_domain = os.environ.get("OFI_DOMAIN") if "CRT_CTX_SHARE_ADDR" in os.environ: - ofi_share_addr = os.environ["CRT_CTX_SHARE_ADDR"] + ofi_share_addr = os.environ.get("CRT_CTX_SHARE_ADDR") # Do not use the standard .log file extension, otherwise it'll get # removed (cleaned up for disk space savings) before we can archive it. From 903c4a599ffb355b0c9d9c88a070a46ba17653fe Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Wed, 17 Feb 2021 19:45:12 +0000 Subject: [PATCH 21/34] CART-831 tests: pass_env needn't be class member Fix pylint message: (pylint-attribute-defined-outside-init) Attribute 'pass_env' defined outside init Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- .../cart/no_pmix/cart_nopmix_multictx_one_node.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py index 87fc4ef7364..d83f985a2ad 100755 --- a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py +++ b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py @@ -49,16 +49,16 @@ def test_cart_no_pmix(self): ofi_ctx_num = os.environ.get("CRT_CTX_NUM") ofi_share_addr = os.environ.get("CRT_CTX_SHARE_ADDR") - self.pass_env = {"CRT_PHY_ADDR_STR": crt_phy_addr, - "OFI_INTERFACE": ofi_interface, - "CRT_CTX_SHARE_ADDR": ofi_share_addr, - "CRT_CTX_NUM": ofi_ctx_num} + pass_env = {"CRT_PHY_ADDR_STR": crt_phy_addr, + "OFI_INTERFACE": ofi_interface, + "CRT_CTX_SHARE_ADDR": ofi_share_addr, + "CRT_CTX_NUM": ofi_ctx_num} cmd = self.params.get("tst_bin", '/run/tests/*/') self.utils.print("\nTest cmd : %s\n" % cmd) - test_env = self.pass_env + test_env = pass_env p = subprocess.Popen([cmd], env=test_env, stdout=subprocess.PIPE) rc = self.utils.wait_process(p, 30) From 5c75a2ee0fe09e946ce34255107ea1deb22c45fd Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Wed, 17 Feb 2021 19:46:43 +0000 Subject: [PATCH 22/34] CART-831 tests: Adjust skip- pragmas Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove From 25412f9bdc942cdc01f7781a8dbe35bc901ebe7a Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Tue, 23 Feb 2021 18:44:55 +0000 Subject: [PATCH 23/34] CART-831 tests: Remove unneeded YAML file Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- .../ftest/cart/utils_test/set_other_env_vars.yaml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 src/tests/ftest/cart/utils_test/set_other_env_vars.yaml diff --git a/src/tests/ftest/cart/utils_test/set_other_env_vars.yaml b/src/tests/ftest/cart/utils_test/set_other_env_vars.yaml deleted file mode 100644 index efa6403dff0..00000000000 --- a/src/tests/ftest/cart/utils_test/set_other_env_vars.yaml +++ /dev/null @@ -1,13 +0,0 @@ -defaultENV: - D_LOG_MASK: "WARN" - CRT_PHY_ADDR_STR: "ofi+sockets" - OFI_INTERFACE: "eth0" - CRT_CTX_NUM: "8" - CRT_CTX_SHARE_ADDR: "0" - other_env_vars: - - ARBITRARY_ENV_VAR1: apple - - ARBITRARY_ENV_VAR2: orange - - ARBITRARY_ENV_VAR3: banana pear -tests: !mux - set_other_env_vars: - name: set_other_env_var From a6140368925d586bfd2a6456d05b39fc45e979cf Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Fri, 26 Feb 2021 02:04:24 +0000 Subject: [PATCH 24/34] CART-831 tests: Remove unhelpful print statements Signed-off-by: Ethan Mallove --- src/tests/ftest/util/apricot/apricot/test.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tests/ftest/util/apricot/apricot/test.py b/src/tests/ftest/util/apricot/apricot/test.py index 9190b170971..2786ae8b2cf 100644 --- a/src/tests/ftest/util/apricot/apricot/test.py +++ b/src/tests/ftest/util/apricot/apricot/test.py @@ -355,7 +355,6 @@ def setUp(self): # import and set env vars from yaml file default_env = self.params.get("default", "/run/ENV/") if default_env is None: - print("default_env was not set in yaml file.\n") return for kv_pair in default_env: @@ -398,7 +397,6 @@ def unset_other_env_vars(self): """ import env vars from other_env_var param """ default_env = self.params.get("default", "/run/ENV/") if default_env is None: - print("default_env was not set in yaml file.\n") return for kv_pair in default_env: From 09adc5d7189035217e61e954a2b4c2c8a16315d8 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Thu, 4 Mar 2021 23:39:38 +0000 Subject: [PATCH 25/34] CART-831 tests: Check for dict key existence Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- src/tests/ftest/util/apricot/apricot/test.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/tests/ftest/util/apricot/apricot/test.py b/src/tests/ftest/util/apricot/apricot/test.py index 753d74b1f72..16528801777 100644 --- a/src/tests/ftest/util/apricot/apricot/test.py +++ b/src/tests/ftest/util/apricot/apricot/test.py @@ -358,9 +358,10 @@ def setUp(self): return for kv_pair in default_env: - key, value = kv_pair[0] - print("Adding {}={} to environment.\n".format(key, value)) - os.environ[key] = value + if 0 in kv_pair: + key, value = kv_pair[0] + print("Adding {}={} to environment.\n".format(key, value)) + os.environ[key] = value # For compatibility with cart tests, which set env vars in oretrun # command via -x options @@ -400,10 +401,12 @@ def unset_other_env_vars(self): return for kv_pair in default_env: - key = kv_pair[0][0] - print("Removing key {} from environment.\n".format(key)) - del os.environ[key] - + try: + key = kv_pair[0][0] + print("Removing key {} from environment.\n".format(key)) + del os.environ[key] + except IndexError: + pass class TestWithServers(TestWithoutServers): # pylint: disable=too-many-public-methods,too-many-instance-attributes From 86294b4b0b0f49f2a17d6782e43f003c0e590412 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Fri, 5 Mar 2021 19:07:11 +0000 Subject: [PATCH 26/34] CART-831 tests: No more args to super in python 3 Try removing args from super in python 3 for cart_nopmix_multictx_one_node test: https://github.com/daos-stack/daos/pull/4445/#discussion_r587918069 Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py index d83f985a2ad..f2381274ce3 100755 --- a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py +++ b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py @@ -29,13 +29,13 @@ def setUp(self): """ Test setup """ print("Running setup\n") self.utils = CartUtils() - super(CartNoPmixOneNodeTest, self).setUp() + super().setUp() def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super(CartNoPmixOneNodeTest, self).tearDown() + super().tearDown() def test_cart_no_pmix(self): """ From 28b66cda74c37f26b181b61b2feca713b360bce1 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Fri, 5 Mar 2021 19:15:34 +0000 Subject: [PATCH 27/34] CART-831 tests: python 3 super doesn't need args Address these pylint issues: (pylint-super-with-arguments) Consider using Python 3 style super() without arguments Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- src/tests/ftest/cart/corpc/cart_corpc_five_node.py | 2 +- src/tests/ftest/cart/corpc/cart_corpc_one_node.py | 2 +- src/tests/ftest/cart/corpc/cart_corpc_two_node.py | 2 +- src/tests/ftest/cart/ctl/cart_ctl_five_node.py | 2 +- src/tests/ftest/cart/ctl/cart_ctl_one_node.py | 2 +- .../ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.py | 2 +- src/tests/ftest/cart/group_test/group_test.py | 2 +- src/tests/ftest/cart/iv/cart_iv_one_node.py | 2 +- src/tests/ftest/cart/iv/cart_iv_two_node.py | 2 +- .../ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py | 2 +- src/tests/ftest/cart/rpc/cart_rpc_one_node.py | 2 +- ...cart_rpc_one_node_with_swim_notification_on_rank_eviction.py | 2 +- src/tests/ftest/cart/rpc/cart_rpc_two_node.py | 2 +- src/tests/ftest/cart/selftest/cart_selftest_three_node.py | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/tests/ftest/cart/corpc/cart_corpc_five_node.py b/src/tests/ftest/cart/corpc/cart_corpc_five_node.py index 4e991e801e1..58caea04729 100755 --- a/src/tests/ftest/cart/corpc/cart_corpc_five_node.py +++ b/src/tests/ftest/cart/corpc/cart_corpc_five_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super(CartCoRpcFiveNodeTest, self).tearDown() + super().tearDown() def test_cart_corpc(self): """ diff --git a/src/tests/ftest/cart/corpc/cart_corpc_one_node.py b/src/tests/ftest/cart/corpc/cart_corpc_one_node.py index 1b2c369c988..604a58ff16c 100755 --- a/src/tests/ftest/cart/corpc/cart_corpc_one_node.py +++ b/src/tests/ftest/cart/corpc/cart_corpc_one_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super(CartCoRpcOneNodeTest, self).tearDown() + super().tearDown() def test_cart_corpc(self): """ diff --git a/src/tests/ftest/cart/corpc/cart_corpc_two_node.py b/src/tests/ftest/cart/corpc/cart_corpc_two_node.py index 72625daf98b..75e3010ae62 100755 --- a/src/tests/ftest/cart/corpc/cart_corpc_two_node.py +++ b/src/tests/ftest/cart/corpc/cart_corpc_two_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super(CartCoRpcTwoNodeTest, self).tearDown() + super().tearDown() def test_cart_corpc(self): """ diff --git a/src/tests/ftest/cart/ctl/cart_ctl_five_node.py b/src/tests/ftest/cart/ctl/cart_ctl_five_node.py index bf808f0b6d8..3852bbe58f6 100755 --- a/src/tests/ftest/cart/ctl/cart_ctl_five_node.py +++ b/src/tests/ftest/cart/ctl/cart_ctl_five_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super(CartCtlFiveNodeTest, self).tearDown() + super().tearDown() def test_cart_ctl(self): """ diff --git a/src/tests/ftest/cart/ctl/cart_ctl_one_node.py b/src/tests/ftest/cart/ctl/cart_ctl_one_node.py index d5325b5885f..de092fcd3a5 100755 --- a/src/tests/ftest/cart/ctl/cart_ctl_one_node.py +++ b/src/tests/ftest/cart/ctl/cart_ctl_one_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super(CartCtlOneNodeTest, self).tearDown() + super().tearDown() def test_cart_ctl(self): """ diff --git a/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.py b/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.py index 9dec1a7c670..f2f1ab94e1b 100755 --- a/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.py +++ b/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super(CartCoRpcOneNodeTest, self).tearDown() + super().tearDown() def test_cart_ghost_rank_rpc(self): """ diff --git a/src/tests/ftest/cart/group_test/group_test.py b/src/tests/ftest/cart/group_test/group_test.py index dd80fcf1614..9f33482489f 100755 --- a/src/tests/ftest/cart/group_test/group_test.py +++ b/src/tests/ftest/cart/group_test/group_test.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super(GroupTest, self).tearDown() + super().tearDown() def test_group(self): """ diff --git a/src/tests/ftest/cart/iv/cart_iv_one_node.py b/src/tests/ftest/cart/iv/cart_iv_one_node.py index 6f9e7ab93ae..3b448aa12c0 100755 --- a/src/tests/ftest/cart/iv/cart_iv_one_node.py +++ b/src/tests/ftest/cart/iv/cart_iv_one_node.py @@ -96,7 +96,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super(CartIvOneNodeTest, self).tearDown() + super().tearDown() def _verify_action(self, action): """verify the action""" diff --git a/src/tests/ftest/cart/iv/cart_iv_two_node.py b/src/tests/ftest/cart/iv/cart_iv_two_node.py index 33ee832d6f4..0170bd600fd 100755 --- a/src/tests/ftest/cart/iv/cart_iv_two_node.py +++ b/src/tests/ftest/cart/iv/cart_iv_two_node.py @@ -89,7 +89,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super(CartIvTwoNodeTest, self).tearDown() + super().tearDown() def _verify_action(self, action): """verify the action""" diff --git a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py index a7a3d5606be..dda91876a3c 100755 --- a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py +++ b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py @@ -34,7 +34,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super(CartNoPmixLauncherOneNodeTest, self).tearDown() + super().tearDown() def test_cart_no_pmix_launcher(self): """ diff --git a/src/tests/ftest/cart/rpc/cart_rpc_one_node.py b/src/tests/ftest/cart/rpc/cart_rpc_one_node.py index fbd1cabb340..ed5b7c4efbe 100755 --- a/src/tests/ftest/cart/rpc/cart_rpc_one_node.py +++ b/src/tests/ftest/cart/rpc/cart_rpc_one_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super(CartRpcOneNodeTest, self).tearDown() + super().tearDown() def test_cart_rpc(self): """ diff --git a/src/tests/ftest/cart/rpc/cart_rpc_one_node_with_swim_notification_on_rank_eviction.py b/src/tests/ftest/cart/rpc/cart_rpc_one_node_with_swim_notification_on_rank_eviction.py index 71a1b5fbdbf..a3fa78b36f9 100644 --- a/src/tests/ftest/cart/rpc/cart_rpc_one_node_with_swim_notification_on_rank_eviction.py +++ b/src/tests/ftest/cart/rpc/cart_rpc_one_node_with_swim_notification_on_rank_eviction.py @@ -49,7 +49,7 @@ def setUp(self): def tearDown(self): """Tear down.""" print("tearDown() start") - super(CartRpcOneNodeSwimNotificationOnRankEvictionTest, self).tearDown() + super().tearDown() def test_cart_rpc(self): """ diff --git a/src/tests/ftest/cart/rpc/cart_rpc_two_node.py b/src/tests/ftest/cart/rpc/cart_rpc_two_node.py index 6dfee0ebebb..f6e5413ddce 100755 --- a/src/tests/ftest/cart/rpc/cart_rpc_two_node.py +++ b/src/tests/ftest/cart/rpc/cart_rpc_two_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super(CartRpcTwoNodeTest, self).tearDown() + super().tearDown() def test_cart_rpc(self): """ diff --git a/src/tests/ftest/cart/selftest/cart_selftest_three_node.py b/src/tests/ftest/cart/selftest/cart_selftest_three_node.py index 8be98c4f88c..89d02f89cae 100755 --- a/src/tests/ftest/cart/selftest/cart_selftest_three_node.py +++ b/src/tests/ftest/cart/selftest/cart_selftest_three_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super(CartSelfThreeNodeTest, self).tearDown() + super().tearDown() def test_cart_selftest(self): """ From 28f106d12e5fa59a8fe1de3d6f251336dda59883 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Fri, 5 Mar 2021 19:17:31 +0000 Subject: [PATCH 28/34] CART-831 tests: Fix python indentation for pylint Need 4 spaces, not just 2 space for indentation. Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- src/tests/ftest/util/apricot/apricot/test.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/tests/ftest/util/apricot/apricot/test.py b/src/tests/ftest/util/apricot/apricot/test.py index 16528801777..42711c28edf 100644 --- a/src/tests/ftest/util/apricot/apricot/test.py +++ b/src/tests/ftest/util/apricot/apricot/test.py @@ -359,9 +359,9 @@ def setUp(self): for kv_pair in default_env: if 0 in kv_pair: - key, value = kv_pair[0] - print("Adding {}={} to environment.\n".format(key, value)) - os.environ[key] = value + key, value = kv_pair[0] + print("Adding {}={} to environment.\n".format(key, value)) + os.environ[key] = value # For compatibility with cart tests, which set env vars in oretrun # command via -x options @@ -402,11 +402,11 @@ def unset_other_env_vars(self): for kv_pair in default_env: try: - key = kv_pair[0][0] - print("Removing key {} from environment.\n".format(key)) - del os.environ[key] + key = kv_pair[0][0] + print("Removing key {} from environment.\n".format(key)) + del os.environ[key] except IndexError: - pass + pass class TestWithServers(TestWithoutServers): # pylint: disable=too-many-public-methods,too-many-instance-attributes From 209467134f8d4fb119aac54e68a5d8965ba924bf Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Tue, 9 Mar 2021 16:38:28 +0000 Subject: [PATCH 29/34] CART-831 tests: Revert to python 2 super() Per "ESAD Build and Test Automation" Skype channel: @mjean308: While python 3 test content update is in progress: https://github.com/daos-stack/daos/pull/4615 @ashleypitman: we'll just have to live with or suppress that warning until the test code is updated. @rpadma2: ... ignore Python 3 related errors for now... If some pylint errors are already in the script, you can leave it... There is an effort to move our scripts to python3. Presently, CI testing uses python 2 version. Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- src/tests/ftest/cart/corpc/cart_corpc_five_node.py | 2 +- src/tests/ftest/cart/corpc/cart_corpc_one_node.py | 2 +- src/tests/ftest/cart/corpc/cart_corpc_two_node.py | 2 +- src/tests/ftest/cart/ctl/cart_ctl_five_node.py | 2 +- src/tests/ftest/cart/ctl/cart_ctl_one_node.py | 2 +- .../ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.py | 2 +- src/tests/ftest/cart/group_test/group_test.py | 2 +- src/tests/ftest/cart/iv/cart_iv_one_node.py | 2 +- src/tests/ftest/cart/iv/cart_iv_two_node.py | 2 +- .../ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py | 2 +- src/tests/ftest/cart/rpc/cart_rpc_one_node.py | 2 +- ...cart_rpc_one_node_with_swim_notification_on_rank_eviction.py | 2 +- src/tests/ftest/cart/rpc/cart_rpc_two_node.py | 2 +- src/tests/ftest/cart/selftest/cart_selftest_three_node.py | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/tests/ftest/cart/corpc/cart_corpc_five_node.py b/src/tests/ftest/cart/corpc/cart_corpc_five_node.py index 58caea04729..4e991e801e1 100755 --- a/src/tests/ftest/cart/corpc/cart_corpc_five_node.py +++ b/src/tests/ftest/cart/corpc/cart_corpc_five_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super().tearDown() + super(CartCoRpcFiveNodeTest, self).tearDown() def test_cart_corpc(self): """ diff --git a/src/tests/ftest/cart/corpc/cart_corpc_one_node.py b/src/tests/ftest/cart/corpc/cart_corpc_one_node.py index 604a58ff16c..1b2c369c988 100755 --- a/src/tests/ftest/cart/corpc/cart_corpc_one_node.py +++ b/src/tests/ftest/cart/corpc/cart_corpc_one_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super().tearDown() + super(CartCoRpcOneNodeTest, self).tearDown() def test_cart_corpc(self): """ diff --git a/src/tests/ftest/cart/corpc/cart_corpc_two_node.py b/src/tests/ftest/cart/corpc/cart_corpc_two_node.py index 75e3010ae62..72625daf98b 100755 --- a/src/tests/ftest/cart/corpc/cart_corpc_two_node.py +++ b/src/tests/ftest/cart/corpc/cart_corpc_two_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super().tearDown() + super(CartCoRpcTwoNodeTest, self).tearDown() def test_cart_corpc(self): """ diff --git a/src/tests/ftest/cart/ctl/cart_ctl_five_node.py b/src/tests/ftest/cart/ctl/cart_ctl_five_node.py index 3852bbe58f6..bf808f0b6d8 100755 --- a/src/tests/ftest/cart/ctl/cart_ctl_five_node.py +++ b/src/tests/ftest/cart/ctl/cart_ctl_five_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super().tearDown() + super(CartCtlFiveNodeTest, self).tearDown() def test_cart_ctl(self): """ diff --git a/src/tests/ftest/cart/ctl/cart_ctl_one_node.py b/src/tests/ftest/cart/ctl/cart_ctl_one_node.py index de092fcd3a5..d5325b5885f 100755 --- a/src/tests/ftest/cart/ctl/cart_ctl_one_node.py +++ b/src/tests/ftest/cart/ctl/cart_ctl_one_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super().tearDown() + super(CartCtlOneNodeTest, self).tearDown() def test_cart_ctl(self): """ diff --git a/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.py b/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.py index f2f1ab94e1b..9dec1a7c670 100755 --- a/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.py +++ b/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super().tearDown() + super(CartCoRpcOneNodeTest, self).tearDown() def test_cart_ghost_rank_rpc(self): """ diff --git a/src/tests/ftest/cart/group_test/group_test.py b/src/tests/ftest/cart/group_test/group_test.py index 9f33482489f..dd80fcf1614 100755 --- a/src/tests/ftest/cart/group_test/group_test.py +++ b/src/tests/ftest/cart/group_test/group_test.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super().tearDown() + super(GroupTest, self).tearDown() def test_group(self): """ diff --git a/src/tests/ftest/cart/iv/cart_iv_one_node.py b/src/tests/ftest/cart/iv/cart_iv_one_node.py index 3b448aa12c0..6f9e7ab93ae 100755 --- a/src/tests/ftest/cart/iv/cart_iv_one_node.py +++ b/src/tests/ftest/cart/iv/cart_iv_one_node.py @@ -96,7 +96,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super().tearDown() + super(CartIvOneNodeTest, self).tearDown() def _verify_action(self, action): """verify the action""" diff --git a/src/tests/ftest/cart/iv/cart_iv_two_node.py b/src/tests/ftest/cart/iv/cart_iv_two_node.py index 0170bd600fd..33ee832d6f4 100755 --- a/src/tests/ftest/cart/iv/cart_iv_two_node.py +++ b/src/tests/ftest/cart/iv/cart_iv_two_node.py @@ -89,7 +89,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super().tearDown() + super(CartIvTwoNodeTest, self).tearDown() def _verify_action(self, action): """verify the action""" diff --git a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py index dda91876a3c..a7a3d5606be 100755 --- a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py +++ b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py @@ -34,7 +34,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super().tearDown() + super(CartNoPmixLauncherOneNodeTest, self).tearDown() def test_cart_no_pmix_launcher(self): """ diff --git a/src/tests/ftest/cart/rpc/cart_rpc_one_node.py b/src/tests/ftest/cart/rpc/cart_rpc_one_node.py index ed5b7c4efbe..fbd1cabb340 100755 --- a/src/tests/ftest/cart/rpc/cart_rpc_one_node.py +++ b/src/tests/ftest/cart/rpc/cart_rpc_one_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super().tearDown() + super(CartRpcOneNodeTest, self).tearDown() def test_cart_rpc(self): """ diff --git a/src/tests/ftest/cart/rpc/cart_rpc_one_node_with_swim_notification_on_rank_eviction.py b/src/tests/ftest/cart/rpc/cart_rpc_one_node_with_swim_notification_on_rank_eviction.py index a3fa78b36f9..71a1b5fbdbf 100644 --- a/src/tests/ftest/cart/rpc/cart_rpc_one_node_with_swim_notification_on_rank_eviction.py +++ b/src/tests/ftest/cart/rpc/cart_rpc_one_node_with_swim_notification_on_rank_eviction.py @@ -49,7 +49,7 @@ def setUp(self): def tearDown(self): """Tear down.""" print("tearDown() start") - super().tearDown() + super(CartRpcOneNodeSwimNotificationOnRankEvictionTest, self).tearDown() def test_cart_rpc(self): """ diff --git a/src/tests/ftest/cart/rpc/cart_rpc_two_node.py b/src/tests/ftest/cart/rpc/cart_rpc_two_node.py index f6e5413ddce..6dfee0ebebb 100755 --- a/src/tests/ftest/cart/rpc/cart_rpc_two_node.py +++ b/src/tests/ftest/cart/rpc/cart_rpc_two_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super().tearDown() + super(CartRpcTwoNodeTest, self).tearDown() def test_cart_rpc(self): """ diff --git a/src/tests/ftest/cart/selftest/cart_selftest_three_node.py b/src/tests/ftest/cart/selftest/cart_selftest_three_node.py index 89d02f89cae..8be98c4f88c 100755 --- a/src/tests/ftest/cart/selftest/cart_selftest_three_node.py +++ b/src/tests/ftest/cart/selftest/cart_selftest_three_node.py @@ -33,7 +33,7 @@ def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super().tearDown() + super(CartSelfThreeNodeTest, self).tearDown() def test_cart_selftest(self): """ From 7bccab990330a32e440908c2f99288f76683be4b Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Tue, 9 Mar 2021 17:03:41 +0000 Subject: [PATCH 30/34] CART-831 tests: Stringify all keys/vals in dict Sync with CI/Jenkins avocado version (69.2). Stringify all keys/vals in dict, to resolve this error: `execve() arg 3 contains a non-string value`. Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- .../cart/no_pmix/cart_nopmix_multictx_one_node.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py index f2381274ce3..c601b05cdc7 100755 --- a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py +++ b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py @@ -49,6 +49,16 @@ def test_cart_no_pmix(self): ofi_ctx_num = os.environ.get("CRT_CTX_NUM") ofi_share_addr = os.environ.get("CRT_CTX_SHARE_ADDR") + # env dict keys and values must all be of string type + if not isinstance(crt_phy_addr, ("".__class__, u"".__class__)): + crt_phy_addr = "" + if not isinstance(ofi_interface, ("".__class__, u"".__class__)): + ofi_interface = "" + if not isinstance(ofi_ctx_num, ("".__class__, u"".__class__)): + ofi_ctx_num = "" + if not isinstance(ofi_share_addr, ("".__class__, u"".__class__)): + ofi_share_addr = "" + pass_env = {"CRT_PHY_ADDR_STR": crt_phy_addr, "OFI_INTERFACE": ofi_interface, "CRT_CTX_SHARE_ADDR": ofi_share_addr, From 8cdc8a90e34b7964397eac1deeae38bb2107389b Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Tue, 9 Mar 2021 17:08:22 +0000 Subject: [PATCH 31/34] CART-654 tests: Supprese Pytnon 3 pylint messages Background: `pylint` printed the following error: `(pylint-super-with-arguments) Consider using Python 3 style super() without arguments` https://github.com/daos-stack/daos/pull/4445#pullrequestreview-605530347 But when we fix the pylint error using Python 3 super w/o arguments, we get this error: `ERROR: super() takes at least 1 argument` https://build.hpdd.intel.com/job/daos-stack/job/daos/view/change-requests/job/PR-4445/27/testReport/junit/FTEST_cart/CartCoRpcFiveNodeTest/Test___Functional_on_CentOS_7___1___cart_cart_corpc_five_node_py_CartCoRpcFiveNodeTest_test_cart_corpc_ENV_no_sep_hosts_1_corpc_prefwd_2a08/ Q: How to resolve both? A: (@ashleypitman) ... live with or suppress that warning until the test code is updated. Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- utils/sl/pylint3.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/sl/pylint3.rc b/utils/sl/pylint3.rc index 899e9ad453a..be1dc116c66 100644 --- a/utils/sl/pylint3.rc +++ b/utils/sl/pylint3.rc @@ -1,7 +1,7 @@ [MESSAGES CONTROL] disable=locally-disabled,locally-enabled,star-args,wrong-import-order, unused-wildcard-import,invalid-name,global-statement,bad-option-value, - wrong-import-position + wrong-import-position,super-with-arguments [FORMAT] max-line-length=80 From 286521a37bdf09886de3e4f2192506714875c5d9 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Wed, 10 Mar 2021 22:20:45 +0000 Subject: [PATCH 32/34] CART-831 tests: params.get now returns OrderedDict Looks like the YAML params.get function changed between avocado 52 and 69? It used to return a 2-value tuple. So instead of just accesing the key-value pair via array indexing -- we use next(iter()) instead. https://avocado-framework.readthedocs.io/en/52.0/release_notes/52_0.html https://avocado-framework.readthedocs.io/en/53.0/release_notes/53_0.html https://avocado-framework.readthedocs.io/en/54.0/release_notes/54_0.html .... https://avocado-framework.readthedocs.io/en/69.0/release_notes/69_0.html Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- src/tests/ftest/util/apricot/apricot/test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tests/ftest/util/apricot/apricot/test.py b/src/tests/ftest/util/apricot/apricot/test.py index 42711c28edf..3d11f2e8629 100644 --- a/src/tests/ftest/util/apricot/apricot/test.py +++ b/src/tests/ftest/util/apricot/apricot/test.py @@ -358,8 +358,9 @@ def setUp(self): return for kv_pair in default_env: - if 0 in kv_pair: - key, value = kv_pair[0] + key = next(iter(kv_pair)) + if key is not None: + value = kv_pair[key] print("Adding {}={} to environment.\n".format(key, value)) os.environ[key] = value From b780fb88ecab41d5b0301756c3baa32ae6019c72 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Wed, 10 Mar 2021 22:33:47 +0000 Subject: [PATCH 33/34] CART-831 tests: Call super(.setUp) in py scripts We process env var's in YAML file from, so always call TestWithoutServers.setUp() in cart Python test scripts. Skip-build-leap15-rpm: true Skip-func-test-leap15: true Skip-build-ubuntu-clang: true Skip-build-leap15-icc: true Skip-coverity-test: true Quick-build: true Test-tag: cart Skip-unit-tests: true Skip-nlt: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-coverity-test: true Skip-func-hw-test-small: true Skip-func-hw-test-medium: true Skip-func-hw-test-large: true Signed-off-by: Ethan Mallove --- src/tests/ftest/cart/corpc/cart_corpc_five_node.py | 1 + src/tests/ftest/cart/corpc/cart_corpc_one_node.py | 1 + src/tests/ftest/cart/corpc/cart_corpc_two_node.py | 1 + src/tests/ftest/cart/ctl/cart_ctl_five_node.py | 1 + src/tests/ftest/cart/ctl/cart_ctl_one_node.py | 1 + .../ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.py | 1 + src/tests/ftest/cart/group_test/group_test.py | 1 + src/tests/ftest/cart/iv/cart_iv_one_node.py | 1 + src/tests/ftest/cart/iv/cart_iv_two_node.py | 1 + src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py | 4 ++-- .../cart/nopmix_launcher/cart_nopmix_launcher_one_node.py | 1 + src/tests/ftest/cart/rpc/cart_rpc_one_node.py | 1 + ...rt_rpc_one_node_with_swim_notification_on_rank_eviction.py | 1 + src/tests/ftest/cart/rpc/cart_rpc_two_node.py | 1 + src/tests/ftest/cart/selftest/cart_selftest_three_node.py | 1 + 15 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/tests/ftest/cart/corpc/cart_corpc_five_node.py b/src/tests/ftest/cart/corpc/cart_corpc_five_node.py index 4e991e801e1..cda64c1310a 100755 --- a/src/tests/ftest/cart/corpc/cart_corpc_five_node.py +++ b/src/tests/ftest/cart/corpc/cart_corpc_five_node.py @@ -26,6 +26,7 @@ class CartCoRpcFiveNodeTest(TestWithoutServers): def setUp(self): """ Test setup """ print("Running setup\n") + super(CartCoRpcFiveNodeTest, self).setUp() self.utils = CartUtils() self.env = self.utils.get_env(self) diff --git a/src/tests/ftest/cart/corpc/cart_corpc_one_node.py b/src/tests/ftest/cart/corpc/cart_corpc_one_node.py index 1b2c369c988..fe3217f30d4 100755 --- a/src/tests/ftest/cart/corpc/cart_corpc_one_node.py +++ b/src/tests/ftest/cart/corpc/cart_corpc_one_node.py @@ -26,6 +26,7 @@ class CartCoRpcOneNodeTest(TestWithoutServers): def setUp(self): """ Test setup """ print("Running setup\n") + super(CartCoRpcOneNodeTest, self).setUp() self.utils = CartUtils() self.env = self.utils.get_env(self) diff --git a/src/tests/ftest/cart/corpc/cart_corpc_two_node.py b/src/tests/ftest/cart/corpc/cart_corpc_two_node.py index 72625daf98b..ce207851681 100755 --- a/src/tests/ftest/cart/corpc/cart_corpc_two_node.py +++ b/src/tests/ftest/cart/corpc/cart_corpc_two_node.py @@ -26,6 +26,7 @@ class CartCoRpcTwoNodeTest(TestWithoutServers): def setUp(self): """ Test setup """ print("Running setup\n") + super(CartCoRpcTwoNodeTest, self).setUp() self.utils = CartUtils() self.env = self.utils.get_env(self) diff --git a/src/tests/ftest/cart/ctl/cart_ctl_five_node.py b/src/tests/ftest/cart/ctl/cart_ctl_five_node.py index bf808f0b6d8..2f17512f66a 100755 --- a/src/tests/ftest/cart/ctl/cart_ctl_five_node.py +++ b/src/tests/ftest/cart/ctl/cart_ctl_five_node.py @@ -26,6 +26,7 @@ class CartCtlFiveNodeTest(TestWithoutServers): def setUp(self): """ Test setup """ print("Running setup\n") + super(CartCtlFiveNodeTest, self).setUp() self.utils = CartUtils() self.env = self.utils.get_env(self) diff --git a/src/tests/ftest/cart/ctl/cart_ctl_one_node.py b/src/tests/ftest/cart/ctl/cart_ctl_one_node.py index d5325b5885f..0370581dfbb 100755 --- a/src/tests/ftest/cart/ctl/cart_ctl_one_node.py +++ b/src/tests/ftest/cart/ctl/cart_ctl_one_node.py @@ -26,6 +26,7 @@ class CartCtlOneNodeTest(TestWithoutServers): def setUp(self): """ Test setup """ print("Running setup\n") + super(CartCtlOneNodeTest, self).setUp() self.utils = CartUtils() self.env = self.utils.get_env(self) diff --git a/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.py b/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.py index 9dec1a7c670..51b7a21a81c 100755 --- a/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.py +++ b/src/tests/ftest/cart/ghost_rank_rpc/cart_ghost_rank_prc_one_node.py @@ -26,6 +26,7 @@ class CartCoRpcOneNodeTest(TestWithoutServers): def setUp(self): """ Test setup """ print("Running setup\n") + super(CartCoRpcOneNodeTest, self).setUp() self.utils = CartUtils() self.env = self.utils.get_env(self) diff --git a/src/tests/ftest/cart/group_test/group_test.py b/src/tests/ftest/cart/group_test/group_test.py index dd80fcf1614..d8c069989c8 100755 --- a/src/tests/ftest/cart/group_test/group_test.py +++ b/src/tests/ftest/cart/group_test/group_test.py @@ -26,6 +26,7 @@ class GroupTest(TestWithoutServers): def setUp(self): """ Test setup """ print("Running setup\n") + super(GroupTest, self).setUp() self.utils = CartUtils() self.env = self.utils.get_env(self) diff --git a/src/tests/ftest/cart/iv/cart_iv_one_node.py b/src/tests/ftest/cart/iv/cart_iv_one_node.py index 6f9e7ab93ae..f04b0c8d0e0 100755 --- a/src/tests/ftest/cart/iv/cart_iv_one_node.py +++ b/src/tests/ftest/cart/iv/cart_iv_one_node.py @@ -89,6 +89,7 @@ class CartIvOneNodeTest(TestWithoutServers): def setUp(self): """ Test setup """ print("Running setup\n") + super(CartIvOneNodeTest, self).setUp() self.utils = CartUtils() self.env = self.utils.get_env(self) diff --git a/src/tests/ftest/cart/iv/cart_iv_two_node.py b/src/tests/ftest/cart/iv/cart_iv_two_node.py index 33ee832d6f4..ac106efa38a 100755 --- a/src/tests/ftest/cart/iv/cart_iv_two_node.py +++ b/src/tests/ftest/cart/iv/cart_iv_two_node.py @@ -82,6 +82,7 @@ class CartIvTwoNodeTest(TestWithoutServers): def setUp(self): """ Test setup """ print("Running setup\n") + super(CartIvTwoNodeTest, self).setUp() self.utils = CartUtils() self.env = self.utils.get_env(self) diff --git a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py index c601b05cdc7..99f6cc3cf13 100755 --- a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py +++ b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py @@ -28,14 +28,14 @@ class CartNoPmixOneNodeTest(TestWithoutServers): def setUp(self): """ Test setup """ print("Running setup\n") + super(CartNoPmixOneNodeTest, self).setUp() self.utils = CartUtils() - super().setUp() def tearDown(self): """ Tear down """ self.report_timeout() self._teardown_errors.extend(self.utils.cleanup_processes()) - super().tearDown() + super(CartNoPmixOneNodeTest, self).tearDown() def test_cart_no_pmix(self): """ diff --git a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py index a7a3d5606be..ec71b8633cb 100755 --- a/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py +++ b/src/tests/ftest/cart/nopmix_launcher/cart_nopmix_launcher_one_node.py @@ -27,6 +27,7 @@ class CartNoPmixLauncherOneNodeTest(TestWithoutServers): def setUp(self): """ Test setup """ print("Running setup\n") + super(CartNoPmixLauncherOneNodeTest, self).setUp() self.utils = CartUtils() self.env = self.utils.get_env(self) diff --git a/src/tests/ftest/cart/rpc/cart_rpc_one_node.py b/src/tests/ftest/cart/rpc/cart_rpc_one_node.py index fbd1cabb340..07846939592 100755 --- a/src/tests/ftest/cart/rpc/cart_rpc_one_node.py +++ b/src/tests/ftest/cart/rpc/cart_rpc_one_node.py @@ -26,6 +26,7 @@ class CartRpcOneNodeTest(TestWithoutServers): def setUp(self): """ Test setup """ print("Running setup\n") + super(CartRpcOneNodeTest, self).setUp() self.utils = CartUtils() self.env = self.utils.get_env(self) diff --git a/src/tests/ftest/cart/rpc/cart_rpc_one_node_with_swim_notification_on_rank_eviction.py b/src/tests/ftest/cart/rpc/cart_rpc_one_node_with_swim_notification_on_rank_eviction.py index 71a1b5fbdbf..2fab3b5d1ee 100644 --- a/src/tests/ftest/cart/rpc/cart_rpc_one_node_with_swim_notification_on_rank_eviction.py +++ b/src/tests/ftest/cart/rpc/cart_rpc_one_node_with_swim_notification_on_rank_eviction.py @@ -43,6 +43,7 @@ class CartRpcOneNodeSwimNotificationOnRankEvictionTest(TestWithoutServers): def setUp(self): """ Test setup """ print("Running setup\n") + super(CartRpcOneNodeSwimNotificationOnRankEvictionTest, self).setUp() self.utils = CartUtils() self.env = self.utils.get_env(self) diff --git a/src/tests/ftest/cart/rpc/cart_rpc_two_node.py b/src/tests/ftest/cart/rpc/cart_rpc_two_node.py index 6dfee0ebebb..5c41b63675c 100755 --- a/src/tests/ftest/cart/rpc/cart_rpc_two_node.py +++ b/src/tests/ftest/cart/rpc/cart_rpc_two_node.py @@ -26,6 +26,7 @@ class CartRpcTwoNodeTest(TestWithoutServers): def setUp(self): """ Test setup """ print("Running setup\n") + super(CartRpcTwoNodeTest, self).setUp() self.utils = CartUtils() self.env = self.utils.get_env(self) diff --git a/src/tests/ftest/cart/selftest/cart_selftest_three_node.py b/src/tests/ftest/cart/selftest/cart_selftest_three_node.py index 8be98c4f88c..0ad65feb54f 100755 --- a/src/tests/ftest/cart/selftest/cart_selftest_three_node.py +++ b/src/tests/ftest/cart/selftest/cart_selftest_three_node.py @@ -26,6 +26,7 @@ class CartSelfThreeNodeTest(TestWithoutServers): def setUp(self): """ Test setup """ print("Running setup\n") + super(CartSelfThreeNodeTest, self).setUp() self.utils = CartUtils() self.env = self.utils.get_env(self) From 44c9acd7e448399410fe3e5bb39e4466b43a60b3 Mon Sep 17 00:00:00 2001 From: Ethan Mallove Date: Thu, 11 Mar 2021 18:09:19 +0000 Subject: [PATCH 34/34] CART-831 tests: Fix pylint indentation issues Expected 12 spaces, but only found 10. Skip-build: true Skip-build-centos7-gcc: true Skip-build-centos7-gcc-debug: true Skip-build-centos7-gcc-release: true Skip-build-centos8-gcc-dev: true Skip-build-leap15-gcc: true Skip-build-leap15-icc: true Skip-build-ubuntu-clang: true Skip-bullseye: true Skip-coverity-test: true Skip-func-hw-test: true Skip-func-test: true Skip-func-test-vm: true Skip-nlt: true Skip-run_test: true Skip-scan-centos-rpms: true Skip-test: true Skip-test-centos-rpms: true Skip-unit-test: true Skip-unit-test-memcheck: true Skip-unit-tests: true Signed-off-by: Ethan Mallove --- .../ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py index 99f6cc3cf13..00c835be8bd 100755 --- a/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py +++ b/src/tests/ftest/cart/no_pmix/cart_nopmix_multictx_one_node.py @@ -51,13 +51,13 @@ def test_cart_no_pmix(self): # env dict keys and values must all be of string type if not isinstance(crt_phy_addr, ("".__class__, u"".__class__)): - crt_phy_addr = "" + crt_phy_addr = "" if not isinstance(ofi_interface, ("".__class__, u"".__class__)): - ofi_interface = "" + ofi_interface = "" if not isinstance(ofi_ctx_num, ("".__class__, u"".__class__)): - ofi_ctx_num = "" + ofi_ctx_num = "" if not isinstance(ofi_share_addr, ("".__class__, u"".__class__)): - ofi_share_addr = "" + ofi_share_addr = "" pass_env = {"CRT_PHY_ADDR_STR": crt_phy_addr, "OFI_INTERFACE": ofi_interface,