#!/bin/bash # # Copyright (C) 2015 Sami Kerola # # This file is part of util-linux. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This file is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # TS_TOPDIR="${0%/*}/../.." TS_DESC="formats" . $TS_TOPDIR/functions.sh ts_init "$*" ts_check_test_command "$TS_HELPER_LOGGER" export TZ="GMT" export LOGGER_TEST_TIMEOFDAY="1234567890.123456" export LOGGER_TEST_HOSTNAME="test-hostname" export LOGGER_TEST_GETPID="98765" ts_init_subtest "rfc3164" $TS_HELPER_LOGGER -s --no-act -t "rfc3164" --rfc3164 "message" > "$TS_OUTPUT" 2>&1 ts_finalize_subtest ts_init_subtest "rfc5424_simple" $TS_HELPER_LOGGER -s --no-act -t "rfc5424" --rfc5424 "message" > "$TS_OUTPUT" 2>&1 ts_finalize_subtest ts_init_subtest "rfc5424_notime" $TS_HELPER_LOGGER -s --no-act -t "rfc5424" --rfc5424=notime "message" > "$TS_OUTPUT" 2>&1 ts_finalize_subtest ts_init_subtest "rfc5424_nohost" $TS_HELPER_LOGGER -s --no-act -t "rfc5424" --rfc5424=nohost "message" > "$TS_OUTPUT" 2>&1 ts_finalize_subtest ts_init_subtest "rfc5424_msgid" $TS_HELPER_LOGGER -s --no-act -t "rfc5424" --rfc5424 --msgid "MSGID" "message" > "$TS_OUTPUT" 2>&1 ts_finalize_subtest ts_init_subtest "priorities" for facility in auth authpriv cron daemon ftp lpr mail news syslog user uucp local{0..7}; do for level in emerg alert crit err warning notice info debug; do $TS_HELPER_LOGGER -s --no-act -t "prio" -p "$facility.$level" "$facility.$level" >> "$TS_OUTPUT" 2>&1 done done ts_finalize_subtest ts_finalize