In test linux_node.py ignoring unresponsive nodes.
authorAlina Quereilhac <alina.quereilhac@inria.fr>
Mon, 12 Nov 2012 22:56:24 +0000 (23:56 +0100)
committerAlina Quereilhac <alina.quereilhac@inria.fr>
Mon, 12 Nov 2012 22:56:24 +0000 (23:56 +0100)
src/neco/resources/base/linux_node.py
test/resources/base/linux_node.py

index b763b95..3aa063c 100644 (file)
@@ -91,12 +91,14 @@ class LinuxNode(Resource):
                 persistent = False)
         
         if proc.wait():
-            self._logger.warn("Unresponsive node %s got:\n%s%s", self.host, out, err)
+            if verbose:
+                self._logger.warn("Unresponsive node %s got:\n%s%s", self.host, out, err)
             return False
         elif out.strip().startswith('ALIVE'):
             return True
         else:
-            self._logger.warn("Unresponsive node %s got:\n%s%s", self.host, out, err)
+            if verbose:
+                self._logger.warn("Unresponsive node %s got:\n%s%s", self.host, out, err)
             return False
 
     def mkdir(self, path, clean = True):
index 3b8e2a8..55c0eb1 100644 (file)
@@ -7,6 +7,7 @@ import os.path
 import time
 import unittest
 
+
 class DummyEC(object):
     pass
 
@@ -34,6 +35,10 @@ class LinuxBoxTestCase(unittest.TestCase):
         return node
 
     def t_execute(self, node, target):
+        if not node.is_alive():
+            print "*** WARNING: Skipping test: Node %s is not alive\n" % (node.host)
+            return 
+
         command = "ping -qc3 %s" % target
         out = node.execute(command)
 
@@ -42,6 +47,10 @@ class LinuxBoxTestCase(unittest.TestCase):
         self.assertTrue(out.find(expected) > 0)
 
     def t_run(self, node, target):
+        if not node.is_alive():
+            print "*** WARNING: Skipping test: Node %s is not alive\n" % (node.host)
+            return
+
         node.mkdir(self.home, clean = True)
         
         command = "ping %s" % target
@@ -62,6 +71,10 @@ class LinuxBoxTestCase(unittest.TestCase):
         node.rmdir(self.home)
 
     def t_install(self, node, target):
+        if not node.is_alive():
+            print "*** WARNING: Skipping test: Node %s is not alive\n" % (node.host)
+            return
+
         node.mkdir(self.home, clean = True)
 
         prog = """#include <stdio.h>