in TestNodeAddAll QA. This is a test for issue 1126.

Signed-off-by: BSRK Aditya <[email protected]>
---
 qa/qa_node.py | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/qa/qa_node.py b/qa/qa_node.py
index b752932..9fccafe 100644
--- a/qa/qa_node.py
+++ b/qa/qa_node.py
@@ -93,6 +93,41 @@ def TestNodeAddAll():
     if node != master:
       NodeAdd(node, readd=False)
 
+  cmd = utils.ShellQuoteArgs([
+         "gnt-node",
+         "list",
+         "--output=name",
+         "--no-headers",
+         "--filter",
+         "master_candidate"
+        ])
+  mc_nodes = AssertCommand(cmd)[1]
+
+  for node in qa_config.get("nodes"):
+    def getNonStartDaemons():
+      cmd = utils.ShellQuoteArgs(["ps", "-Ao", "comm"])
+      prcs = AssertCommand(cmd, node=node)[1]
+
+      nonStartDaemons = []
+      def addIfNotStarted(daemon):
+        if daemon not in prcs:
+          nonStartDaemons.append(daemon)
+
+      addIfNotStarted('ganeti-noded')
+      if node.primary in mc_nodes:
+        addIfNotStarted('ganeti-confd')
+      if constants.ENABLE_MOND:
+        addIfNotStarted('ganeti-mond')
+      if node == master:
+        addIfNotStarted('ganeti-wconfd')
+        addIfNotStarted('ganeti-rapi')
+        addIfNotStarted('ganeti-luxid')
+        addIfNotStarted('ganeti-maintd')
+      return nonStartDaemons
+
+    nsd = utils.SimpleRetry([], getNonStartDaemons, 3.0, 21.0)
+    for daemon in nsd:
+      raise qa_error.Error(daemon + ' is not running at %s' % node.primary)
 
 def MarkNodeAddedAll():
   """Mark all nodes as added.
-- 
2.6.0.rc2.230.g3dd15c0

Reply via email to