Ejemplo n.º 1
0
def install_usbclerk_win(vmi):
    """Install usbclerk on a windows client.

    ..todo:: host_path - fix

    """
    vm.copy_files_to(vmi.cfg.host_path, self.cfg.client_path_usbc)
    cmd = ["start", "/wait", "msiexec", "/i", vmi.cfg.client_path_usbc, "/qn"]
    act.run_cmd(vmi, cmd)
Ejemplo n.º 2
0
def install_usbclerk_win(vmi):
    """Install usbclerk on a windows client.

    ..todo:: host_path - fix

    """
    vmi.vm.copy_files_to(vmi.cfg.host_path, vmi.cfg.client_path_usbc)
    cmd = ["start", "/wait", "msiexec", "/i", vmi.cfg.client_path_usbc, "/qn"]
    act.run_cmd(vmi, cmd)
Ejemplo n.º 3
0
def install_rv(vmi):
    """Install remote-viewer on a windows client.

    .. todo:: Add cfg.client_path_rv_dst = C:\virt-viewer

    """
    vm.copy_files_to(vmi.cfg.host_path, self.cfg.client_path_rv)
    cmd = ["start", "/wait", "msiexec", "/i", vmi.cfg.client_path_rv]
    cmd.append("INSTALLDIR=%s" % vmi.cfg.client_path_rv_dst)
    act.run_cmd(vmi, cmd)
Ejemplo n.º 4
0
def install_rv(vmi):
    """Install remote-viewer on a windows client.

    .. todo:: Add cfg.client_path_rv_dst = C:\virt-viewer

    """
    vmi.vm.copy_files_to(vmi.cfg.host_path, vmi.cfg.client_path_rv)
    cmd = ['start', '/wait', 'msiexec', '/i', vmi.cfg.client_path_rv]
    cmd.append('INSTALLDIR=%s' % vmi.cfg.client_path_rv_dst)
    act.run_cmd(vmi, cmd)
Ejemplo n.º 5
0
def kill_by_name(vmi, app_name):
    """Kill selected app on selected VM.

    Parameters
    ----------
    app_name : str
        Name of the binary.

    """
    cmd = ["taskkill", "/F", "/IM"]
    cmd.append(app_name.split("\\")[-1])
    act.run_cmd(vmi, cmd)
Ejemplo n.º 6
0
def reset_gui(vmi):
    """Kill remote-viewer.

    Raises
    ------
    SpiceUtilsError
        Fails to kill remote-viewer.

    """
    # .. todo:: check if remote-viewer is running before killing it.
    cmd = ["taskkill", "/F", "/IM", "remote-viewer.exe"]
    act.run_cmd(vmi, cmd)
Ejemplo n.º 7
0
def kill_by_name(vmi, app_name):
    """Kill selected app on selected VM.

    Parameters
    ----------
    app_name : str
        Name of the binary.

    """
    cmd = ["taskkill", "/F", "/IM"]
    cmd.append(app_name.split('\\')[-1])
    act.run_cmd(vmi, cmd)
Ejemplo n.º 8
0
def reset_gui(vmi):
    """Kill remote-viewer.

    Raises
    ------
    SpiceUtilsError
        Fails to kill remote-viewer.

    """
    # .. todo:: check if remote-viewer is running before killing it.
    cmd = ["taskkill", "/F", "/IM", "remote-viewer.exe"]
    act.run_cmd(vmi, cmd)
Ejemplo n.º 9
0
def service_vdagent(vmi, action):
    """Start/Stop/... on the spice-vdagentd service.

    Parameters
    ----------
    action : str
        Action on vdagent-service: stop, start, restart, status, ...

        http://ss64.com/nt/net_service.html

        Know actions are: start / stop / pause / continue.

        .. todo:: Implement me. Not finished: status, restart.

    """
    cmd = ["net", action, "RHEV Spice Agent"]
    act.run_cmd(vmi, cmd)
Ejemplo n.º 10
0
def service_vdagent(vmi, action):
    """Start/Stop/... on the spice-vdagentd service.

    Parameters
    ----------
    action : str
        Action on vdagent-service: stop, start, restart, status, ...

        http://ss64.com/nt/net_service.html

        Know actions are: start / stop / pause / continue.

        .. todo:: Implement me. Not finished: status, restart.

    """
    cmd = ['net', action, "RHEV Spice Agent"]
    act.run_cmd(vmi, cmd)
Ejemplo n.º 11
0
def verify_virtio(vmi):
    """Verify Virtio-Serial linux driver is properly loaded.

    """
    cmd = [vmi.cfg.pnputil, "/e"]
    output = act.run_cmd(vmi, cmd)
    installed = "System devices" in output
    act.info(vmi, "Virtio Serial driver is installed:", installed)
    return installed
Ejemplo n.º 12
0
def proc_is_active(vmi, pname):
    cmd = ["tasklist", "/FI"]
    cmd.append("IMAGENAME eq %s.exe" % pname)
    output = act.run_cmd(vmi, cmd)
    if pname in output:
        res = True
    else:
        res = False
    return res
Ejemplo n.º 13
0
def verify_virtio(vmi):
    """Verify Virtio-Serial linux driver is properly loaded.

    """
    cmd = [vmi.cfg.pnputil, '/e']
    output = act.run_cmd(vmi, cmd)
    installed = "System devices" in output
    act.info(vmi, "Virtio Serial driver is installed:", installed)
    return installed
Ejemplo n.º 14
0
def proc_is_active(vmi, pname):
    cmd = ['tasklist', '/FI']
    cmd.append("IMAGENAME eq %s.exe" % pname)
    output = act.run_cmd(vmi, cmd)
    return pname in output