Пример #1
0
    def _pull_code(self):
        """
        Retrieves code from git repositories.
        """
        params = self.params
        make_jobs = utils.count_cpus()
        cfg = 'PKG_CONFIG_PATH="%s/lib/pkgconfig:%s/share/pkgconfig" ./configure' % (
            self.prefix, self.prefix)

        self.spice_protocol = GitRepo(
            installer=self,
            prefix='spice_protocol',
            srcdir='spice-protocol',
            build_steps=[
                './autogen.sh',
                './configure --prefix=%s' % self.prefix, 'make clean',
                'make -j %s' % (make_jobs), 'make install'
            ])

        self.spice = GitRepo(
            installer=self,
            prefix='spice',
            srcdir='spice',
            build_steps=[
                'PKG_CONFIG_PATH="%s/lib/pkgconfig:%s/share/pkgconfig" CXXFLAGS=-Wl,--add-needed ./autogen.sh --prefix=%s'
                % (self.prefix, self.prefix, self.prefix), 'make clean',
                'make -j %s' % (make_jobs), 'make install'
            ])

        self.userspace = GitRepo(installer=self,
                                 prefix='user',
                                 repo_param='user_git_repo',
                                 srcdir='kvm_userspace')

        p = os.path.join(self.userspace.srcdir, 'configure')
        self.configure_options = virt_installer.check_configure_options(p)

        cfg = cfg + ' --prefix=%s' % self.prefix
        if "--disable-strip" in self.configure_options:
            cfg += ' --disable-strip'
        if self.extra_configure_options:
            cfg += ' %s' % self.extra_configure_options

        self.userspace.build_steps = [
            cfg, 'make clean', 'make -j %s' % make_jobs
        ]

        if not self.userspace.repo:
            message = "KVM user git repository path not specified"
            logging.error(message)
            raise error.TestError(message)

        for repo in [self.userspace, self.spice_protocol, self.spice]:
            if not repo.repo:
                continue
            repo.fetch_and_patch()
Пример #2
0
    def _pull_code(self):
        """
        Retrieves code from git repositories.
        """
        params = self.params
        make_jobs = utils.count_cpus()
        cfg = 'PKG_CONFIG_PATH="%s/lib/pkgconfig:%s/share/pkgconfig" ./configure' % (
            self.prefix, self.prefix)

        self.spice_protocol = GitRepo(installer=self, prefix='spice_protocol',
            srcdir='spice-protocol',
            build_steps= ['./autogen.sh',
                          './configure --prefix=%s' % self.prefix,
                          'make clean',
                          'make -j %s' % (make_jobs),
                          'make install'])

        self.spice = GitRepo(installer=self, prefix='spice', srcdir='spice',
            build_steps= ['PKG_CONFIG_PATH="%s/lib/pkgconfig:%s/share/pkgconfig" CXXFLAGS=-Wl,--add-needed ./autogen.sh --prefix=%s' % (self.prefix, self.prefix, self.prefix),
                          'make clean',
                          'make -j %s' % (make_jobs),
                          'make install'])

        self.userspace = GitRepo(installer=self, prefix='user',
            repo_param='user_git_repo', srcdir='kvm_userspace')

        p = os.path.join(self.userspace.srcdir, 'configure')
        self.configure_options = virt_installer.check_configure_options(p)

        cfg = cfg + ' --prefix=%s' % self.prefix
        if "--disable-strip" in self.configure_options:
            cfg += ' --disable-strip'
        if self.extra_configure_options:
            cfg += ' %s' % self.extra_configure_options

        self.userspace.build_steps=[cfg, 'make clean', 'make -j %s' % make_jobs]

        if not self.userspace.repo:
            message = "KVM user git repository path not specified"
            logging.error(message)
            raise error.TestError(message)

        for repo in [self.userspace, self.spice_protocol, self.spice]:
            if not repo.repo:
                continue
            repo.fetch_and_patch()
Пример #3
0
    def set_install_params(self, test, params):
        """
        Initializes class attributes, and retrieves KVM code.

        @param test: kvm test object
        @param params: Dictionary with test arguments
        """
        super(SourceDirInstaller, self).set_install_params(test, params)

        self.mod_install_dir = os.path.join(self.prefix, 'modules')

        srcdir = params.get("srcdir", None)
        self.path_to_roms = params.get("path_to_rom_images", None)

        if self.install_mode == 'localsrc':
            if srcdir is None:
                raise error.TestError("Install from source directory specified"
                                      "but no source directory provided on the"
                                      "control file.")
            else:
                shutil.copytree(srcdir, self.srcdir)

        elif self.install_mode == 'localtar':
            tarball = params.get("tarball")
            if not tarball:
                raise error.TestError("KVM Tarball install specified but no"
                                      " tarball provided on control file.")
            logging.info("Installing KVM from a local tarball")
            logging.info("Using tarball %s")
            tarball = utils.unmap_url("/", params.get("tarball"), "/tmp")
            utils.extract_tarball_to_dir(tarball, self.srcdir)

        if self.install_mode in ['localtar', 'srcdir']:
            self.repo_type = virt_utils.check_kvm_source_dir(self.srcdir)
            p = os.path.join(self.srcdir, 'configure')
            self.configure_options = virt_installer.check_configure_options(p)
Пример #4
0
    def set_install_params(self, test, params):
        """
        Initializes class attributes, and retrieves KVM code.

        @param test: kvm test object
        @param params: Dictionary with test arguments
        """
        super(SourceDirInstaller, self).set_install_params(test, params)

        self.mod_install_dir = os.path.join(self.prefix, 'modules')

        srcdir = params.get("srcdir", None)
        self.path_to_roms = params.get("path_to_rom_images", None)

        if self.install_mode == 'localsrc':
            if srcdir is None:
                raise error.TestError("Install from source directory specified"
                                      "but no source directory provided on the"
                                      "control file.")
            else:
                shutil.copytree(srcdir, self.srcdir)

        elif self.install_mode == 'localtar':
            tarball = params.get("tarball")
            if not tarball:
                raise error.TestError("KVM Tarball install specified but no"
                                      " tarball provided on control file.")
            logging.info("Installing KVM from a local tarball")
            logging.info("Using tarball %s")
            tarball = utils.unmap_url("/", params.get("tarball"), "/tmp")
            utils.extract_tarball_to_dir(tarball, self.srcdir)

        if self.install_mode in ['localtar', 'srcdir']:
            self.repo_type = virt_utils.check_kvm_source_dir(self.srcdir)
            p = os.path.join(self.srcdir, 'configure')
            self.configure_options = virt_installer.check_configure_options(p)