syslog-ng source
test_python_persist_name.c File Reference
#include "python-module.h"
#include <criterion/criterion.h>
#include "libtest/grab-logging.h"
#include "python-helpers.h"
#include "apphook.h"
#include "python-dest.h"
#include "python-main.h"
#include "python-startup.h"
#include "python-global.h"
#include "python-fetcher.h"
#include "python-source.h"
#include "python-bookmark.h"
#include "python-ack-tracker.h"
#include "mainloop-worker.h"
#include "mainloop.h"
#include "python-persist.h"
#include "stats/stats-cluster-key-builder.h"
Include dependency graph for test_python_persist_name.c:

Functions

void setup (void)
 
void teardown (void)
 
 TestSuite (python_persist_name,.init=setup,.fini=teardown)
 
 Test (python_persist_name, test_python_dest)
 
 Test (python_persist_name, test_python_fetcher)
 
 Test (python_persist_name, test_python_source)
 
 Test (python_persist_name, test_python_exception_in_generate_persist_name)
 
 Test (python_persist_name, test_python_fetcher_no_generate_persist_name)
 
 Test (python_persist_name, test_python_source_no_generate_persist_name)
 
 Test (python_persist_name, test_python_source_readonly)
 
 Test (python_persist_name, test_python_fetcher_readonly)
 
 Test (python_persist_name, test_python_fetcher_persist_preference)
 
 Test (python_persist_name, test_python_source_persist_preference)
 

Variables

MainLoop * main_loop
 
MainLoopOptions main_loop_options = {0}
 
CFG_LTYPE yyltype
 
GlobalConfig * empty_cfg
 
const gchar * python_destination_code
 
const gchar * python_fetcher_code
 
const gchar * python_source_code
 
const gchar * python_persist_generator_code
 
const gchar * python_fetcher_code_no_generate_persist_name
 
const gchar * python_source_code_no_generate_persist_name
 
const gchar * python_source_code_readonly
 
const gchar * python_fetcher_code_readonly
 

Function Documentation

◆ setup()

void setup ( void  )

◆ teardown()

void teardown ( void  )

◆ Test() [1/10]

Test ( python_persist_name  ,
test_python_dest   
)

◆ Test() [2/10]

Test ( python_persist_name  ,
test_python_exception_in_generate_persist_name   
)

◆ Test() [3/10]

Test ( python_persist_name  ,
test_python_fetcher   
)

◆ Test() [4/10]

Test ( python_persist_name  ,
test_python_fetcher_no_generate_persist_name   
)

◆ Test() [5/10]

Test ( python_persist_name  ,
test_python_fetcher_persist_preference   
)

◆ Test() [6/10]

Test ( python_persist_name  ,
test_python_fetcher_readonly   
)

◆ Test() [7/10]

Test ( python_persist_name  ,
test_python_source   
)

◆ Test() [8/10]

Test ( python_persist_name  ,
test_python_source_no_generate_persist_name   
)

◆ Test() [9/10]

Test ( python_persist_name  ,
test_python_source_persist_preference   
)

◆ Test() [10/10]

Test ( python_persist_name  ,
test_python_source_readonly   
)

◆ TestSuite()

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

Variable Documentation

◆ empty_cfg

GlobalConfig* empty_cfg

◆ main_loop

MainLoop* main_loop

◆ main_loop_options

MainLoopOptions main_loop_options = {0}

◆ python_destination_code

const gchar* python_destination_code
Initial value:
= "\n\
from _syslogng import LogDestination\n\
class Dest(LogDestination):\n\
@staticmethod\n\
def generate_persist_name(options):\n\
return options['key']\n\
def send(self, message):\n\
return True"

◆ python_fetcher_code

const gchar* python_fetcher_code
Initial value:
= "\n\
from _syslogng import LogFetcher\n\
class Fetcher(LogFetcher):\n\
@staticmethod\n\
def generate_persist_name(options):\n\
return options['key']\n\
def fetch(self):\n\
return LogFetcher.FETCH_NO_DATA, None"

◆ python_fetcher_code_no_generate_persist_name

const gchar* python_fetcher_code_no_generate_persist_name
Initial value:
= "\n\
from _syslogng import LogFetcher\n\
class Fetcher(LogFetcher):\n\
def fetch(self):\n\
return LogFetcher.FETCH_NO_DATA, None"

◆ python_fetcher_code_readonly

const gchar* python_fetcher_code_readonly
Initial value:
= "\n\
from _syslogng import LogFetcher\n\
class Fetcher(LogFetcher):\n\
@staticmethod\n\
def generate_persist_name(options):\n\
return 'foo'\n\
def init(self, options):\n\
self.persist_name = 'readonly ...'\n\
return True\n\
def fetch(self):\n\
return LogFetcher.FETCH_NO_DATA, None"

◆ python_persist_generator_code

const gchar* python_persist_generator_code
Initial value:
= "\n\
def persist_generator_stats():\n\
raise Exception('exception for testing stats')\n\
def persist_generator_persist():\n\
raise Exception('exception for testing persist')"

◆ python_source_code

const gchar* python_source_code
Initial value:
= "\n\
from _syslogng import LogSource\n\
class Source(LogSource):\n\
@staticmethod\n\
def generate_persist_name(options):\n\
return options['key']\n\
def run(self):\n\
pass\n\
def request_exit(self):\n\
pass"

◆ python_source_code_no_generate_persist_name

const gchar* python_source_code_no_generate_persist_name
Initial value:
= "\n\
from _syslogng import LogSource\n\
class Source(LogSource):\n\
def run(self):\n\
pass\n\
def request_exit(self):\n\
pass"

◆ python_source_code_readonly

const gchar* python_source_code_readonly
Initial value:
= "\n\
from _syslogng import LogSource\n\
class Source(LogSource):\n\
@staticmethod\n\
def generate_persist_name(options):\n\
return 'foo'\n\
def init(self, options):\n\
self.persist_name = 'readonly...'\n\
return True\n\
def run(self):\n\
pass\n\
def request_exit(self):\n\
pass"

◆ yyltype

CFG_LTYPE yyltype