Skip to content

Commit

Permalink
Pass the build dir along when running tests
Browse files Browse the repository at this point in the history
As of 0e1c436, 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>
  • Loading branch information
mstemm committed Aug 30, 2019
1 parent 193f33c commit 6e11e75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions test/falco_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@ def setUp(self):
"""
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='')
Expand Down
2 changes: 1 addition & 1 deletion test/run_regression_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6e11e75

Please sign in to comment.