[Debian-ha-commits] [crmsh] 01/03: d/tests: add basic crm node tests

Valentin Vidic vvidic-guest at moszumanska.debian.org
Sun Nov 20 09:12:10 UTC 2016


This is an automated email from the git hooks/post-receive script.

vvidic-guest pushed a commit to branch master
in repository crmsh.

commit fa8e8c04c47fd8d3c8e4271163775dc80bb2cfb2
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date:   Sun Nov 20 09:49:58 2016 +0100

    d/tests: add basic crm node tests
    
    Check that current node is online, put it into
    standby or maintenance and add node attributes.
---
 debian/tests/control                  |  4 +++
 debian/tests/pacemaker-node-status.sh | 60 +++++++++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+)

diff --git a/debian/tests/control b/debian/tests/control
index b40bac6..2944608 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -13,3 +13,7 @@ Restrictions: needs-root
 Tests: pacemaker-basic-resource.sh
 Depends: @, pacemaker, corosync
 Restrictions: needs-root, allow-stderr, isolation-container
+
+Tests: pacemaker-node-status.sh
+Depends: @, pacemaker, corosync
+Restrictions: needs-root, allow-stderr, isolation-container
diff --git a/debian/tests/pacemaker-node-status.sh b/debian/tests/pacemaker-node-status.sh
new file mode 100644
index 0000000..422a60a
--- /dev/null
+++ b/debian/tests/pacemaker-node-status.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+set -ex
+
+DAEMON_TIMEOUT=60
+CRM_TIMEOUT=5
+NODE=$(hostname)
+
+#
+# daemons start
+#
+
+service corosync start
+service pacemaker start
+sleep $DAEMON_TIMEOUT
+
+#
+# online
+#
+
+crm status | grep "^Online:.*$NODE"
+
+#
+# standby
+#
+
+crm node standby
+sleep $CRM_TIMEOUT
+crm status | grep "^Node $NODE: standby"
+
+crm node online
+sleep $CRM_TIMEOUT
+crm status | grep "^Online:.*$NODE"
+
+#
+# maintenance
+#
+
+crm node maintenance
+sleep $CRM_TIMEOUT
+crm status | grep "^Node $NODE: maintenance"
+
+crm node ready
+sleep $CRM_TIMEOUT
+crm status | grep "^Online:.*$NODE"
+
+#
+# attributes
+#
+
+crm node attribute $NODE set memory_size 1024
+crm node attribute $NODE show memory_size | grep 1024
+crm node utilization $NODE set memory 2048
+crm node utilization $NODE show memory | grep 2048
+crm node server
+crm node show
+crm node status
+
+: INFO all tests OK
+exit 0

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/crmsh.git



More information about the Debian-HA-Commits mailing list