[pve-devel] [RFC v3 pve-ha-manager 7/8] new test for node shutdown

Dietmar Maurer dietmar at proxmox.com
Wed Dec 16 09:04:49 CET 2015


Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 src/test/test-shutdown1/cmdlist         |  4 ++++
 src/test/test-shutdown1/hardware_status |  5 +++++
 src/test/test-shutdown1/log.expect      | 40 +++++++++++++++++++++++++++++++++
 src/test/test-shutdown1/manager_status  |  1 +
 src/test/test-shutdown1/service_config  |  3 +++
 5 files changed, 53 insertions(+)
 create mode 100644 src/test/test-shutdown1/cmdlist
 create mode 100644 src/test/test-shutdown1/hardware_status
 create mode 100644 src/test/test-shutdown1/log.expect
 create mode 100644 src/test/test-shutdown1/manager_status
 create mode 100644 src/test/test-shutdown1/service_config

diff --git a/src/test/test-shutdown1/cmdlist b/src/test/test-shutdown1/cmdlist
new file mode 100644
index 0000000..a86b9e2
--- /dev/null
+++ b/src/test/test-shutdown1/cmdlist
@@ -0,0 +1,4 @@
+[
+    [ "power node1 on", "power node2 on", "power node3 on"],
+    [ "shutdown node3" ]
+]
diff --git a/src/test/test-shutdown1/hardware_status b/src/test/test-shutdown1/hardware_status
new file mode 100644
index 0000000..119b81c
--- /dev/null
+++ b/src/test/test-shutdown1/hardware_status
@@ -0,0 +1,5 @@
+{ 
+  "node1": { "power": "off", "network": "off" },
+  "node2": { "power": "off", "network": "off" },
+  "node3": { "power": "off", "network": "off" }
+}
\ No newline at end of file
diff --git a/src/test/test-shutdown1/log.expect b/src/test/test-shutdown1/log.expect
new file mode 100644
index 0000000..9911cd8
--- /dev/null
+++ b/src/test/test-shutdown1/log.expect
@@ -0,0 +1,40 @@
+info      0     hardware: starting simulation
+info     20      cmdlist: execute power node1 on
+info     20    node1/crm: status change startup => wait_for_quorum
+info     20    node1/lrm: status change startup => wait_for_agent_lock
+info     20      cmdlist: execute power node2 on
+info     20    node2/crm: status change startup => wait_for_quorum
+info     20    node2/lrm: status change startup => wait_for_agent_lock
+info     20      cmdlist: execute power node3 on
+info     20    node3/crm: status change startup => wait_for_quorum
+info     20    node3/lrm: status change startup => wait_for_agent_lock
+info     20    node1/crm: got lock 'ha_manager_lock'
+info     20    node1/crm: status change wait_for_quorum => master
+info     20    node1/crm: node 'node1': state changed from 'unknown' => 'online'
+info     20    node1/crm: node 'node2': state changed from 'unknown' => 'online'
+info     20    node1/crm: node 'node3': state changed from 'unknown' => 'online'
+info     20    node1/crm: adding new service 'vm:103' on node 'node3'
+info     22    node2/crm: status change wait_for_quorum => slave
+info     24    node3/crm: status change wait_for_quorum => slave
+info     25    node3/lrm: got lock 'ha_agent_node3_lock'
+info     25    node3/lrm: status change wait_for_agent_lock => active
+info     25    node3/lrm: starting service vm:103
+info     25    node3/lrm: service status vm:103 started
+info    120      cmdlist: execute shutdown node3
+info    120    node3/lrm: shutdown LRM, stop all services
+info    126    node3/lrm: exit (loop end)
+info    126     shutdown: execute power node3 off
+info    125    node3/crm: killed by poweroff
+info    140    node1/crm: node 'node3': state changed from 'online' => 'unknown'
+info    180    node1/crm: service 'vm:103': state changed from 'started' to 'fence' 
+info    180    node1/crm: node 'node3': state changed from 'unknown' => 'fence'
+info    260    node1/crm: got lock 'ha_agent_node3_lock'
+info    260    node1/crm: fencing: acknowleged - got agent lock for node 'node3'
+info    260    node1/crm: node 'node3': state changed from 'fence' => 'unknown'
+info    260    node1/crm: service 'vm:103': state changed from 'fence' to 'stopped' 
+info    280    node1/crm: service 'vm:103': state changed from 'stopped' to 'started'  (node = node1)
+info    281    node1/lrm: got lock 'ha_agent_node1_lock'
+info    281    node1/lrm: status change wait_for_agent_lock => active
+info    281    node1/lrm: starting service vm:103
+info    281    node1/lrm: service status vm:103 started
+info    720     hardware: exit simulation - done
diff --git a/src/test/test-shutdown1/manager_status b/src/test/test-shutdown1/manager_status
new file mode 100644
index 0000000..9e26dfe
--- /dev/null
+++ b/src/test/test-shutdown1/manager_status
@@ -0,0 +1 @@
+{}
\ No newline at end of file
diff --git a/src/test/test-shutdown1/service_config b/src/test/test-shutdown1/service_config
new file mode 100644
index 0000000..c3b22c8
--- /dev/null
+++ b/src/test/test-shutdown1/service_config
@@ -0,0 +1,3 @@
+{
+    "vm:103": { "node": "node3", "state": "enabled" }
+}
\ No newline at end of file
-- 
2.1.4




More information about the pve-devel mailing list