From 920ab6982a6c57d37b6fca0f77f35249c959773a Mon Sep 17 00:00:00 2001 From: Leonardo Di Donato Date: Fri, 19 Mar 2021 17:53:31 +0000 Subject: [PATCH] new(test): test cases about wrong threshold drop config value Signed-off-by: Leonardo Di Donato --- test/confs/drops_threshold_neg.yaml | 12 ++++++++++++ test/confs/drops_threshold_oor.yaml | 12 ++++++++++++ test/falco_tests.yaml | 18 ++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 test/confs/drops_threshold_neg.yaml create mode 100644 test/confs/drops_threshold_oor.yaml diff --git a/test/confs/drops_threshold_neg.yaml b/test/confs/drops_threshold_neg.yaml new file mode 100644 index 00000000..ed751bfb --- /dev/null +++ b/test/confs/drops_threshold_neg.yaml @@ -0,0 +1,12 @@ +syscall_event_drops: + threshold: -1 + actions: + - ignore + rate: .03333 + max_burst: 10 + simulate_drops: true + +stdout_output: + enabled: true + +log_stderr: true diff --git a/test/confs/drops_threshold_oor.yaml b/test/confs/drops_threshold_oor.yaml new file mode 100644 index 00000000..7dc08897 --- /dev/null +++ b/test/confs/drops_threshold_oor.yaml @@ -0,0 +1,12 @@ +syscall_event_drops: + threshold: 1.1 + actions: + - ignore + rate: .03333 + max_burst: 10 + simulate_drops: true + +stdout_output: + enabled: true + +log_stderr: true diff --git a/test/falco_tests.yaml b/test/falco_tests.yaml index b2de2cde..79555c88 100644 --- a/test/falco_tests.yaml +++ b/test/falco_tests.yaml @@ -1236,6 +1236,24 @@ trace_files: !mux stderr_contains: - "syscall event drop action \"log\" does not make sense with the \"ignore\" action" + monitor_syscall_drops_threshold_oor: + exit_status: 1 + rules_file: + - rules/single_rule.yaml + conf_file: confs/drops_threshold_oor.yaml + trace_file: trace_files/ping_sendto.scap + stderr_contains: + - "syscall event drops threshold must be a double in the range" + + monitor_syscall_drops_threshold_neg: + exit_status: 1 + rules_file: + - rules/single_rule.yaml + conf_file: confs/drops_threshold_neg.yaml + trace_file: trace_files/ping_sendto.scap + stderr_contains: + - "syscall event drops threshold must be a double in the range" + monitor_syscall_drops_log: exit_status: 0 rules_file: