From: Thierry Parmentelat Date: Sat, 6 Dec 2008 18:28:20 +0000 (+0000) Subject: take tags into account X-Git-Tag: tests-4.3-0~46 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=45f09d077594500300eda57b77dfe26daf151576;p=tests.git take tags into account --- diff --git a/system/plcsh-stress-test.py b/system/plcsh-stress-test.py index 26fb3b7..1d89d01 100755 --- a/system/plcsh-stress-test.py +++ b/system/plcsh-stress-test.py @@ -145,6 +145,7 @@ def random_tag_type (role_ids): def random_nodegroup(): return {'groupname' : randstr(50) } +tag_fields=['arch'] def random_node(node_types,boot_states): return { 'hostname': randhostname(), @@ -902,7 +903,8 @@ class Test: # Check node node = self.api.GetNodes([node_id])[0] for field in node_fields: - assert node[field] == node_fields[field] + if field not in tag_fields: + assert node[field] == node_fields[field] if self.verbose: print "Added node", node_id @@ -926,15 +928,16 @@ class Test: # for testing node arch check=node_fields.copy() - arch=check.pop('arch') + for tagname in tag_fields: + check.pop(tagname) node = self.api.GetNodes(node_id)[0] if node != check: raise Exception,'Unexpected result in GetNodes()' # again when fetching 'arch' explicitly - node = self.api.GetNodes(node_id,Node.fields.keys()+'arch')[0] + node = self.api.GetNodes(node_id,Node.fields.keys()+tag_fields)[0] if node != node_fields: - raise Exception,"Unexpected result in GetNodes(['__all__','arch'])" + raise Exception,"Unexpected result in GetNodes() with tags" # Add to a random set of node groups