From cf803759efd52aa20705b3dc4cbfa25eb1c9724d Mon Sep 17 00:00:00 2001 From: Leonardo Di Donato Date: Thu, 23 Jan 2020 12:19:21 +0000 Subject: [PATCH] fix(docker/tester): falco-tester does not have to check for docker/local anymore Co-Authored-by: Lorenzo Fontana Signed-off-by: Leonardo Di Donato --- .circleci/config.yml | 4 ++-- docker/tester/root/usr/bin/entrypoint | 13 +++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f9441e21..98a4114c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,13 +21,13 @@ jobs: cmake .. popd - run: - name: build + name: Build command: | pushd build make -j4 all popd - run: - name: run unit tests + name: Run unit tests command: | pushd build make tests diff --git a/docker/tester/root/usr/bin/entrypoint b/docker/tester/root/usr/bin/entrypoint index bf4ffc63..e1d19cbf 100755 --- a/docker/tester/root/usr/bin/entrypoint +++ b/docker/tester/root/usr/bin/entrypoint @@ -43,24 +43,21 @@ clean_image() { case "$CMD" in "test") - if [ ! -d "$BUILD_DIR/$BUILD_TYPE/docker/local" ]; then - echo "Missing $BUILD_DIR/$BUILD_TYPE/docker/local directory." >&2 - exit 1 - fi if [ -z "$FALCO_VERSION" ]; then echo "Automatically figuring out Falco version." - FALCO_VERSION=$($BUILD_DIR/$BUILD_TYPE/userspace/falco/falco --version | cut -d' ' -f3 | tr -d '\r') + FALCO_VERSION=$("$BUILD_DIR/$BUILD_TYPE/userspace/falco/falco" --version | cut -d' ' -f3 | tr -d '\r') + echo "Falco version: $FALCO_VERSION" fi if [ -z "$FALCO_VERSION" ]; then echo "Falco version cannot be guessed, please provide it with the FALCO_VERSION environment variable." >&2 exit 1 fi - + # build docker images build_image "$BUILD_DIR" "$BUILD_TYPE" "$FALCO_VERSION" "deb" build_image "$BUILD_DIR" "$BUILD_TYPE" "$FALCO_VERSION" "rpm" - # check that source directory contains Falco and sysdig + # check that source directory contains Falco if [ ! -d "$SOURCE_DIR/falco/test" ]; then echo "Missing $SOURCE_DIR/falco/test directory." >&2 exit 1 @@ -68,7 +65,7 @@ case "$CMD" in # run tests echo "Running regression tests ..." - cd `$SOURCE_DIR/falco/test` + cd "$SOURCE_DIR/falco/test" ./run_regression_tests.sh "$BUILD_DIR/$BUILD_TYPE" # clean docker images