def build_install_spicegtk(vm_root_session, vm_script_path, params):
    """
    Build and install spice-gtk in the VM

    :param vm_root_session:  VM Session object.
    :param vm_script_path: path where to find build_install.py script
    :param params: Dictionary with test parameters.
    """

    # Get version of spice-gtk before install
    try:
        output = vm_root_session.cmd("LD_LIBRARY_PATH=/usr/local/lib" " remote-viewer --spice-gtk-version")
        logging.info(output)
    except ShellCmdError:
        logging.error(output)

    if "release 7" in vm_root_session.cmd("cat /etc/redhat-release"):
        pkgsRequired = ["libogg-devel", "celt051-devel", "libcacard-devel", "source-highlight", "gtk-doc"]
    else:
        pkgsRequired = ["libogg-devel", "celt051-devel", "libcacard-devel"]

    install_req_pkgs(pkgsRequired, vm_root_session, params)

    utils_spice.deploy_epel_repo(vm_root_session, params)

    try:
        cmd = 'yum --disablerepo="*" ' + '--enablerepo="epel" -y install perl-Text-CSV'
        # In RHEL6, pyparsing is in EPEL but in RHEL7, it's part of
        # the main product repo
        if "release 6" in vm_root_session.cmd("cat /etc/redhat-release"):
            cmd += " pyparsing"
        output = vm_root_session.cmd(cmd, timeout=300)
        logging.info(output)
    except ShellCmdError:
        logging.error(output)

    # spice-gtk needs to built from tarball before building virt-viewer on RHEL6
    pkgName = params.get("build_install_pkg")
    if pkgName != "spice-gtk":
        tarballLocation = "http://www.spice-space.org/download/gtk/spice-gtk-0.29.tar.bz2"
        cmd = "%s -p spice-gtk --tarball %s" % (vm_script_path, tarballLocation)
        output = vm_root_session.cmd(cmd, timeout=600)
        logging.info(output)
        if re.search("Return code", output):
            raise error.TestFail("spice-gtk was not installed properly")
        else:
            logging.info("spice-gtk was installed")

    else:
        output = vm_root_session.cmd("%s -p spice-gtk" % (vm_script_path), timeout=600)
        logging.info(output)
        if re.search("Return code", output):
            raise error.TestFail("spice-gtk was not installed properly")

    # Get version of spice-gtk after install
    try:
        output = vm_root_session.cmd("LD_LIBRARY_PATH=/usr/local/lib" " remote-viewer --spice-gtk-version")
        logging.info(output)
    except ShellCmdError:
        logging.error(output)
def build_install_spiceprotocol(vm_root_session, vm_script_path, params):
    """
    Build and install spice-protocol in the VM

    :param vm_root_session:  VM Session object.
    :param vm_script_path: path where to find build_install.py script
    :param params: Dictionary with test parameters.
    """

    utils_spice.deploy_epel_repo(vm_root_session, params)

    # In RHEL6, pyparsing is in EPEL but in RHEL7, it's part of
    # the main product repo
    if "release 6" in vm_root_session.cmd("cat /etc/redhat-release"):
        try:
            cmd = "yum --disablerepo=\"*\" " + \
                  "--enablerepo=\"epel\" -y install pyparsing"
            output = vm_root_session.cmd(cmd, timeout=300)
            logging.info(output)
        except ShellCmdError:
            logging.error("Not able to install pyparsing!")

    output = vm_root_session.cmd("%s -p spice-protocol" % (vm_script_path))
    logging.info(output)
    if re.search("Return code", output):
        raise error.TestFail("spice-protocol was not installed properly")
Example #3
0
def build_install_spiceprotocol(test, vm_root_session, vm_script_path, params):
    """
    Build and install spice-protocol in the VM

    :param vm_root_session:  VM Session object.
    :param vm_script_path: path where to find build_install.py script
    :param params: Dictionary with test parameters.
    """

    utils_spice.deploy_epel_repo(vm_root_session, params)

    # In RHEL6, pyparsing is in EPEL but in RHEL7, it's part of
    # the main product repo
    if "release 6" in vm_root_session.cmd("cat /etc/redhat-release"):
        try:
            cmd = "yum --disablerepo=\"*\" " + \
                  "--enablerepo=\"epel\" -y install pyparsing"
            output = vm_root_session.cmd(cmd, timeout=300)
            logging.info(output)
        except:
            logging.error("Not able to install pyparsing!")

    output = vm_root_session.cmd("%s -p spice-protocol" % (vm_script_path))
    logging.info(output)
    if re.search("Return code", output):
        test.fail("spice-protocol was not installed properly")
