]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
add service relocate regression test
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 7 Jan 2016 10:34:49 +0000 (11:34 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 8 Jan 2016 08:51:23 +0000 (09:51 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/test/test-service-command4/README [new file with mode: 0644]
src/test/test-service-command4/cmdlist [new file with mode: 0644]
src/test/test-service-command4/hardware_status [new file with mode: 0644]
src/test/test-service-command4/log.expect [new file with mode: 0644]
src/test/test-service-command4/manager_status [new file with mode: 0644]
src/test/test-service-command4/service_config [new file with mode: 0644]

diff --git a/src/test/test-service-command4/README b/src/test/test-service-command4/README
new file mode 100644 (file)
index 0000000..306e524
--- /dev/null
@@ -0,0 +1 @@
+Test user triggered service relocation.
diff --git a/src/test/test-service-command4/cmdlist b/src/test/test-service-command4/cmdlist
new file mode 100644 (file)
index 0000000..f075e21
--- /dev/null
@@ -0,0 +1,4 @@
+[
+    [ "power node1 on", "power node2 on", "power node3 on"],
+    [ "service vm:103 relocate node1" ]
+]
diff --git a/src/test/test-service-command4/hardware_status b/src/test/test-service-command4/hardware_status
new file mode 100644 (file)
index 0000000..451beb1
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "node1": { "power": "off", "network": "off" },
+  "node2": { "power": "off", "network": "off" },
+  "node3": { "power": "off", "network": "off" }
+}
diff --git a/src/test/test-service-command4/log.expect b/src/test/test-service-command4/log.expect
new file mode 100644 (file)
index 0000000..01a6380
--- /dev/null
@@ -0,0 +1,36 @@
+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 service vm:103 relocate node1
+info    120    node1/crm: got crm command: relocate vm:103 node1
+info    120    node1/crm: relocate service 'vm:103' to node 'node1' (running)
+info    120    node1/crm: service 'vm:103': state changed from 'started' to 'relocate'  (node = node3, target = node1)
+info    125    node3/lrm: service vm:103 - start relocate to node 'node1'
+info    125    node3/lrm: stopping service vm:103 (relocate)
+info    125    node3/lrm: service status vm:103 stopped
+info    125    node3/lrm: service vm:103 - end relocate to node 'node1'
+info    140    node1/crm: service 'vm:103': state changed from 'relocate' to 'started'  (node = node1)
+info    141    node1/lrm: got lock 'ha_agent_node1_lock'
+info    141    node1/lrm: status change wait_for_agent_lock => active
+info    141    node1/lrm: starting service vm:103
+info    141    node1/lrm: service status vm:103 started
+info    720     hardware: exit simulation - done
diff --git a/src/test/test-service-command4/manager_status b/src/test/test-service-command4/manager_status
new file mode 100644 (file)
index 0000000..0967ef4
--- /dev/null
@@ -0,0 +1 @@
+{}
diff --git a/src/test/test-service-command4/service_config b/src/test/test-service-command4/service_config
new file mode 100644 (file)
index 0000000..c6860e7
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "vm:103": { "node": "node3", "state": "enabled" }
+}