diff --git a/ci/provisioning/post_provision_config_nodes_EL_8.sh b/ci/provisioning/post_provision_config_nodes_EL_8.sh index 2160df55e34..6f2316facbb 100644 --- a/ci/provisioning/post_provision_config_nodes_EL_8.sh +++ b/ci/provisioning/post_provision_config_nodes_EL_8.sh @@ -4,6 +4,8 @@ # # SPDX-License-Identifier: BSD-2-Clause-Patent +PYTHON3_VERSION="3.11" + bootstrap_dnf() { systemctl enable postfix.service systemctl start postfix.service @@ -19,8 +21,9 @@ distro_custom() { # Use a more recent python version for unit testing, this allows us to also test installing # pydaos into virtual environments. - dnf -y install python39 python39-devel - dnf -y install python3.11 python3.11-devel + dnf -y install python${PYTHON3_VERSION} python${PYTHON3_VERSION}-devel + sudo update-alternatives --set python3 /usr/bin/python${PYTHON3_VERSION} + update-alternatives --list } install_mofed() { diff --git a/ci/provisioning/post_provision_config_nodes_LEAP_15.sh b/ci/provisioning/post_provision_config_nodes_LEAP_15.sh index 2c7c66da133..9f36cb00edb 100755 --- a/ci/provisioning/post_provision_config_nodes_LEAP_15.sh +++ b/ci/provisioning/post_provision_config_nodes_LEAP_15.sh @@ -1,5 +1,7 @@ #!/bin/bash +PYTHON3_VERSION="311" + bootstrap_dnf() { rm -rf "$REPOS_DIR" ln -s ../zypp/repos.d "$REPOS_DIR" @@ -16,4 +18,10 @@ distro_custom() { sed -e '/MODULEPATH=/s/$/:\/usr\/share\/modules/' \ /etc/profile.d/lmod.sh; \ fi + + # Use a more recent python version for unit testing, this allows us to also test installing + # pydaos into virtual environments. + dnf -y install python${PYTHON3_VERSION} python${PYTHON3_VERSION}-devel + sudo update-alternatives --set python3 /usr/bin/python${PYTHON3_VERSION} + update-alternatives --list python3 } diff --git a/requirements-ftest.txt b/requirements-ftest.txt index c0c0f2b8eb1..5c157b84094 100644 --- a/requirements-ftest.txt +++ b/requirements-ftest.txt @@ -1,6 +1,6 @@ -avocado-framework==82 -avocado-framework-plugin-result-html==82 -avocado-framework-plugin-varianter-yaml-to-mux==82 +avocado-framework>=103.0,<104.0 +avocado-framework-plugin-result-html>=103.0,<104.0 +avocado-framework-plugin-varianter-yaml-to-mux>=103.0,<104.0 clustershell paramiko distro diff --git a/src/tests/ftest/dfuse/simul.py b/src/tests/ftest/dfuse/simul.py index 5179ad0f5b4..8931fbc584e 100644 --- a/src/tests/ftest/dfuse/simul.py +++ b/src/tests/ftest/dfuse/simul.py @@ -118,7 +118,7 @@ def run_simul(self, include=None, exclude=None, raise_exception=True): self.fail("##Both include and exclude tests are selected both or empty.") self.log_step("Running simul on %s", mpi_type) - return run_command(cmd, output_check="combined", raise_exception=raise_exception) + return run_command(cmd, raise_exception=raise_exception) def test_posix_simul(self): """Test simul. diff --git a/src/tests/ftest/erasurecode/space_usage.py b/src/tests/ftest/erasurecode/space_usage.py index 4998c9e4f92..9e2b25306ff 100644 --- a/src/tests/ftest/erasurecode/space_usage.py +++ b/src/tests/ftest/erasurecode/space_usage.py @@ -34,7 +34,7 @@ def test_ec_space_balanced_ec_4p1gx(self): :avocado: tags=ec,ior,pool,query_targets :avocado: tags=EcodSpaceUsage,test_ec_space_balanced_ec_4p1gx """ - self._run_test(ior_namespace='/run/ior_ec_4p1gx/*') + self._execute_test(ior_namespace='/run/ior_ec_4p1gx/*') def test_ec_space_balanced_ec_4p2gx(self): """Jira ID: DAOS-10912. @@ -46,9 +46,9 @@ def test_ec_space_balanced_ec_4p2gx(self): :avocado: tags=ec,ior,pool,query_targets :avocado: tags=EcodSpaceUsage,test_ec_space_balanced_ec_4p2gx """ - self._run_test(ior_namespace='/run/ior_ec_4p2gx/*') + self._execute_test(ior_namespace='/run/ior_ec_4p2gx/*') - def _run_test(self, ior_namespace): + def _execute_test(self, ior_namespace): """Run the test. Args: diff --git a/src/tests/ftest/util/apricot/apricot/test.py b/src/tests/ftest/util/apricot/apricot/test.py index ec99e3c1889..0adb68130e1 100644 --- a/src/tests/ftest/util/apricot/apricot/test.py +++ b/src/tests/ftest/util/apricot/apricot/test.py @@ -16,6 +16,7 @@ from avocado import Test as avocadoTest from avocado import TestFail, fail_on, skip from avocado.core import exceptions +from avocado.core.teststatus import STATUSES_NOT_OK from cart_ctl_utils import CartCtl from ClusterShell.NodeSet import NodeSet from command_utils_base import EnvironmentVariables @@ -1364,27 +1365,11 @@ def report_timeout(self): # dump engines ULT stacks upon test timeout self.dump_engines_stacks("Test has timed-out") - def fail(self, message=None): - """Dump engines ULT stacks upon test failure.""" - self.dump_engines_stacks("Test has failed") - super().fail(message) - - def error(self, message=None): - # pylint: disable=arguments-renamed - """Dump engines ULT stacks upon test error.""" - self.dump_engines_stacks("Test has errored") - super().error(message) - def tearDown(self): """Tear down after each test case.""" # dump engines ULT stacks upon test failure - # check of Avocado test status during teardown is presently useless - # and about same behavior has been implemented by adding both fail() - # error() method above, to overload the methods of Avocado base Test - # class (see DAOS-1452/DAOS-9941 and Avocado issue #5217 with - # associated PR-5224) - if self.status is not None and self.status != 'PASS' and self.status != 'SKIP': + if self.status is not None and self.status in STATUSES_NOT_OK: self.dump_engines_stacks("Test status is {}".format(self.status)) # Report whether or not the timeout has expired diff --git a/src/tests/ftest/util/command_utils.py b/src/tests/ftest/util/command_utils.py index 9c21c21feeb..77c0767f13d 100644 --- a/src/tests/ftest/util/command_utils.py +++ b/src/tests/ftest/util/command_utils.py @@ -230,7 +230,7 @@ def _run_process(self, raise_exception=None): self.result = run_command( command, self.timeout, self.verbose, raise_exception, - self.output_check, env=self.env) + env=self.env) except DaosTestError as error: # Command failed or possibly timed out @@ -284,7 +284,6 @@ def _run_subprocess(self): kwargs = { "cmd": str(self), "verbose": self.verbose, - "allow_output_check": "combined", "shell": False, "env": self.env, "sudo": self.sudo, diff --git a/src/tests/ftest/util/general_utils.py b/src/tests/ftest/util/general_utils.py index 2ba711bde4a..8b6fc3d697e 100644 --- a/src/tests/ftest/util/general_utils.py +++ b/src/tests/ftest/util/general_utils.py @@ -89,8 +89,7 @@ def bytes_to_human(size, digits=2, binary=True): return "".join([str(round(value[0], digits)), value[1]]) -def run_command(command, timeout=60, verbose=True, raise_exception=True, - output_check="both", env=None): +def run_command(command, timeout=60, verbose=True, raise_exception=True, env=None): """Run the command on the local host. This method uses the avocado.utils.process.run() method to run the specified @@ -107,15 +106,6 @@ def run_command(command, timeout=60, verbose=True, raise_exception=True, stdout/stderr. Defaults to True. raise_exception (bool, optional): whether to raise an exception if the command returns a non-zero exit status. Defaults to True. - output_check (str, optional): whether to record the output from the - command (from stdout and stderr) in the test output record files. - Valid values: - "stdout" - standard output *only* - "stderr" - standard error *only* - "both" - both standard output and error in separate files - "combined" - standard output and error in a single file - "none" - disable all recording - Defaults to "both". env (dict, optional): dictionary of environment variable names and values to set when running the command. Defaults to None. @@ -144,7 +134,6 @@ def run_command(command, timeout=60, verbose=True, raise_exception=True, "timeout": timeout, "verbose": verbose, "ignore_status": not raise_exception, - "allow_output_check": output_check, "shell": False, "env": env, }