Skip to content

Commit

Permalink
Do not require build vars file and runn full faily regression.
Browse files Browse the repository at this point in the history
Features: daily_regression

Required-githooks: true
Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
  • Loading branch information
ashleypittman committed Jan 22, 2024
1 parent 5686e5c commit 2428d13
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
1 change: 0 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,6 @@ def scons():
prereqs.save_build_info()
# also install to $PREFIX/lib to work with existing avocado test code
if prereqs.test_requested():
env.Install('$PREFIX/lib/daos', ['.build_vars.sh', '.build_vars.json'])
env.Install('$PREFIX/lib/daos/TESTING/ftest/util', ['site_scons/env_modules.py'])
env.Install('$PREFIX/lib/daos/TESTING/ftest/', ['ftest.sh', "requirements-ftest.txt"])

Expand Down
3 changes: 0 additions & 3 deletions debian/daos-client-tests.install
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ usr/bin/crt_launch
usr/bin/daos_gen_io_conf
usr/bin/daos_run_io_conf
usr/lib64/libdpar.so
# For avocado tests
usr/lib/daos/.build_vars.json
usr/lib/daos/.build_vars.sh
20 changes: 13 additions & 7 deletions src/tests/ftest/util/apricot/apricot/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,21 @@ def __init__(self, *args, **kwargs):
def setUp(self):
"""Set up each test case."""
# get paths from the build_vars generated by build
with open('../../.build_vars.json') as build_vars:
build_paths = json.load(build_vars)
self.basepath = os.path.normpath(os.path.join(build_paths['PREFIX'],
'..') + os.path.sep)
self.prefix = build_paths['PREFIX']
try:
self.ofi_prefix = build_paths['OFI_PREFIX']
except KeyError:
with open('../../.build_vars.json') as build_vars:
build_paths = json.load(build_vars)
self.basepath = os.path.normpath(os.path.join(build_paths['PREFIX'],
'..') + os.path.sep)
self.prefix = build_paths['PREFIX']
try:
self.ofi_prefix = build_paths['OFI_PREFIX']
except KeyError:
self.ofi_prefix = os.sep + "usr"
except FileNotFoundError:
self.prefix = "/usr"
self.basepath = "/"
self.ofi_prefix = os.sep + "usr"
self.log.info("No build vars file, assuming RPM install")
self.cancel_from_list()
self.check_variant_skip()
self.log.info("*** SETUP running on %s ***", str(detect()))
Expand Down
17 changes: 10 additions & 7 deletions src/tests/ftest/util/environment_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestEnvironmentException(Exception):
"""Exception for launch.py execution."""


def get_build_environment(logger, build_vars_file):
def _get_build_environment(logger, build_vars_file):
"""Obtain DAOS build environment variables from the .build_vars.json file.
Args:
Expand All @@ -29,19 +29,22 @@ def get_build_environment(logger, build_vars_file):
TestEnvironmentException: if there is an error obtaining the DAOS build environment
Returns:
dict: a dictionary of DAOS build environment variable names and values
str: The prefix of the DAOS install.
None: If the file is not present.
"""
logger.debug("Obtaining DAOS build environment from %s", build_vars_file)
try:
with open(build_vars_file, encoding="utf-8") as vars_file:
return json.load(vars_file)
return json.load(vars_file)["PREFIX"]

except FileNotFoundError:
return None

except Exception as error: # pylint: disable=broad-except
raise TestEnvironmentException("Error obtaining build environment:", str(error)) from error


def update_path(logger, build_vars_file):
def _update_path(logger, build_vars_file):
"""Update the PATH environment variable for functional testing.
Args:
Expand All @@ -51,15 +54,15 @@ def update_path(logger, build_vars_file):
Raises:
TestEnvironmentException: if there is an error obtaining the DAOS build environment
"""
base_dir = get_build_environment(logger, build_vars_file)["PREFIX"]
base_dir = _get_build_environment(logger, build_vars_file)

path = os.environ.get("PATH")

parts = path.split(":")

# If a custom prefix is used for the daos installation then prepend that to the path so that
# any binaries provided are picked up from there, else do not modify the path.
if base_dir != "/usr":
if base_dir:
bin_dir = os.path.join(base_dir, "bin")
sbin_dir = os.path.join(base_dir, "sbin")

Expand Down
3 changes: 0 additions & 3 deletions utils/rpms/daos.spec
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,6 @@ getent passwd daos_agent >/dev/null || useradd -s /sbin/nologin -r -g daos_agent
%config(noreplace) %{conf_dir}/fault-inject-cart.yaml
%{_bindir}/fault_status
%{_bindir}/crt_launch
# For avocado tests
%{daoshome}/.build_vars.json
%{daoshome}/.build_vars.sh
%{_bindir}/daos_perf
%{_bindir}/daos_racer
%{_bindir}/daos_test
Expand Down

0 comments on commit 2428d13

Please sign in to comment.