Ejemplo n.º 1
0
    def get_test_job_details(self, job_id):
        """
        returns test job metadata, for example device type
        the tests were run on
        """
        details = dict(testertype="lava")
        status = self.call_xmlrpc('scheduler.job_status', job_id)
        if 'bundle_sha1' in status:
            details.update({"bundle": status['bundle_sha1']})
        content = self.call_xmlrpc('scheduler.job_details', job_id)
        definition = json.loads(content['definition'])
        if content['multinode_definition']:
            definition = json.loads(content['multinode_definition'])
        details.update({"definition": str(json.dumps(definition))})
        details['metadata'] = extract_metadata(definition)
        details['metadata']['device'] = extract_device(definition)
        details['name'] = extract_name(definition)

        for action in definition['actions']:
            if action['command'].startswith("submit_results"):
                if 'stream' in action['parameters'].keys():
                    details.update({"bundlestream": action['parameters']['stream']})
        return details
Ejemplo n.º 2
0
    def get_test_job_details(self, job_id):
        """
        returns test job metadata, for example device type
        the tests were run on
        """
        details = dict(testertype="lava")
        status = self.call_xmlrpc('scheduler.job_status', job_id)
        if 'bundle_sha1' in status:
            details.update({"bundle": status['bundle_sha1']})
        content = self.call_xmlrpc('scheduler.job_details', job_id)
        definition = json.loads(content['definition'])
        if content['multinode_definition']:
            definition = json.loads(content['multinode_definition'])
        details.update({"definition": str(json.dumps(definition))})
        details['metadata'] = extract_metadata(definition)
        details['metadata']['device'] = extract_device(definition)
        details['name'] = extract_name(definition)

        for action in definition['actions']:
            if action['command'].startswith("submit_results"):
                if 'stream' in action['parameters'].keys():
                    details.update(
                        {"bundlestream": action['parameters']['stream']})
        return details
Ejemplo n.º 3
0
 def test_extract_name_simple(self):
     name = extract_name({"job_name": "foobar"})
     self.assertEqual(name, 'foobar')
Ejemplo n.º 4
0
 def test_extract_name_simple(self):
     name = extract_name({"job_name": "foobar"})
     self.assertEqual(name, 'foobar')