Commit Graph

149 Commits

Author SHA1 Message Date
Luca Guerra
df072dace7 update(libsinsp/tests): add CLI options test for append output
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-09 15:31:24 +02:00
Luca Guerra
8a19f1b135 update(tests): add message for failing configuration schema test
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-09 15:31:24 +02:00
Luca Guerra
d210ed2e4f new(app): add append_output configuration option with fields and format
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-09 15:31:24 +02:00
Luca Guerra
36d6951e77 new(falco): add test for object cli configuration, minor test fix
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-09-06 09:25:11 +02:00
Melissa Kilby
1caece2cf9 update(metrics): use new libs addr_to_string methods for host_ifinfo_json
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-08-27 10:18:26 +02:00
Melissa Kilby
23b412ea3c new(metrics): add host_ifinfo metric
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-08-27 10:18:26 +02:00
Federico Di Pierro
05bbe74d69 fix(unit_tests): skip Configuration.schema_validate_config test if Falco config is not present.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-08-26 18:06:25 +02:00
Federico Di Pierro
d1c715e7a8 chore(unit_tests,userspace): use nlhomann json instead of jsoncpp.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-08-26 18:06:25 +02:00
Federico Di Pierro
be927edfe8 new(userspace/falco,unit_tests): added new tests around schema validation feature.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-08-26 18:06:25 +02:00
Federico Di Pierro
94dc7da986 cleanup(unit_tests,userspace/falco): moved all config validation logic to be more testable.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-08-26 18:06:25 +02:00
Federico Di Pierro
6dfdfdd649 chore(unit_tests): moved config_files and env vars config tests to their own source file.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-08-26 18:06:25 +02:00
Jason Dellaluce
6783cc7055 fix(unit_tests): adapt tests to new engine warning formats
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-08-26 15:51:25 +02:00
Jason Dellaluce
cd1c5f911c refactor(userspace): move falco logger under falco engine
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-23 09:29:23 +02:00
Federico Di Pierro
a48965a00c chore(userspace,falco.yaml,unit_tests): configs_files -> config_files.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-05-20 16:33:11 +02:00
Melissa Kilby
b0f352e7b9 cleanup(test): add test cases for sanitize_metric_name
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-05-17 14:54:58 +02:00
Jason Dellaluce
64039196ad chore(unit_tests): fix linting issue
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-17 14:38:57 +02:00
Jason Dellaluce
ec9f148e0b test(engine): cover case of replaced or appended exceptions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-17 14:38:57 +02:00
Luca Guerra
abf82f6373 update(config): split init_from_content from init_from_file
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-05-14 12:47:46 +02:00
Luca Guerra
35bd348e21 new(falco): implement rule selection configuration in falco.yaml
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-05-14 12:47:46 +02:00
Jason Dellaluce
c6e3cfd115 test(engine): cover transformers and field-to-field checks in exceptions
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-08 20:23:55 +02:00
Jason Dellaluce
ed22e94292 refactor(userspace/libsinsp): support new filter ast structure in falco engine
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
2024-05-08 20:23:55 +02:00
Federico Aponte
62d1c4fc4d refactor: smart pointer usage
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-05-06 11:10:44 +02:00
Samuel Gaist
e50d647dc9 refactor(configuration): move webserver items in own struct
This makes things easier to pass around like when starting the
web server.

This has the added benefit of simplifying further extension such as
making the metrics endpoint name configurable without adding yet another
parameter to the start function.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-05-03 11:23:02 +02:00
Luca Guerra
d0945e5db5 cleanup(docs): fix typo in license blocks
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-04-19 16:52:58 +02:00
Gianmatteo Palmieri
eb04b1c66f fix(test): expect warning instead of error on invalid macro/list name
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-04-17 11:27:52 +02:00
Gianmatteo Palmieri
c3d0579d9b fix(test): expect warning instead of error in exceptions names test
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-04-11 17:22:28 +02:00
Federico Di Pierro
e840a4ada0 new(unit_tests,userspace/falco): support loading and merging configs files when used from cmdline option.
Also, moved core logic from yaml_helper to falco_configuration class.
Finally, updated tests.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro
a8345327d4 chore(unit_tests,userspace/falco): throw an exception when included config file is not present.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro
2a856f2cd3 chore(unit_tests): assert expected length of warnings.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro
74034213a2 chore(unit_test,userspace): better log management.
Also, warnings are now returned so that yaml_helper class does not need to log anything.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro
aac9b550d3 new(userspace,unit_tests): return loaded config filenames in config::load_from_file.
Add a debug log with the list of loaded config files.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro
df220e3c3b chore(userspace,unit_tests): support loading config files from directories.
The files inside the folder will be loaded in lexicographic order,
like we do for rules_file.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro
d3bf3a7560 chore(userspace/falco,unit_tests): renamed includes to configs_files.
Moreover, split single huge test into multiple smaller ones.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro
45754fda9f new(userspace,unit_tests): deny main config to include itself.
Moreover, added a couple more tests.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro
8112f6210b chore(userspace,unit_tests): enable override of main config from secondary config files.
Moreover, do not trigger an exception when an included file is not present; just print a warning.
Finally, add more tests.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro
6e1f128851 chore(unit_tests): more tests.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Federico Di Pierro
b3ebf9f57e new(userspace,unit_tests): introduce the possibility to split main config file into multiple config files.
The PR introduces a `includes` keyword in the config file,
that points to a list of strings (paths to other config files).

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-04-10 14:44:20 +02:00
Gianmatteo Palmieri
368463e295 new(tests): add unique exceptions names test
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-04-03 18:23:53 +02:00
Luca Guerra
f895f8fc78 fix(tests): fix uninitialized variable in test
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-03-29 14:08:24 +01:00
Gianmatteo Palmieri
a8018a2894 new(tests): test override/append exception with no values
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-03-27 09:15:13 +01:00
Luca Guerra
8421e4b122 fix(cmake): fix USE_BUNDLED_DEPS=ON and BUILD_FALCO_UNIT_TESTS=ON
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-03-25 16:47:06 +01:00
Gianmatteo Palmieri
3d4be156cc new(tests): add unit test for invalid macro/list name
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-03-08 00:02:01 +01:00
Gianmatteo Palmieri
928cb8bb8e new(tests): add unit test for exceptions condition
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
2024-02-28 08:28:26 +01:00
Federico Aponte
b4e55ee6a1 cleanup: falco_engine test fixture
Upgrade GTest to 1.14.0

Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-02-21 00:31:59 +01:00
Federico Aponte
745d18ba38 refactor: test AtomicSignalHandler.handle_once_wait_consistency
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
2024-02-20 15:19:56 +01:00
Samuel Gaist
e07f056fc5 fix(tests): remove unused variables in rule loader tests
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-19 18:01:48 +01:00
Andrea Terzolo
76ab28ff59 tests: remove deprecated assertions
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
2024-02-16 18:30:38 +01:00
Samuel Gaist
5e497a4119 fix(c++): improve const correctness
Reported by cppcheck

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-15 22:16:33 +01:00
Luca Guerra
fe5c58e20e cleanup(tests): use test_falco_engine in test_enable_rule
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-15 11:03:30 +01:00
Luca Guerra
baf9e77810 cleanup(tests): update configure_interesting_sets to use test_falco_engine
Signed-off-by: Luca Guerra <luca@guerra.sh>
2024-02-15 11:03:30 +01:00