diff options
Diffstat (limited to 'debian/tests')
-rwxr-xr-x | debian/tests/cfgtool | 9 | ||||
-rw-r--r-- | debian/tests/control | 7 | ||||
-rwxr-xr-x | debian/tests/logrotate | 19 | ||||
-rwxr-xr-x | debian/tests/quorumtool | 9 |
4 files changed, 44 insertions, 0 deletions
diff --git a/debian/tests/cfgtool b/debian/tests/cfgtool new file mode 100755 index 0000000..2f1bdcb --- /dev/null +++ b/debian/tests/cfgtool @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +OUTPUT="${AUTOPKGTEST_ARTIFACTS:-.}/cfgtool.txt" + +corosync-cfgtool -s >"$OUTPUT" +cat "$OUTPUT" +grep -q '^[[:blank:]]*nodeid:[[:blank:]]*1:[[:blank:]]*localhost$' "$OUTPUT" diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..ee109c2 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,7 @@ +Depends: @ +Restrictions: needs-root, isolation-container +Tests: cfgtool quorumtool + +Depends: @, logrotate +Restrictions: allow-stderr, needs-root, isolation-container +Tests: logrotate diff --git a/debian/tests/logrotate b/debian/tests/logrotate new file mode 100755 index 0000000..5d8b97c --- /dev/null +++ b/debian/tests/logrotate @@ -0,0 +1,19 @@ +#!/bin/sh + +set -ex + +OUTPUT="${AUTOPKGTEST_ARTIFACTS:-.}/logrotate.txt" + +LOG="/var/log/corosync/corosync.log" + +logrotate --force --log "$OUTPUT" /etc/logrotate.d/corosync +cat "$OUTPUT" +grep -q "rotating log $LOG," "$OUTPUT" + +[ -e "$LOG" ] +! [ -s "$LOG" ] + +# Reload config to generate logs +corosync-cfgtool -R + +grep -q 'Config reload requested' "$LOG" diff --git a/debian/tests/quorumtool b/debian/tests/quorumtool new file mode 100755 index 0000000..26b7b38 --- /dev/null +++ b/debian/tests/quorumtool @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +OUTPUT="${AUTOPKGTEST_ARTIFACTS:-.}/quorumtool.txt" + +corosync-quorumtool >"$OUTPUT" +cat "$OUTPUT" +grep -q ' 1 node1 (local)' "$OUTPUT" |