[pve-devel] [PATCH ha-manager 3/4] add relocate policy test on service without node

Thomas Lamprecht t.lamprecht at proxmox.com
Tue May 3 10:03:16 CEST 2016


Test mainly the behaviour of the select_service_node method when
the service is in no group and the try_next parameter is true,
this happens when the relocate policy is executed.

has no log.expected yet

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/test/test-resource-failure6/README          | 5 +++++
 src/test/test-resource-failure6/cmdlist         | 4 ++++
 src/test/test-resource-failure6/hardware_status | 5 +++++
 src/test/test-resource-failure6/manager_status  | 1 +
 src/test/test-resource-failure6/service_config  | 3 +++
 5 files changed, 18 insertions(+)
 create mode 100644 src/test/test-resource-failure6/README
 create mode 100644 src/test/test-resource-failure6/cmdlist
 create mode 100644 src/test/test-resource-failure6/hardware_status
 create mode 100644 src/test/test-resource-failure6/manager_status
 create mode 100644 src/test/test-resource-failure6/service_config

diff --git a/src/test/test-resource-failure6/README b/src/test/test-resource-failure6/README
new file mode 100644
index 0000000..787af01
--- /dev/null
+++ b/src/test/test-resource-failure6/README
@@ -0,0 +1,5 @@
+Test relocate policy on services with no group.
+Service 'fa:130' fails three times to restart and has a 'max_restart' policy
+of 0, thus will be relocated after each start try.
+As it has no group configured all available nodes should get chosen for
+when relocating.
diff --git a/src/test/test-resource-failure6/cmdlist b/src/test/test-resource-failure6/cmdlist
new file mode 100644
index 0000000..8f06508
--- /dev/null
+++ b/src/test/test-resource-failure6/cmdlist
@@ -0,0 +1,4 @@
+[
+    [ "power node1 on", "power node2 on", "power node3 on"],
+    [ "service fa:130 enabled" ]
+]
diff --git a/src/test/test-resource-failure6/hardware_status b/src/test/test-resource-failure6/hardware_status
new file mode 100644
index 0000000..451beb1
--- /dev/null
+++ b/src/test/test-resource-failure6/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-resource-failure6/manager_status b/src/test/test-resource-failure6/manager_status
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/src/test/test-resource-failure6/manager_status
@@ -0,0 +1 @@
+{}
diff --git a/src/test/test-resource-failure6/service_config b/src/test/test-resource-failure6/service_config
new file mode 100644
index 0000000..d87aa1a
--- /dev/null
+++ b/src/test/test-resource-failure6/service_config
@@ -0,0 +1,3 @@
+{
+    "fa:130": { "node": "node2", "max_restart": "0", "max_relocate": "3"  }
+}
-- 
2.1.4





More information about the pve-devel mailing list