Пример #1
0
def execute(options, conf_dict):

    yb = yum.YumBase()

    if options.command == 'git':
        if yb.rpmdb.searchNevra(name='git'):
            logger.log.info("Git rpm found.")

            git = Git(options, conf_dict)
            git.get_archive()
        else:
            logger.log.error("Git rpm not installed.")
            sys.exit(2)

    elif options.command == 'beaker':
        if yb.rpmdb.searchNevra(name='beaker-client'):
            logger.log.info("beaker-client rpm found")

            beaker = Beaker(options, conf_dict)
            beaker.run(options, conf_dict)
        else:
            logger.log.error("beaker-client rpm not found")
            sys.exit(2)

    elif options.command == 'brew':
        if yb.rpmdb.searchNevra(name='koji'):
            logger.log.info("Koji rpm found.")

            brew = Brew(options, conf_dict)
            brew.get_latest(options, conf_dict)
        else:
            logger.log.error("Koji rpm not installed.")
            sys.exit(2)

    elif options.command == 'restraint':
        if yb.rpmdb.searchNevra(name='restraint-client'):
            logger.log.info("restraint-client rpm found.")
            restraint = Restraint(options, conf_dict)
            restraint.run_restraint(options, conf_dict)
            restraint.restraint_junit()
        else:
            logger.log.error("restraint-client rpm not installed.")
            sys.exit(2)

    elif options.command == 'errata':
        errata = Errata(options, conf_dict)
        errata.download_errata_builds()
    elif options.command == 'jenkins':
        jenkins = Jenkins(options, conf_dict)
        jenkins.main(options, conf_dict)
    elif options.command == 'ci':
        ci = CI(options, conf_dict)
        ci.run(options, conf_dict)
Пример #2
0
    def run(self, options, conf_dict):
        if self.provisioner == "beaker" and self.framework == "restraint":
            git = Git(options, conf_dict)
            git.get_archive()

            repo = Repos(options, conf_dict)
            repo.run_repo_setup(options, conf_dict)

            restraint = Restraint(options, conf_dict)
            """ This function actually runs restraint command and
            executed the job on beaker.
            """
            restraint.run_restraint(options, conf_dict)

        elif self.provisioner == "beaker" and self.framework == "pytest":
            #TODO write code to run tests using pytest
            print "pytest code"

        else:
            logger.log.error("Unknown provisioner or framework")