From 3bfd94fefd1cf7bb3a5c01cb38c27d8bb3402ea6 Mon Sep 17 00:00:00 2001 From: Leonardo Di Donato Date: Mon, 25 May 2020 09:13:45 +0000 Subject: [PATCH] docs(test): run locally handling python deps with venv Co-authored-by: Lorenzo Fontana Signed-off-by: Leonardo Di Donato --- docker/tester/root/usr/bin/usage | 2 +- test/README.md | 35 +++++++++++++++++++++++++++++++- test/confs/program_output.yaml | 8 ++++---- userspace/falco/falco.cpp | 2 +- 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/docker/tester/root/usr/bin/usage b/docker/tester/root/usr/bin/usage index 1dd170be..4f362ade 100755 --- a/docker/tester/root/usr/bin/usage +++ b/docker/tester/root/usr/bin/usage @@ -30,7 +30,7 @@ How to use. How to build. - * cd docker/builder && DOCKER_BUILDKIT=1 docker build -t falcosecurity/falco-tester . + * cd docker/tester && DOCKER_BUILDKIT=1 docker build -t falcosecurity/falco-tester . Environment. diff --git a/test/README.md b/test/README.md index b4f95271..889452b5 100644 --- a/test/README.md +++ b/test/README.md @@ -1,6 +1,39 @@ -# Falco Regression tests +# Falco regression tests This folder contains the Regression tests suite for Falco. You can find instructions on how to run this test suite on the Falco website [here](https://falco.org/docs/source/#run-regression-tests). +## Test suites + +- [falco_tests](./falco_tests.yaml) +- [falco_traces](./falco_traces.yaml) +- [falco_tests_package](./falco_tests_package.yaml) +- [falco_k8s_audit_tests](./falco_k8s_audit_tests.yaml) +- [falco_tests_psp](./falco_tests_psp.yaml) + +## Running locally + +Using `virtualenv` the steps to locally run a specific test suite are the following ones (from this directory): + +```console +virtualenv venv +source venv/bin/activate +pip install -r requirements.txt +BUILD_DIR="../build" avocado run --mux-yaml falco_tests.yaml --job-results-dir /tmp/job-results -- falco_test.py +deactivate +``` + +The name of the specific test suite to run is `falco_tests.yaml` in this case. Change it to run others test suites. + +In case you want to only execute a specific test case, use the `--mux-filter-only` parameter as follows: + +```console +BUILD_DIR="../build" avocado run --mux-yaml falco_tests.yaml --job-results-dir /tmp/job-results --mux-filter-only /run/trace_files/program_output -- falco_test.py +``` + +To obtain the path of all the available variants, execute: + +```console +avocado variants --mux-yaml falco_test.yaml +``` \ No newline at end of file diff --git a/test/confs/program_output.yaml b/test/confs/program_output.yaml index 81e66796..24bd96a8 100644 --- a/test/confs/program_output.yaml +++ b/test/confs/program_output.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019 The Falco Authors. +# Copyright (C) 2020 The Falco Authors. # # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,14 +21,14 @@ rules_file: /etc/falco_rules.yaml # Whether to output events in json or text json_output: false -# Send information logs to stderr and/or syslog Note these are *not* security -# notification logs! These are just Falco lifecycle (and possibly error) logs. +# Send information logs to stderr and/or syslog +# Note these are *not* security notification logs! +# These are just Falco lifecycle (and possibly error) logs. log_stderr: false log_syslog: false # Where security notifications should go. # Multiple outputs can be enabled. - syslog_output: enabled: false diff --git a/userspace/falco/falco.cpp b/userspace/falco/falco.cpp index bf2a7ffc..148f08d1 100644 --- a/userspace/falco/falco.cpp +++ b/userspace/falco/falco.cpp @@ -1203,7 +1203,7 @@ int falco_init(int argc, char **argv) webserver.start(); } - // grpc server + // gRPC server if(config.m_grpc_enabled) { // TODO(fntlnz,leodido): when we want to spawn multiple threads we need to have a queue per thread, or implement