#include <criterion/criterion.h>#include <criterion/parameterized.h>#include "libtest/msg_parse_lib.h"#include "apphook.h"#include "logmsg/logmsg.h"#include "messages.h"#include "filter/filter-expr.h"#include "patterndb.h"#include "pdb-file.h"#include "plugin.h"#include "cfg.h"#include "timerwheel.h"#include <stdio.h>#include <sys/time.h>#include <time.h>#include <string.h>#include <stdlib.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <glib/gstdio.h>#include "test_patterndb.h"
Classes | |
| struct | PatternDBTestParam |
Functions | |
| void | assert_output_message_nvpair_equals (gint ndx, const gchar *name, const gchar *value, LogMessageValueType type) |
| void | assert_msg_matches_and_output_message_nvpair_equals_with_timeout (PatternDB *patterndb, const gchar *pattern, gint timeout, gint ndx, const gchar *name, const gchar *value, LogMessageValueType type) |
| void | assert_msg_matches_and_no_such_output_message (PatternDB *patterndb, const gchar *pattern, gint ndx) |
| void | assert_msg_matches_and_output_message_nvpair_equals (PatternDB *patterndb, const gchar *pattern, gint ndx, const gchar *name, const gchar *value, LogMessageValueType type) |
| void | assert_output_message_has_tag (gint ndx, const gchar *tag, gboolean set) |
| void | assert_msg_matches_and_output_message_has_tag_with_timeout (PatternDB *patterndb, const gchar *pattern, gint timeout, gint ndx, const gchar *tag, gboolean set) |
| void | assert_msg_matches_and_output_message_has_tag (PatternDB *patterndb, const gchar *pattern, gint ndx, const gchar *tag, gboolean set) |
| Test (pattern_db, test_simple_rule_without_context_or_actions) | |
| Test (pattern_db, test_correlation_rule_without_actions) | |
| Test (pattern_db, test_correlation_rule_with_action_on_match) | |
| Test (pattern_db, test_correlation_rule_with_action_on_timeout) | |
| Test (pattern_db, test_correlation_rule_with_action_condition) | |
| Test (pattern_db, test_correlation_rule_with_action_condition_filter) | |
| Test (pattern_db, test_correlation_rule_with_rate_limited_action) | |
| Test (pattern_db, test_simple_rule_with_action_on_match) | |
| Test (pattern_db, test_simple_rule_with_rate_limited_action) | |
| Test (pattern_db, test_simple_rule_with_action_condition) | |
| Test (pattern_db, test_correlation_rule_with_create_context) | |
| Test (pattern_db, test_patterndb_loads_a_syntactically_complete_xml_properly) | |
| Test (pattern_db, pdbtest_patterndb_message_property_inheritance_enabled) | |
| Test (pattern_db, test_patterndb_message_property_inheritance_disabled) | |
| Test (pattern_db, test_patterndb_message_property_inheritance_context) | |
| Test (pattern_db, test_patterndb_context_length_works_and_is_typed) | |
| ParameterizedTestParameters (pattern_db, test_rules) | |
| ParameterizedTest (PatternDBTestParam *param, pattern_db, test_rules) | |
| Test (pattern_db, test_tag_outside_of_rule_skeleton) | |
| void | test_pdb_get_filenames_setup (void) |
| void | test_pdb_get_filenames_teardown (void) |
| Test (test_pathutils, test_pdb_get_filenames,.init=test_pdb_get_filenames_setup,.fini=test_pdb_get_filenames_teardown) | |
| Test (pattern_db, match_in_program) | |
| Test (pattern_db, test_program_template) | |
| void | setup (void) |
| void | teardown (void) |
| TestSuite (pattern_db,.init=setup,.fini=teardown) | |
Variables | |
| GPtrArray * | messages |
| gboolean | keep_patterndb_state = FALSE |
| const gchar * | dirs [] |
| const gchar * | files [] |
| size_t | dirs_len = G_N_ELEMENTS(dirs) |
| size_t | files_len = G_N_ELEMENTS(files) |
| void assert_msg_matches_and_no_such_output_message | ( | PatternDB * | patterndb, |
| const gchar * | pattern, | ||
| gint | ndx | ||
| ) |
| void assert_msg_matches_and_output_message_has_tag | ( | PatternDB * | patterndb, |
| const gchar * | pattern, | ||
| gint | ndx, | ||
| const gchar * | tag, | ||
| gboolean | set | ||
| ) |
| void assert_msg_matches_and_output_message_has_tag_with_timeout | ( | PatternDB * | patterndb, |
| const gchar * | pattern, | ||
| gint | timeout, | ||
| gint | ndx, | ||
| const gchar * | tag, | ||
| gboolean | set | ||
| ) |
| void assert_msg_matches_and_output_message_nvpair_equals | ( | PatternDB * | patterndb, |
| const gchar * | pattern, | ||
| gint | ndx, | ||
| const gchar * | name, | ||
| const gchar * | value, | ||
| LogMessageValueType | type | ||
| ) |
| void assert_msg_matches_and_output_message_nvpair_equals_with_timeout | ( | PatternDB * | patterndb, |
| const gchar * | pattern, | ||
| gint | timeout, | ||
| gint | ndx, | ||
| const gchar * | name, | ||
| const gchar * | value, | ||
| LogMessageValueType | type | ||
| ) |
| void assert_output_message_has_tag | ( | gint | ndx, |
| const gchar * | tag, | ||
| gboolean | set | ||
| ) |
| void assert_output_message_nvpair_equals | ( | gint | ndx, |
| const gchar * | name, | ||
| const gchar * | value, | ||
| LogMessageValueType | type | ||
| ) |
| ParameterizedTest | ( | PatternDBTestParam * | param, |
| pattern_db | , | ||
| test_rules | |||
| ) |
| ParameterizedTestParameters | ( | pattern_db | , |
| test_rules | |||
| ) |
| void setup | ( | void | ) |
| void teardown | ( | void | ) |
| Test | ( | pattern_db | , |
| match_in_program | |||
| ) |
| Test | ( | pattern_db | , |
| pdbtest_patterndb_message_property_inheritance_enabled | |||
| ) |
| Test | ( | pattern_db | , |
| test_correlation_rule_with_action_condition | |||
| ) |
| Test | ( | pattern_db | , |
| test_correlation_rule_with_action_condition_filter | |||
| ) |
| Test | ( | pattern_db | , |
| test_correlation_rule_with_action_on_match | |||
| ) |
| Test | ( | pattern_db | , |
| test_correlation_rule_with_action_on_timeout | |||
| ) |
| Test | ( | pattern_db | , |
| test_correlation_rule_with_create_context | |||
| ) |
| Test | ( | pattern_db | , |
| test_correlation_rule_with_rate_limited_action | |||
| ) |
| Test | ( | pattern_db | , |
| test_correlation_rule_without_actions | |||
| ) |
| Test | ( | pattern_db | , |
| test_patterndb_context_length_works_and_is_typed | |||
| ) |
| Test | ( | pattern_db | , |
| test_patterndb_loads_a_syntactically_complete_xml_properly | |||
| ) |
| Test | ( | pattern_db | , |
| test_patterndb_message_property_inheritance_context | |||
| ) |
| Test | ( | pattern_db | , |
| test_patterndb_message_property_inheritance_disabled | |||
| ) |
| Test | ( | pattern_db | , |
| test_program_template | |||
| ) |
| Test | ( | pattern_db | , |
| test_simple_rule_with_action_condition | |||
| ) |
| Test | ( | pattern_db | , |
| test_simple_rule_with_action_on_match | |||
| ) |
| Test | ( | pattern_db | , |
| test_simple_rule_with_rate_limited_action | |||
| ) |
| Test | ( | pattern_db | , |
| test_simple_rule_without_context_or_actions | |||
| ) |
| Test | ( | pattern_db | , |
| test_tag_outside_of_rule_skeleton | |||
| ) |
| Test | ( | test_pathutils | , |
| test_pdb_get_filenames | , | ||
| . | init = test_pdb_get_filenames_setup, |
||
| . | fini = test_pdb_get_filenames_teardown |
||
| ) |
| void test_pdb_get_filenames_setup | ( | void | ) |
| void test_pdb_get_filenames_teardown | ( | void | ) |
| const gchar* dirs[] |
| size_t dirs_len = G_N_ELEMENTS(dirs) |
| const gchar* files[] |
| size_t files_len = G_N_ELEMENTS(files) |
| gboolean keep_patterndb_state = FALSE |
| GPtrArray* messages |