syslog-ng source
test_logsource.c File Reference
#include <criterion/criterion.h>
#include <criterion/parameterized.h>
#include "logsource.h"
#include "logmsg/logmsg.h"
#include "logpipe.h"
#include "cfg.h"
#include "apphook.h"
#include "dynamic-window-pool.h"
#include <syslog.h>
#include <string.h>
Include dependency graph for test_logsource.c:

Classes

struct  TestSource
 
struct  TestPipe
 
struct  MangleHostnameParams
 

Macros

#define TEST_SOURCE_GROUP   "test_source_group"
 
#define TEST_STATS_ID   "test_stats_id"
 
#define LONG_HOSTNAME_SIZE   512
 

Functions

void setup (void)
 
void teardown (void)
 
void test_source_wakeup (LogSource *s)
 
LogSource * test_source_init (LogSourceOptions *options)
 
void test_source_destroy (LogSource *source)
 
TestPipetest_pipe_init (void)
 
void test_pipe_ack_messages (TestPipe *pipe, gsize ack_count)
 
void test_pipe_destroy (TestPipe *pipe)
 
const gchar * resolve_sockaddr_to_hostname (gsize *result_len, GSockAddr *saddr, const HostResolveOptions *host_resolve_options)
 
 ParameterizedTestParameters (log_source, test_mangle_hostname)
 
 ParameterizedTest (MangleHostnameParams *test_params, log_source, test_mangle_hostname)
 
 Test (log_source, test_chain_hostname_truncates_long_chained_hostnames)
 
 Test (log_source, test_host_and_program_override)
 
 Test (log_source, test_source_tags)
 
 Test (log_source, test_suspend)
 
 Test (log_source, test_wakeup)
 
 Test (log_source, test_forced_suspend_and_wakeup)
 
 Test (log_source, test_mangle_callback)
 
 Test (log_source, test_dynamic_window_is_disabled_by_default)
 
 Test (log_source, test_dynamic_window)
 
 TestSuite (log_source,.init=setup,.fini=teardown)
 

Variables

GlobalConfig * cfg
 
LogSourceOptions source_options
 

Macro Definition Documentation

◆ LONG_HOSTNAME_SIZE

#define LONG_HOSTNAME_SIZE   512

◆ TEST_SOURCE_GROUP

#define TEST_SOURCE_GROUP   "test_source_group"

◆ TEST_STATS_ID

#define TEST_STATS_ID   "test_stats_id"

Function Documentation

◆ ParameterizedTest()

ParameterizedTest ( MangleHostnameParams test_params,
log_source  ,
test_mangle_hostname   
)

◆ ParameterizedTestParameters()

ParameterizedTestParameters ( log_source  ,
test_mangle_hostname   
)

◆ resolve_sockaddr_to_hostname()

const gchar* resolve_sockaddr_to_hostname ( gsize *  result_len,
GSockAddr saddr,
const HostResolveOptions host_resolve_options 
)

◆ setup()

void setup ( void  )

◆ teardown()

void teardown ( void  )

◆ Test() [1/9]

Test ( log_source  ,
test_chain_hostname_truncates_long_chained_hostnames   
)

◆ Test() [2/9]

Test ( log_source  ,
test_dynamic_window   
)

◆ Test() [3/9]

Test ( log_source  ,
test_dynamic_window_is_disabled_by_default   
)

◆ Test() [4/9]

Test ( log_source  ,
test_forced_suspend_and_wakeup   
)

◆ Test() [5/9]

Test ( log_source  ,
test_host_and_program_override   
)

◆ Test() [6/9]

Test ( log_source  ,
test_mangle_callback   
)

◆ Test() [7/9]

Test ( log_source  ,
test_source_tags   
)

◆ Test() [8/9]

Test ( log_source  ,
test_suspend   
)

◆ Test() [9/9]

Test ( log_source  ,
test_wakeup   
)

◆ test_pipe_ack_messages()

void test_pipe_ack_messages ( TestPipe pipe,
gsize  ack_count 
)

◆ test_pipe_destroy()

void test_pipe_destroy ( TestPipe pipe)

◆ test_pipe_init()

TestPipe* test_pipe_init ( void  )

◆ test_source_destroy()

void test_source_destroy ( LogSource *  source)

◆ test_source_init()

LogSource* test_source_init ( LogSourceOptions options)

◆ test_source_wakeup()

void test_source_wakeup ( LogSource *  s)

◆ TestSuite()

TestSuite ( log_source  ,
init = setup,
fini = teardown 
)

Variable Documentation

◆ cfg

GlobalConfig* cfg

◆ source_options

LogSourceOptions source_options