Pass the build dir along when running tests

As of 0e1c436d14, the build directory is
an argument to run_regression_tests.sh. However, the build directory in
falco_tests.yaml is currently hard-coded to /build, with the build
variant influencing the subdirectory.

Clean this up so the entire build directory passed to
run_regression_tests.sh is passed to avocado and used for the build
directory.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
This commit is contained in:
Mark Stemm 2019-08-29 12:02:14 -07:00 committed by Mark Stemm
parent 193f33cd40
commit 6e11e75c15
2 changed files with 5 additions and 7 deletions

View File

@ -34,13 +34,11 @@ class FalcoTest(Test):
"""
Load the sysdig kernel module if not already loaded.
"""
build_type = "release"
if 'BUILD_TYPE' in os.environ:
build_type = os.environ['BUILD_TYPE'].lower()
build_type = "debug" if build_type == "debug" else "release"
build_dir = "/build"
if 'BUILD_DIR' in os.environ:
build_dir = os.environ['BUILD_DIR']
build_dir = os.path.join('/build', build_type)
self.falcodir = self.params.get('falcodir', '/', default=os.path.join(self.basedir, build_dir))
self.falcodir = self.params.get('falcodir', '/', default=build_dir)
self.stdout_is = self.params.get('stdout_is', '*', default='')
self.stderr_is = self.params.get('stderr_is', '*', default='')

View File

@ -92,7 +92,7 @@ function run_tests() {
for mult in $SCRIPTDIR/falco_traces.yaml $SCRIPTDIR/falco_tests.yaml $SCRIPTDIR/falco_tests_package.yaml $SCRIPTDIR/falco_k8s_audit_tests.yaml; do
CMD="avocado run --mux-yaml $mult --job-results-dir $SCRIPTDIR/job-results -- $SCRIPTDIR/falco_test.py"
echo "Running: $CMD"
$CMD
BUILD_DIR=${BUILD_DIR} $CMD
RC=$?
TEST_RC=$((TEST_RC+$RC))
if [ $RC -ne 0 ]; then