예제 #1
0
    def get_testcaseID(self, file_name):
        try:
            file_config = "%s/orig.config.yaml" %file_name
            if not utilities.is_file_valid(file_config):
                print "File %s does not exist" %(file_config)
            else:
                config_dict = utilities.read_yaml(file_config)

            return config_dict.get('testcase_id')
        except Exception:
            print "Error reporting result"
            return None
예제 #2
0
    def check_summary(self, file_summary):
        status = False
        if not utilities.is_file_valid(file_summary):
            print "File %s does not exist" %(file_summary)
        else:
            summary_dict = utilities.read_yaml(file_summary)
            #set ceph version
            if not self.ceph_version:
                self.ceph_version = summary_dict.get('version')

            if summary_dict.get('success'):
                status = True
        return status
예제 #3
0
    def run(self):
        if self.runlist:
            self.use_runlist = self.runlist
        else:
            self.default_runlist()

        #check if  user provided runlist exsis or not
        if not utilities.is_file_valid(self.use_runlist):
            raise RunfileError("runlist %s does not exist" %
                               self.use_runlist)

        #check if targetfile exist or not
        if (not self.targetfile) or \
           (not utilities.is_file_valid(self.targetfile)):
            raise RunnerError("Target file %s is not passed or does not exist" % (self.targetfile))
        #create log folder if not existing
        if self.bat not in self.bat_list:
            raise RunnerError("Invalid bat type %s, provide bvt, ceph_qa")
        #check if set_number is provided, not mendatory for bvt
        if self.bat != 'bvt':
            if not self.set_number:
                raise RunnerError("Please pass set_number with -s option")
        self.log_dir_inuse = self.default_log_path_dict.get(self.bat)
        if not utilities.is_path(self.log_dir_inuse):
            utilities.create_dir(self.log_dir_inuse)

        #start executing the test present in the runlist
        obj = teuthology.Teuthology(targetfile=self.targetfile,
                                    bat_type=self.bat,
                                    set_number=self.set_number,
                                    report_result=self.report_result,
                                    runlist_path=self.use_runlist,
                                    log_path=self.log_dir_inuse,
                                    nuke=self.debug,  mail=self.mail,
                                    no_poweroff=self.no_poweroff)
        obj.run()