Skip to content

Commit

Permalink
systemtests: add stdout and stderr as destination to messages
Browse files Browse the repository at this point in the history
  • Loading branch information
franku committed Feb 11, 2020
1 parent a7cc9e2 commit 795666e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions core/src/tests/messages.cc
Expand Up @@ -95,6 +95,8 @@ static bool DbLogInsertCallback_(JobControlRecord* jcr,

TEST(messages, send_message_to_all_configured_destinations)
{
debug_level = 200;

std::string config_dir = getenv_std_string("BAREOS_CONFIG_DIR");
std::string working_dir = getenv_std_string("BAREOS_WORKING_DIR");
std::string backend_dir = getenv_std_string("backenddir");
Expand Down
Expand Up @@ -5,4 +5,6 @@ Messages {
append = "@logdir@/bareos.log" = all, !skipped, !saved, !audit
catalog = all, !skipped, !saved, !audit
syslog = all
stdout = all
stderr = all
}
8 changes: 7 additions & 1 deletion systemtests/tests/messages-test/testrunner
Expand Up @@ -15,11 +15,15 @@ export TestName
console_messages_file="${working}"/.conmsg
syslog_file="${working}"/syslog.txt
dblog_file="${working}"/dblog.txt
stdout_file="${working}"/stdout.txt
stderr_file="${working}"/stderr.txt
extra_append_file="${logdir}"/bareos.log

rm -f "$console_messages_file"
rm -f "$syslog_file"
rm -f "$dblog_file"
rm -f "$stdout_file"
rm -f "$stderr_file"
rm -f "$extra_append_file"

function exit_error() {
Expand All @@ -39,11 +43,13 @@ function check_output_file {

start_test

${BAREOS_UNITTESTS_BINARY_DIR}/messages || exit_failure
${BAREOS_UNITTESTS_BINARY_DIR}/messages > "$stdout_file" 2> "$stderr_file" || exit_error

check_output_file "$console_messages_file"
check_output_file "$syslog_file"
check_output_file "$dblog_file"
check_output_file "$stdout_file"
check_output_file "$stderr_file"
check_output_file "$extra_append_file"

end_test

0 comments on commit 795666e

Please sign in to comment.