diff options
author | Ruediger Meier | 2015-03-24 19:37:01 +0100 |
---|---|---|
committer | Ruediger Meier | 2015-03-26 12:17:39 +0100 |
commit | d06aed236eb2dc7fb8dae97aac0a88b2e9adab34 (patch) | |
tree | 3ebdddd78c09cf337ca59247ae0b4862538b3975 /tests/ts/logger | |
parent | tests: avoid &>> for bash compatibility (diff) | |
download | kernel-qcow2-util-linux-d06aed236eb2dc7fb8dae97aac0a88b2e9adab34.tar.gz kernel-qcow2-util-linux-d06aed236eb2dc7fb8dae97aac0a88b2e9adab34.tar.xz kernel-qcow2-util-linux-d06aed236eb2dc7fb8dae97aac0a88b2e9adab34.zip |
tests: verify logger return value
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/ts/logger')
-rwxr-xr-x | tests/ts/logger/errors | 9 | ||||
-rwxr-xr-x | tests/ts/logger/formats | 6 | ||||
-rwxr-xr-x | tests/ts/logger/journald | 2 | ||||
-rwxr-xr-x | tests/ts/logger/options | 1 |
4 files changed, 17 insertions, 1 deletions
diff --git a/tests/ts/logger/errors b/tests/ts/logger/errors index 369ceb6e2..c50b3e56a 100755 --- a/tests/ts/logger/errors +++ b/tests/ts/logger/errors @@ -32,34 +32,43 @@ export LOGGER_TEST_GETPID="98765" ts_init_subtest "kern_priority" $TS_HELPER_LOGGER --no-act -s -t "prio" -p kern.emerg "message" > "$TS_OUTPUT" 2>&1 +echo "ret: $?" >> "$TS_OUTPUT" ts_finalize_subtest ts_init_subtest "kern_priority_numeric" $TS_HELPER_LOGGER --no-act -s -t "prio" -p 0 "message" > "$TS_OUTPUT" 2>&1 +echo "ret: $?" >> "$TS_OUTPUT" ts_finalize_subtest ts_init_subtest "invalid_prio" $TS_HELPER_LOGGER --no-act -s -t "prio" -p 8 "message" > "$TS_OUTPUT" 2>&1 +echo "ret: $?" >> "$TS_OUTPUT" ts_finalize_subtest # should truncate ts_init_subtest "rfc5424_exceed_size" $TS_HELPER_LOGGER --no-act -s -t "rfc5424_exceed_size" --rfc5424 --size 3 "abcd" > "$TS_OUTPUT" 2>&1 +echo "ret: $?" >> "$TS_OUTPUT" ts_finalize_subtest ts_init_subtest "id_with_space" $TS_HELPER_LOGGER --no-act -s -t "id_with_space" --id="A B" "message" > "$TS_OUTPUT" 2>&1 +echo "ret: $?" >> "$TS_OUTPUT" $TS_HELPER_LOGGER --no-act -s -t "rfc5424_id_with_space" --rfc5424 --id="A B" "message" >> "$TS_OUTPUT" 2>&1 +echo "ret: $?" >> "$TS_OUTPUT" ts_finalize_subtest # should not fail ts_init_subtest "tag_with_space" $TS_HELPER_LOGGER --no-act -s -t "A B" "tag_with_space" > "$TS_OUTPUT" 2>&1 +echo "ret: $?" >> "$TS_OUTPUT" $TS_HELPER_LOGGER --no-act -s -t "A B" --rfc5424 "tag_with_space_rfc5424" >> "$TS_OUTPUT" 2>&1 +echo "ret: $?" >> "$TS_OUTPUT" ts_finalize_subtest ts_init_subtest "rfc5424_msgid_with_space" $TS_HELPER_LOGGER --no-act -s -t "rfc5424_msgid_with_space" --rfc5424 --msgid="A B" "message" > "$TS_OUTPUT" 2>&1 +echo "ret: $?" >> "$TS_OUTPUT" ts_finalize_subtest ts_finalize diff --git a/tests/ts/logger/formats b/tests/ts/logger/formats index 4d11c1d9b..a647b8159 100755 --- a/tests/ts/logger/formats +++ b/tests/ts/logger/formats @@ -32,25 +32,31 @@ export LOGGER_TEST_GETPID="98765" ts_init_subtest "rfc3164" $TS_HELPER_LOGGER -s --no-act -t "rfc3164" --rfc3164 "message" > "$TS_OUTPUT" 2>&1 +echo "ret: $?" >> "$TS_OUTPUT" ts_finalize_subtest ts_init_subtest "rfc5424_simple" $TS_HELPER_LOGGER -s --no-act -t "rfc5424" --rfc5424 "message" > "$TS_OUTPUT" 2>&1 +echo "ret: $?" >> "$TS_OUTPUT" ts_finalize_subtest ts_init_subtest "rfc5424_notime" $TS_HELPER_LOGGER -s --no-act -t "rfc5424" --rfc5424=notime "message" > "$TS_OUTPUT" 2>&1 +echo "ret: $?" >> "$TS_OUTPUT" ts_finalize_subtest ts_init_subtest "rfc5424_nohost" $TS_HELPER_LOGGER -s --no-act -t "rfc5424" --rfc5424=nohost "message" > "$TS_OUTPUT" 2>&1 +echo "ret: $?" >> "$TS_OUTPUT" ts_finalize_subtest ts_init_subtest "rfc5424_msgid" $TS_HELPER_LOGGER -s --no-act -t "rfc5424" --rfc5424 --msgid "MSGID" "message" > "$TS_OUTPUT" 2>&1 +echo "ret: $?" >> "$TS_OUTPUT" 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 + echo "ret: $?" >> "$TS_OUTPUT" done done ts_finalize_subtest diff --git a/tests/ts/logger/journald b/tests/ts/logger/journald index 846548aff..81296f78e 100755 --- a/tests/ts/logger/journald +++ b/tests/ts/logger/journald @@ -31,5 +31,5 @@ fi printf "%s\n%s\n%s\n" MESSAGE_ID=b8f74e14bc714bfc8040a5106dc9376a MESSAGE="a b c 1 2 3" | $TS_HELPER_LOGGER --no-act --journald --stderr > "$TS_OUTPUT" 2>&1 - +echo "ret: $?" >> "$TS_OUTPUT" ts_finalize diff --git a/tests/ts/logger/options b/tests/ts/logger/options index aa2123985..6bd323686 100755 --- a/tests/ts/logger/options +++ b/tests/ts/logger/options @@ -56,6 +56,7 @@ for i in "${tests_array[@]}"; do ts_init_subtest "$name" $TS_HELPER_LOGGER --stderr --no-act -t "test_tag" $options > "$TS_OUTPUT" 2>&1 + echo "ret: $?" >> "$TS_OUTPUT" ts_finalize_subtest done |