Пример #1
0
    def install_unittests(self):
        userspace_srcdir = os.path.join(self.srcdir, "kvm_userspace")
        test_repo = self.params.get("test_git_repo")
        test_branch = self.params.get("test_branch", "master")
        test_commit = self.params.get("test_commit", None)
        test_lbranch = self.params.get("test_lbranch", "master")

        if test_repo:
            test_srcdir = os.path.join(self.srcdir, "kvm-unit-tests")
            virt_utils.get_git_branch(test_repo, test_branch, test_srcdir,
                                     test_commit, test_lbranch)
            unittest_cfg = os.path.join(test_srcdir, 'x86',
                                        'unittests.cfg')
            self.test_srcdir = test_srcdir
        else:
            unittest_cfg = os.path.join(userspace_srcdir, 'kvm', 'test', 'x86',
                                        'unittests.cfg')
        self.unittest_cfg = None
        if os.path.isfile(unittest_cfg):
            self.unittest_cfg = unittest_cfg
        else:
            if test_repo:
                logging.error("No unittest config file %s found, skipping "
                              "unittest build", self.unittest_cfg)

        self.unittest_prefix = None
        if self.unittest_cfg:
            logging.info("Building and installing unittests")
            os.chdir(os.path.dirname(os.path.dirname(self.unittest_cfg)))
            utils.system('./configure --prefix=%s' % self.prefix)
            utils.system('make')
            utils.system('make install')
            self.unittest_prefix = os.path.join(self.prefix, 'share', 'qemu',
                                                'tests')
Пример #2
0
    def install_unittests(self):
        userspace_srcdir = os.path.join(self.srcdir, "kvm_userspace")
        test_repo = self.params.get("test_git_repo")
        test_branch = self.params.get("test_branch", "master")
        test_commit = self.params.get("test_commit", None)
        test_lbranch = self.params.get("test_lbranch", "master")

        if test_repo:
            test_srcdir = os.path.join(self.srcdir, "kvm-unit-tests")
            virt_utils.get_git_branch(test_repo, test_branch, test_srcdir,
                                      test_commit, test_lbranch)
            unittest_cfg = os.path.join(test_srcdir, 'x86', 'unittests.cfg')
            self.test_srcdir = test_srcdir
        else:
            unittest_cfg = os.path.join(userspace_srcdir, 'kvm', 'test', 'x86',
                                        'unittests.cfg')
        self.unittest_cfg = None
        if os.path.isfile(unittest_cfg):
            self.unittest_cfg = unittest_cfg
        else:
            if test_repo:
                logging.error(
                    "No unittest config file %s found, skipping "
                    "unittest build", self.unittest_cfg)

        self.unittest_prefix = None
        if self.unittest_cfg:
            logging.info("Building and installing unittests")
            os.chdir(os.path.dirname(os.path.dirname(self.unittest_cfg)))
            utils.system('./configure --prefix=%s' % self.prefix)
            utils.system('make')
            utils.system('make install')
            self.unittest_prefix = os.path.join(self.prefix, 'share', 'qemu',
                                                'tests')
Пример #3
0
 def fetch_and_patch(self):
     if not self.repo:
         return
     virt_utils.get_git_branch(self.repo, self.branch, self.srcdir,
                              self.commit, self.lbranch)
     os.chdir(self.srcdir)
     for patch in self.patches:
         utils.get_file(patch, os.path.join(self.srcdir,
                                            os.path.basename(patch)))
         utils.system('patch -p1 < %s' % os.path.basename(patch))
Пример #4
0
 def fetch_and_patch(self):
     if not self.repo:
         return
     virt_utils.get_git_branch(self.repo, self.branch, self.srcdir,
                               self.commit, self.lbranch)
     os.chdir(self.srcdir)
     for patch in self.patches:
         utils.get_file(patch,
                        os.path.join(self.srcdir, os.path.basename(patch)))
         utils.system('patch -p1 < %s' % os.path.basename(patch))