Skip to content

Commit

Permalink
Ad docs on how to run regression tests
Browse files Browse the repository at this point in the history
Reflects the changes in falcosecurity/falco#584.
  • Loading branch information
mstemm committed Apr 26, 2019
1 parent 89cdc9d commit f4c9206
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions content/docs/source.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ weight: 6

Building falco requires having `cmake` and `g++` installed.

## Build using docker-builder container
## Build using falco-builder container

One easy way to build falco is to run the [falco-builder](https://hub.docker.com/r/falcosecurity/falco-builder) container. It contains the reference toolchain we use to build packages.

Expand All @@ -20,15 +20,35 @@ built for the files in the centos image, not the host.
* `BUILD_WARNINGS_AS_ERRORS`: consider all build warnings fatal
* `MAKE_JOBS`: passed to the -j argument of make

A typical way to run this builder is the following. Assumes you have
A typical way to run this builder is the following. Assuming you have
checked out falco and sysdig to directories below /home/user/src, and
want to use a build directory of /home/user/build/falco:
want to use a build directory of /home/user/build/falco, you would run
the following:

```bash
docker run --user $(id -u):$(id -g) -v /etc/passwd:/etc/passwd:ro -e MAKE_JOBS=4 -it -v /home/user/src:/source -v /home/user/build/falco:/build falcosecurity/falco-builder cmake
docker run --user $(id -u):$(id -g) -v /etc/passwd:/etc/passwd:ro -e MAKE_JOBS=4 -it -v /home/user/src:/source -v /home/user/build/falco:/build falcosecurity/falco-builder package
```

### Test using falco-tester container

If you'd like to run the regression test suite against your build, you can use the [falco-tester](https://hub.docker.com/r/falcosecurity/falco-tester) container. Like the builder image, it contains the necessary environment to run the regression tests, but relies on a source directory and build directory that are mounted into the image. It's a different image than `falco-builder` as it doesn't need a compiler and needs a different base image to include the test runner framework [avocado](http://avocado-framework.github.io/).

It does build a new container image `falcosecurity/falco:test` to test the process of buillding and running a container with the falco packages built during the build step.

The image depends on the following parameters:

* `FALCO_VERSION`: The version of the falco package to include in the test container image.

A typical way to run this builder is the following. Assuming you have
checked out falco and sysdig to directories below /home/user/src, and
want to use a build directory of /home/user/build/falco, you would run
the following:

```bash
docker run --user $(id -u):$(id -g) -v /boot:/boot:ro -v /var/run/docker.sock:/var/run/docker.sock -v /etc/passwd:/etc/passwd:ro -e FALCO_VERSION=${FALCO_VERSION} -v /home/user/src::/source -v /home/user/build/falco:/build falcosecurity/falco-tester
```

## Build directly on host

If you'd rather build directly on the host, you can use your local toolchain and cmake binaries.
Expand Down

0 comments on commit f4c9206

Please sign in to comment.