Commit Graph

38 Commits

Author SHA1 Message Date
Jason Dellaluce
ecf13762b8 test(userspace/engine): add unit test cases for filter_macro_resolver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-03-23 18:31:43 +01:00
Leonardo Grasso
a4199814a0 fix(tests/engine): correct unit tests
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2022-01-28 15:33:22 +01:00
Jason Dellaluce
2ee0645f25 update(tests): remove token_bucket unit tests
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2022-01-04 16:41:18 +01:00
Jason Dellaluce
c93029ce74 fix(build): use correct libyaml variable in tests cmake
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-12-06 19:04:15 +01:00
Jason Dellaluce
076aabcea6 test(falco): adding unit tests for yaml_configuration
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-12-06 19:04:15 +01:00
Jason Dellaluce
d8c588becf update: add yaml-cpp to unit tests
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2021-12-06 19:04:15 +01:00
Mark Stemm
38a7f7ada0 cmake/build changes for plugins
Add a cmake module "plugins" that does the following:

 - Downloads/installs the plugins artifacts from a known tag
 - Copies the resulting cloudtrail/json shared libraries to
   CMAKE_CURRENT_BINARY_DIR/plugins
 - Installs them to FALCO_SHARE_DIR/plugins

The default config will define the plugins but they will be disabled
by default.

Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Co-authored-by: Loris Degioanni <loris@sysdig.com>
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-11-12 18:27:59 +01:00
Mark Stemm
10d47cb1f5 Update automated tests to reflect evttypes behavior
With the changes in https://github.com/falcosecurity/libs/pull/74,
there isn't any need to warn about the order of operators and the
evt.type field--the set of event types for a filter should be exact
now regardless of the order of operators.

So update tests that were logging those warnings to note that the
warnings won't occur any more.

Also, some tests more accurately *do* note that they have an overly
permissive evttype (e.g. ones related to syscalls, which are uncommon
and are evaluated for all event types) to reflect the new behavior.

Finally, in unit tests create an actual sinsp filter instead of a
gen_event_filter, which is the base class and shouldn't be created
directly.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Mark Stemm
044a7c153e Don't track event "tags" i.e. event types in rulesets
Modify rulesets to not keep track of the event types for a given set
filter. Instead, using the changes in
https://github.com/falcosecurity/libs/pull/74 event types are returned
directly by the filter.

Within each ruleset, there's a vector that maps from event number to
set of filters that are related to that event number. There's also a
general set of filters for all event types.

run() both indexes into the per-event vector as well as iterate over
the all event types set.

Also, used shared_ptr instead of direct pointers, which matches the
updated interface used by lua_parser. This simplifies the bookkeeping
a bit (no more delete when removing rulesets).

Given these changes, there's no need for a separate
falco_sinsp_ruleset class any longer, so remove it.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-10-12 17:59:38 +02:00
Leonardo Grasso
0c1ed551ca build: remove civetweb when minimal build
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2020-09-10 15:01:07 +02:00
Leonardo Di Donato
d808c0aeaf update(tests/engine): test is_unix_scheme
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2020-05-21 18:15:46 +02:00
Lorenzo Fontana
2680a459ec new(tests/engine): update socket path
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2020-05-21 18:15:46 +02:00
Lorenzo Fontana
05ce5b7f0b new(tests): cases for falco::utils::starts_with
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2020-05-21 18:15:46 +02:00
Lorenzo Fontana
d0f4f7cbb5 docs(tests): fix typo
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2020-05-14 15:02:15 +02:00
Lorenzo Fontana
1d43d4eb40 build(tests): allow to pass FALCO_TESTS_ARGUMENTS to the tests target
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2020-05-14 15:02:15 +02:00
Lorenzo Fontana
e9e2547a44 docs(tests): initial unit-tests readme
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2020-05-14 15:02:15 +02:00
Mark Stemm
8adcc95bac Add unit tests for ruleset handling
A new unit test file test_rulesets adds tests for the following:

 - enabling/disabling rules based on substrings
 - enabling/disabling rules based on exact matches
 - enabling/disabling rules based on tags

There are variants that test for default and non-default rulesets.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-05-11 14:15:42 +02:00
Mark Stemm
176d6f2bfe Make token bucket unit test pass valgrind
Previously, valgrind was complaining about the leaked token bucket.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-05-11 14:15:42 +02:00
Leonardo Di Donato
c374264384 docs(tests/falco): license for webserver unit tests
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2020-02-07 11:28:57 +01:00
Mark Stemm
1d1ecd9905 Add explicit catch2 dependency for tests
When I try to build the dev branch using the docker builder, the tests
target isn't properly checking out and building catch2 for the
dependency catch2.hpp. Adding this explicit dependency allowed the build
to succeed.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2019-10-08 16:12:18 +02:00
Lorenzo Fontana
c76518c681 update: license headers
Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-10-08 16:02:26 +02:00
Leonardo Di Donato
a019b54fe6 docs: specify labels that apply to each area
If this work as intended PR will automatically get the area labels depending on the files he modified.
In case the user wants it can still apply other areas manually, by slash command, or editing the PR template during the opening of the PR.

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-09-16 10:11:25 +02:00
Leonardo Di Donato
3a1ab88111 new: webserver unit test skeleton
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-08-13 15:48:06 +02:00
Leonardo Di Donato
2439e97da6 update(tests): setup unit tests for userspace/falco too
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-08-13 15:48:06 +02:00
Lorenzo Fontana
19c12042f4 update: sysdig dir gate in subdirectories
Signed-off-by: Lorenzo Fontana <lo@linux.com>

Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-03 15:27:28 +02:00
Lorenzo Fontana
b2ef08fd30 chore: clang format following the current style
Signed-off-by: Lorenzo Fontana <lo@linux.com>

Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-03 09:07:00 +02:00
Leonardo Di Donato
08454dfa53 new: test token bucket declaration triggers the default init
Co-Authored-By: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-02 17:52:29 +02:00
Leonardo Di Donato
583be9ce22 udpate: catch2 tests config
Co-Authored-By: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-02 17:52:29 +02:00
Leonardo Di Donato
71b2fe6e14 update: token bucket tests
Co-authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-02 17:52:29 +02:00
Leonardo Di Donato
1a0cf69b03 chore: cmakes formatting
Co-Authored-By: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-02 17:52:29 +02:00
Leonardo Di Donato
815f5d8714 new: test token bucket
Co-authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-02 17:52:29 +02:00
Leonardo Di Donato
11838548df build: includes for tests
Co-Authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-02 17:52:29 +02:00
Lorenzo Fontana
93537ccaea update: test files should use the naming convention
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-06-25 17:01:38 +02:00
Lorenzo Fontana
4174822617 fix: remove example file from cmake tests
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-06-25 17:01:38 +02:00
Lorenzo Fontana
adabae4f63 update: build unit tests in travis
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com>
2019-06-25 17:01:38 +02:00
Lorenzo Fontana
6e92988425 docs: licensing info in test files
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-06-25 17:01:38 +02:00
Lorenzo Fontana
026f6866e3 new: attach tests to main cmake and base test
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-06-25 17:01:38 +02:00
Lorenzo Fontana
18b66330ec new: tests cmake setup
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-06-25 17:01:38 +02:00