Exemplo n.º 1
0
def rv_basic_opts(vmi):
    """Command line parameters for RV.

    """
    cfg = vmi.cfg
    rv_cmd = utils.Cmd()
    rv_cmd.append(cfg.rv_binary)
    if cfg.rv_debug:
        rv_cmd.append("--spice-debug")
    if cfg.full_screen:
        rv_cmd.append("--full-screen")
    if cfg.disable_audio:
        rv_cmd.append("--spice-disable-audio")
    if cfg.smartcard:
        rv_cmd.append("--spice-smartcard")
        if cfg.certdb:
            rv_cmd.append("--spice-smartcard-db")
            rv_cmd.append(cfg.certdb)
        if cfg.gencerts:
            rv_cmd.append("--spice-smartcard-certificates")
            rv_cmd.append(cfg.gencerts)
    if cfg.usb_redirection_add_device:
        logger.info("Auto USB redirect for devices class == 0x08.")
        opt = r'--spice-usbredir-redirect-on-connect="0x08,-1,-1,-1,1"'
        rv_cmd.append(opt)
    if utils.is_yes(vmi.test.kvm_g.spice_ssl):
        cacert_host = utils.cacert_path_host(vmi.test)
        cacert_client = act.cp_file(vmi, cacert_host)
        opt = "--spice-ca-file=%s" % cacert_client
        rv_cmd.append(opt)
        if cfg.spice_client_host_subject:
            host_subj = utils.get_host_subj(vmi.test)
            opt = '--spice-host-subject=%s' % host_subj
            rv_cmd.append(opt)
    return rv_cmd
Exemplo n.º 2
0
def rv_basic_opts(vmi):
    """Command line parameters for RV.

    """
    cfg = vmi.cfg
    rv_cmd = utils.Cmd()
    rv_cmd.append(cfg.rv_binary)
    if cfg.rv_debug:
        rv_cmd.append("--spice-debug")
    if cfg.full_screen:
        rv_cmd.append("--full-screen")
    if cfg.disable_audio:
        rv_cmd.append("--spice-disable-audio")
    if cfg.smartcard:
        rv_cmd.append("--spice-smartcard")
        if cfg.certdb:
            rv_cmd.append("--spice-smartcard-db")
            rv_cmd.append(cfg.certdb)
        if cfg.gencerts:
            rv_cmd.append("--spice-smartcard-certificates")
            rv_cmd.append(cfg.gencerts)
    if cfg.usb_redirection_add_device:
        logger.info("Auto USB redirect for devices class == 0x08.")
        opt = r'--spice-usbredir-redirect-on-connect="0x08,-1,-1,-1,1"'
        rv_cmd.append(opt)
    if utils.is_yes(vmi.test.kvm_g.spice_ssl):
        cacert_host = utils.cacert_path_host(vmi.test)
        cacert_client = act.cp_file(vmi, cacert_host)
        opt = "--spice-ca-file=%s" % cacert_client
        rv_cmd.append(opt)
        if cfg.spice_client_host_subject:
            host_subj = utils.get_host_subj(vmi.test)
            opt = '--spice-host-subject=%s' % host_subj
            rv_cmd.append(opt)
    return rv_cmd
Exemplo n.º 3
0
def rv_connect_file(vmi, ssn, env):
    cmd = utils.Cmd(vmi.cfg.rv_binary)
    vv_file_host = act.gen_vv_file(vmi)
    with open(vv_file_host, 'r') as rvfile:
        file_contents = rvfile.read()
        act.info(vmi, "RV file contents:\n%s", file_contents)
    vv_file_client = act.cp_file(vmi, vv_file_host)
    cmd.append(vv_file_client)
    utils.set_ticket(vmi.test)
    cmd = utils.combine(cmd, "2>&1")
    act.info(vmi, "Final RV command: %s", cmd)
    act.rv_run(vmi, cmd, ssn)
Exemplo n.º 4
0
def rv_connect_file(vmi, ssn, env):
    cmd = utils.Cmd(vmi.cfg.rv_binary)
    vv_file_host = act.gen_vv_file(vmi)
    with open(vv_file_host, 'r') as rvfile:
        file_contents = rvfile.read()
        act.info(vmi, "RV file contents:\n%s", file_contents)
    vv_file_client = act.cp_file(vmi, vv_file_host)
    cmd.append(vv_file_client)
    utils.set_ticket(vmi.test)
    cmd = utils.combine(cmd, "2>&1")
    act.info(vmi, "Final RV command: %s", cmd)
    act.rv_run(vmi, cmd, ssn, env)