From: Alina Quereilhac Date: Mon, 12 Nov 2012 22:56:24 +0000 (+0100) Subject: In test linux_node.py ignoring unresponsive nodes. X-Git-Tag: nepi-3.0.0~122^2~36 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=7d96c38c3a997e70bd5751a100f7b235ae9389c5;p=nepi.git In test linux_node.py ignoring unresponsive nodes. --- diff --git a/src/neco/resources/base/linux_node.py b/src/neco/resources/base/linux_node.py index b763b953..3aa063c7 100644 --- a/src/neco/resources/base/linux_node.py +++ b/src/neco/resources/base/linux_node.py @@ -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): diff --git a/test/resources/base/linux_node.py b/test/resources/base/linux_node.py index 3b8e2a8f..55c0eb1a 100644 --- a/test/resources/base/linux_node.py +++ b/test/resources/base/linux_node.py @@ -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