From 70f15f82608220f5351716d4fb29ff5d0c339010 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 08:40:13 +0200 Subject: Adding debian version 1.0.12-22. Signed-off-by: Daniel Baumann --- debian/tests/control | 14 +++++++++++++ debian/tests/ipctest | 5 +++++ debian/tests/logd | 47 ++++++++++++++++++++++++++++++++++++++++++++ debian/tests/stonith-null | 16 +++++++++++++++ debian/tests/stonith-suicide | 22 +++++++++++++++++++++ debian/tests/user | 5 +++++ 6 files changed, 109 insertions(+) create mode 100644 debian/tests/control create mode 100755 debian/tests/ipctest create mode 100755 debian/tests/logd create mode 100755 debian/tests/stonith-null create mode 100755 debian/tests/stonith-suicide create mode 100755 debian/tests/user (limited to 'debian/tests') diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..8ee5a30 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,14 @@ +Depends: cluster-glue +Tests: user, ipctest + +Depends: cluster-glue, rsyslog +Restrictions: needs-root +Tests: logd + +Depends: cluster-glue +Restrictions: needs-root +Tests: stonith-null + +Depends: cluster-glue +Restrictions: needs-root, isolation-machine +Tests: stonith-suicide diff --git a/debian/tests/ipctest b/debian/tests/ipctest new file mode 100755 index 0000000..df48cf6 --- /dev/null +++ b/debian/tests/ipctest @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e + +/usr/lib/heartbeat/ipctest 2>&1 diff --git a/debian/tests/logd b/debian/tests/logd new file mode 100755 index 0000000..6ef5f05 --- /dev/null +++ b/debian/tests/logd @@ -0,0 +1,47 @@ +#!/bin/sh + +set -e + +LOG=/var/log/syslog + +log_checker() { + if [ -f $LOG ]; then + grep "$1" $LOG && return 0 + else + journalctl -u logd.service --grep "$1" && return 0 + fi + return 1 +} + +check_log() { + for i in 1 2 3 4 5; do + log_checker "$1" && return 0 + sleep 1 + done + return 1 +} + +echo "=== service ===" +service logd restart # connect to rsyslog after it is installed +service logd status || ERR="$ERR service" + +echo "=== ha_logger ===" +for i in 1 2 3 4 5; do # logd might not be available right away + ha_logger autopkgtest-message 2>&1 && break + sleep 1 +done +check_log 'autopkgtest-message' || ERR="$ERR ha_logger" + +echo "=== logtest ===" +/usr/lib/heartbeat/logtest 10 2>&1 || true +check_log 'total message dropped: 0' || ERR="$ERR logtest" + +if [ "$ERR" ]; then + if [ -f $LOG ]; then + tail -n 20 $LOG + else + journalctl -u logd.service -n 20 + fi + echo "Failed checks:$ERR" + exit 1 +fi diff --git a/debian/tests/stonith-null b/debian/tests/stonith-null new file mode 100755 index 0000000..cecf8e9 --- /dev/null +++ b/debian/tests/stonith-null @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e +HOSTNAME=$(hostname) + +echo "=== list ===" +stonith -L + +printf "\n=== metadata ===\n" +stonith -t null -m + +printf "\n=== status ===\n" +stonith -d -t null hostlist=$HOSTNAME -S -l 2>&1 + +printf "\n=== reset ===\n" +stonith -d -t null hostlist=$HOSTNAME -T reset $HOSTNAME 2>&1 diff --git a/debian/tests/stonith-suicide b/debian/tests/stonith-suicide new file mode 100755 index 0000000..616d362 --- /dev/null +++ b/debian/tests/stonith-suicide @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +if [ "$AUTOPKGTEST_REBOOT_MARK" = fenced ]; then + echo "fence was successfull" + exit 0 +fi + +echo "=== list ===" +stonith -L + +printf "\n=== metadata ===\n" +stonith -t suicide -m + +printf "\n=== status ===\n" +stonith -d -t suicide -S -l 2>&1 + +printf "\n=== reset ===\n" +/tmp/autopkgtest-reboot-prepare fenced +sync +stonith -d -t suicide -T reset $(hostname) diff --git a/debian/tests/user b/debian/tests/user new file mode 100755 index 0000000..ca723ff --- /dev/null +++ b/debian/tests/user @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e + +id hacluster | grep haclient -- cgit v1.2.3