From: Thierry Parmentelat Date: Thu, 29 Mar 2012 11:17:11 +0000 (+0200) Subject: add check_netflow so we probe for at least one alive system slice X-Git-Tag: tests-5.1-1~22 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=75c32430bacfb7ea5cee9213f6ced1468e0ef7f2;hp=1133022b1489e02c9fa3c08fb3f0c6d9cf87be7c;p=tests.git add check_netflow so we probe for at least one alive system slice --- diff --git a/system/TestNode.py b/system/TestNode.py index 11e9391..c4d44f8 100644 --- a/system/TestNode.py +++ b/system/TestNode.py @@ -271,3 +271,17 @@ class TestNode: utils.header ("SUCCESS: node hook %s OK"%script_name) return True + def check_systemslice (self, slicename): + sitename=self.test_plc.plc_spec['PLC_SLICE_PREFIX'] + vservername="%s_%s"%(sitename,slicename) + test_ssh=self.create_test_ssh() + (retcod,output)=utils.output_of(test_ssh.actual_command("cat /vservers/%s/etc/slicefamily")%vservername) + if retcod != 0: + utils.header ("Can't find /etc/slicefamily for %s"%slicename) + return False + # get last line only as ssh pollutes the output + slicefamily=output.split("\n")[-1] + utils.header("system slice %s has slicefamily %s"%(slicename, slicefamily)) + return test_ssh.run("vserver-stat | grep %s"%vservername)==0 + + diff --git a/system/TestPlc.py b/system/TestPlc.py index 366d1bd..2d67f47 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -38,14 +38,14 @@ def standby_generic (func): return actual def node_mapper (method): - def actual(self): + def actual(self,*args, **kwds): overall=True node_method = TestNode.__dict__[method.__name__] for site_spec in self.plc_spec['sites']: test_site = TestSite (self,site_spec) for node_spec in site_spec['nodes']: test_node = TestNode (self,test_site,node_spec) - if not node_method(test_node): overall=False + if not node_method(test_node, *args, **kwds): overall=False return overall # restore the doc text actual.__doc__=method.__doc__ @@ -99,7 +99,7 @@ class TestPlc: # we used to run plcsh_stress_test, and then ssh_node_debug and ssh_node_boot # but as the stress test might take a while, we sometimes missed the debug mode.. 'ssh_node_debug@1', 'plcsh_stress_test@1', SEP, - 'ssh_node_boot@1', 'ssh_slice', 'check_initscripts', SEP, + 'ssh_node_boot@1', 'ssh_slice', 'check_netflow', 'check_initscripts', SEP, 'ssh_slice_sfa@1', 'sfa_delete_slice@1', 'sfa_delete_user@1', SEPSFA, 'check_tcp', SEP, 'force_gather_logs', SEP, @@ -1078,6 +1078,14 @@ class TestPlc: "tries to ssh-enter the slice with the user key, to ensure slice creation" pass + def check_netflow (self): + "all nodes: check that the netflow slice is alive" + return self.check_systemslice ('netflow') + + @node_mapper + def check_systemslice (self, slicename): + pass + @node_mapper def keys_clear_known_hosts (self): "remove test nodes entries from the local known_hosts file"