From 05c684d68ce5840eb110d609faacd07a63591270 Mon Sep 17 00:00:00 2001 From: Leonardo Grasso Date: Tue, 12 May 2020 16:30:24 +0200 Subject: [PATCH] test: add bin package (tar.gz) to integration test Signed-off-by: Leonardo Grasso --- docker/tester/root/runners/tar.gz.Dockerfile | 21 ++++++++++++++++++++ docker/tester/root/usr/bin/entrypoint | 2 ++ test/falco_tests_package.yaml | 8 ++++++++ 3 files changed, 31 insertions(+) create mode 100644 docker/tester/root/runners/tar.gz.Dockerfile diff --git a/docker/tester/root/runners/tar.gz.Dockerfile b/docker/tester/root/runners/tar.gz.Dockerfile new file mode 100644 index 00000000..d83f0d69 --- /dev/null +++ b/docker/tester/root/runners/tar.gz.Dockerfile @@ -0,0 +1,21 @@ +FROM ubuntu:18.04 +LABEL maintainer="cncf-falco-dev@lists.cncf.io" + +ARG FALCO_VERSION= +RUN test -n FALCO_VERSION +ENV FALCO_VERSION ${FALCO_VERSION} + +RUN apt update -y +RUN apt install dkms libyaml-0-2 curl -y + +ADD falco-${FALCO_VERSION}-x86_64.tar.gz / +RUN cp -R /falco-${FALCO_VERSION}-x86_64/* / + +# Change the falco config within the container to enable ISO 8601 output. +RUN sed -e 's/time_format_iso_8601: false/time_format_iso_8601: true/' < /etc/falco/falco.yaml > /etc/falco/falco.yaml.new \ + && mv /etc/falco/falco.yaml.new /etc/falco/falco.yaml + +COPY rules/*.yaml /rules/ +COPY trace_files/*.scap /traces/ + +CMD ["/usr/bin/falco"] diff --git a/docker/tester/root/usr/bin/entrypoint b/docker/tester/root/usr/bin/entrypoint index ab852f1e..aa3ce6b4 100755 --- a/docker/tester/root/usr/bin/entrypoint +++ b/docker/tester/root/usr/bin/entrypoint @@ -58,6 +58,7 @@ case "$CMD" in # build docker images build_image "$BUILD_DIR" "$BUILD_TYPE" "$FALCO_VERSION" "deb" build_image "$BUILD_DIR" "$BUILD_TYPE" "$FALCO_VERSION" "rpm" + build_image "$BUILD_DIR" "$BUILD_TYPE" "$FALCO_VERSION" "tar.gz" # check that source directory contains Falco if [ ! -d "$SOURCE_DIR/falco/test" ]; then @@ -73,6 +74,7 @@ case "$CMD" in # clean docker images clean_image "deb" clean_image "rpm" + clean_image "tar.gz" ;; "bash") CMD=/bin/bash diff --git a/test/falco_tests_package.yaml b/test/falco_tests_package.yaml index ced438a3..80a965e6 100644 --- a/test/falco_tests_package.yaml +++ b/test/falco_tests_package.yaml @@ -31,3 +31,11 @@ trace_files: !mux rules_file: /rules/rule_names_with_spaces.yaml trace_file: /traces/cat_write.scap conf_file: /etc/falco/falco.yaml + + docker_bin_package: + package: docker:falcosecurity/falco:test-tar.gz + detect: True + detect_level: WARNING + rules_file: /rules/rule_names_with_spaces.yaml + trace_file: /traces/cat_write.scap + conf_file: /etc/falco/falco.yaml \ No newline at end of file