[pve-devel] [PATCH ha-manager] add test for infinite started <=> migrate cycle

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Feb 24 11:25:34 CET 2016


---

*NOTE:* I did not add the log.excpect explicitly, test without and
        with the 'fix infinite started <=> migrate cycle' patch


 src/test/test-service-command7/README          |  6 ++++++
 src/test/test-service-command7/cmdlist         |  4 ++++
 src/test/test-service-command7/hardware_status |  5 +++++
 src/test/test-service-command7/manager_status  | 16 ++++++++++++++++
 src/test/test-service-command7/service_config  |  3 +++
 5 files changed, 34 insertions(+)
 create mode 100644 src/test/test-service-command7/README
 create mode 100644 src/test/test-service-command7/cmdlist
 create mode 100644 src/test/test-service-command7/hardware_status
 create mode 100644 src/test/test-service-command7/manager_status
 create mode 100644 src/test/test-service-command7/service_config

diff --git a/src/test/test-service-command7/README b/src/test/test-service-command7/README
new file mode 100644
index 0000000..f62bee2
--- /dev/null
+++ b/src/test/test-service-command7/README
@@ -0,0 +1,6 @@
+Test a migration from a service which (through a glitch) isn't
+anymore on the source node.
+
+This should *not* trigger and inf. migrate->started_>migrate
+cycle but rather place the service in the error state
+(unrecoverable state)
diff --git a/src/test/test-service-command7/cmdlist b/src/test/test-service-command7/cmdlist
new file mode 100644
index 0000000..8c5a8ea
--- /dev/null
+++ b/src/test/test-service-command7/cmdlist
@@ -0,0 +1,4 @@
+[
+    [ "power node1 on", "power node2 on", "power node3 on"],
+    [ "service vm:103 migrate node1" ]
+]
diff --git a/src/test/test-service-command7/hardware_status b/src/test/test-service-command7/hardware_status
new file mode 100644
index 0000000..451beb1
--- /dev/null
+++ b/src/test/test-service-command7/hardware_status
@@ -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-command7/manager_status b/src/test/test-service-command7/manager_status
new file mode 100644
index 0000000..0ec2a58
--- /dev/null
+++ b/src/test/test-service-command7/manager_status
@@ -0,0 +1,16 @@
+{
+    "master_node": "node1",
+    "node_status": {
+	"node1":"unknown",
+	"node3":"unknown",
+	"node2":"unknown"
+    },
+    "service_status": {
+	"vm:103": {
+	    "node": "node3",
+	    "state": "migrate",
+	    "target" : "node2",
+	    "uid": "lavE3c7vLnotUBGT9whswg"
+	}
+    }
+}
diff --git a/src/test/test-service-command7/service_config b/src/test/test-service-command7/service_config
new file mode 100644
index 0000000..8ea6460
--- /dev/null
+++ b/src/test/test-service-command7/service_config
@@ -0,0 +1,3 @@
+{
+    "vm:103": { "node": "node2", "state": "enabled" }
+}
-- 
2.1.4





More information about the pve-devel mailing list