Example #4
0
def build_install_spicegtk(vm_root_session, vm_script_path, params):
    """
    Build and install spice-gtk in the VM

    :param vm_root_session:  VM Session object.
    :param vm_script_path: path where to find build_install.py script
    :param params: Dictionary with test parameters.
    """

    # Get version of spice-gtk before install
    try:
        output = vm_root_session.cmd("LD_LIBRARY_PATH=/usr/local/lib"
                                     " remote-viewer --spice-gtk-version")
        logging.info(output)
    except ShellCmdError:
        logging.error(output)

    if "release 7" in vm_root_session.cmd("cat /etc/redhat-release"):
        pkgsRequired = [
            "libogg-devel", "celt051-devel", "libcacard-devel",
            "source-highlight", "gtk-doc"
        ]
    else:
        pkgsRequired = ["libogg-devel", "celt051-devel", "libcacard-devel"]

    install_req_pkgs(pkgsRequired, vm_root_session, params)

    utils_spice.deploy_epel_repo(vm_root_session, params)

    try:
        output = vm_root_session.cmd("yum -y install perl-Text-CSV pyparsing",
                                     timeout=300)
        logging.info(output)
    except ShellCmdError:
        logging.error(output)

    # latest spice-protocol is required to build spice-gtk
    output = vm_root_session.cmd("%s -p spice-protocol" % (vm_script_path))
    logging.info(output)
    if re.search("Return code", output):
        raise error.TestFail("spice-protocol was not installed properly")

    output = vm_root_session.cmd("%s -p spice-gtk" % (vm_script_path),
                                 timeout=600)
    logging.info(output)
    if re.search("Return code", output):
        raise error.TestFail("spice-gtk was not installed properly")

    # Get version of spice-gtk after install
    try:
        output = vm_root_session.cmd("LD_LIBRARY_PATH=/usr/local/lib"
                                     " remote-viewer --spice-gtk-version")
        logging.info(output)
    except ShellCmdError:
        logging.error(output)
Example #5
0
def build_install_spicegtk(vm_root_session, vm_script_path, params):
    """
    Build and install spice-gtk in the VM

    :param vm_root_session:  VM Session object.
    :param vm_script_path: path where to find build_install.py script
    :param params: Dictionary with test parameters.
    """

    # Get version of spice-gtk before install
    try:
        output = vm_root_session.cmd("LD_LIBRARY_PATH=/usr/local/lib"
                                     " remote-viewer --spice-gtk-version")
        logging.info(output)
    except ShellCmdError:
        logging.error(output)

    if "release 7" in vm_root_session.cmd("cat /etc/redhat-release"):
        pkgsRequired = ["libogg-devel", "celt051-devel", "libcacard-devel",
                        "source-highlight", "gtk-doc"]
    else:
        pkgsRequired = ["libogg-devel", "celt051-devel", "libcacard-devel"]

    install_req_pkgs(pkgsRequired, vm_root_session, params)

    utils_spice.deploy_epel_repo(vm_root_session, params)

    try:
        output = vm_root_session.cmd("yum -y install perl-Text-CSV pyparsing",
                                     timeout=300)
        logging.info(output)
    except ShellCmdError:
        logging.error(output)

    # latest spice-protocol is required to build spice-gtk
    output = vm_root_session.cmd("%s -p spice-protocol" % (vm_script_path))
    logging.info(output)
    if re.search("Return code", output):
        raise error.TestFail("spice-protocol was not installed properly")

    output = vm_root_session.cmd("%s -p spice-gtk" % (vm_script_path),
                                 timeout=600)
    logging.info(output)
    if re.search("Return code", output):
        raise error.TestFail("spice-gtk was not installed properly")

    # Get version of spice-gtk after install
    try:
        output = vm_root_session.cmd("LD_LIBRARY_PATH=/usr/local/lib"
                                     " remote-viewer --spice-gtk-version")
        logging.info(output)
    except ShellCmdError:
        logging.error(output)
Example #6
0
def build_install_spicegtk(vm_root_session, vm_script_path, params):
    """
    Build and install spice-gtk in the VM

    :param vm_root_session:  VM Session object.
    :param vm_script_path: path where to find build_install.py script
    :param params: Dictionary with test parameters.
    """

    # Get version of spice-gtk before install
    try:
        output = vm_root_session.cmd("LD_LIBRARY_PATH=/usr/local/lib"
                                     " remote-viewer --spice-gtk-version")
        logging.info(output)
    except ShellCmdError:
        logging.error(output)

    if "release 7" in vm_root_session.cmd("cat /etc/redhat-release"):
        pkgsRequired = ["libogg-devel", "celt051-devel", "libcacard-devel",
                        "source-highlight", "gtk-doc"]
    else:
        pkgsRequired = ["libogg-devel", "celt051-devel", "libcacard-devel"]

    install_req_pkgs(pkgsRequired, vm_root_session, params)

    utils_spice.deploy_epel_repo(vm_root_session, params)

    try:
        cmd = "yum --disablerepo=\"*\" " + \
              "--enablerepo=\"epel\" -y install perl-Text-CSV"
        # In RHEL6, pyparsing is in EPEL but in RHEL7, it's part of
        # the main product repo
        if "release 6" in vm_root_session.cmd("cat /etc/redhat-release"):
            cmd += " pyparsing"
        output = vm_root_session.cmd(cmd, timeout=300)
        logging.info(output)
    except ShellCmdError:
        logging.error(output)

    # spice-gtk needs to built from tarball before building virt-viewer on RHEL6
    pkgName = params.get("build_install_pkg")
    if pkgName != "spice-gtk":
        tarballLocation = "http://www.spice-space.org/download/gtk/spice-gtk-0.29.tar.bz2"
        cmd = "%s -p spice-gtk --tarball %s" % (vm_script_path, tarballLocation)
        output = vm_root_session.cmd(cmd, timeout=600)
        logging.info(output)
        if re.search("Return code", output):
            raise error.TestFail("spice-gtk was not installed properly")
        else:
            logging.info("spice-gtk was installed")

    else:
        output = vm_root_session.cmd("%s -p spice-gtk" % (vm_script_path),
                                     timeout=600)
        logging.info(output)
        if re.search("Return code", output):
            raise error.TestFail("spice-gtk was not installed properly")

    # Get version of spice-gtk after install
    try:
        output = vm_root_session.cmd("LD_LIBRARY_PATH=/usr/local/lib"
                                     " remote-viewer --spice-gtk-version")
        logging.info(output)
    except ShellCmdError:
        logging.error(output)