Exemplo n.º 1
0
 def add_test_run(self, run, meta):
     params = AttrDict()
     params.suite_id = self.suite_id
     params.name = run[3]
     params.description = run[2]
     params.include_all = False
     params.case_ids = []
     return self.api.add_run(self.project_id, params)
Exemplo n.º 2
0
 def add_test_run(self, run, url):
     # LOG.info('Adding test run %s...', url)
     params = AttrDict()
     params.suite_id = self.suite_id
     #params.name = str(self.output.start)  # to be replaced
     params.name = run.get('name')
     params.description = url
     params.include_all = False
     params.case_ids = []
     return self.api.add_run(self.project_id, params)
Exemplo n.º 3
0
    def get_or_create_section(self, test):
        """Gets or creates a section. Returns the section_id."""
        address = test.id

        context, _ = address.split(':')
        last_section = 0
        for s in context.split('.'):
            if s not in self.sections:
                params = AttrDict()
                params.name = s
                params.description = 'autogenerated'
                params.suite_id = self.suite_id
                if last_section:
                    params.parent_id = last_section
                section = self.api.add_section(self.project_id, params)
                last_section = section_id = section.id
                self.sections[section.name] = section_id
            else:
                last_section = section_id = self.sections[s]

        return section_id
Exemplo n.º 4
0
    def setup(self):
        # POST/apply the policy
        payload = AttrDict()
        policy_reference = AttrDict()
        policy_reference.link = self.policy.selfLink
        payload.policyReference = policy_reference
        resp = self.rstifc.post(URL_TM_ASM_APPLY_POLICY, payload)
        AsmTask().wait_status(self.rstifc, resp, interval=2, timeout=90,
                              timeout_message="Apply policy timed out after {0}, "\
                                              "last status is {1.status}")
        ret = resp

        # TODO: put in test
        #        LOG.info("Putting response of apply_policy into self.garbage_bigip")
        #        self.garbage_bigip[device].append(resp)

        # PATCH/patch the policy to make sure log daemon catch the right mapping
        # workround to BZ488306
        payload = AttrDict()
        payload.description = "This is a description"
        resp = self.rstifc.patch(self.policy.selfLink, payload)

        return ret
Exemplo n.º 5
0
    def setup(self):
        # POST/apply the policy
        payload = AttrDict()
        policy_reference = AttrDict()
        policy_reference.link = self.policy.selfLink
        payload.policyReference = policy_reference
        resp = self.rstifc.post(URL_TM_ASM_APPLY_POLICY, payload)
        AsmTask().wait_status(self.rstifc, resp, interval=2, timeout=90,
                              timeout_message="Apply policy timed out after {0}, "\
                                              "last status is {1.status}")
        ret = resp

# TODO: put in test
#        LOG.info("Putting response of apply_policy into self.garbage_bigip")
#        self.garbage_bigip[device].append(resp)

        # PATCH/patch the policy to make sure log daemon catch the right mapping
        # workround to BZ488306
        payload = AttrDict()
        payload.description = "This is a description"
        resp = self.rstifc.patch(self.policy.selfLink, payload)

        return ret