コード例 #1
0
ファイル: vlan.py プロジェクト: yiqianwei/tp-qemu
    def get_netkvmco_path(session):
        """
        Get the proper netkvmco.dll path from iso.

        :param session: a session to send cmd
        :return: the proper netkvmco.dll path
        """

        viowin_ltr = virtio_win.drive_letter_iso(session)
        if not viowin_ltr:
            err = "Could not find virtio-win drive in guest"
            test.error(err)
        guest_name = virtio_win.product_dirname_iso(session)
        if not guest_name:
            err = "Could not get product dirname of the vm"
            test.error(err)
        guest_arch = virtio_win.arch_dirname_iso(session)
        if not guest_arch:
            err = "Could not get architecture dirname of the vm"
            test.error(err)

        middle_path = "%s\\%s" % (guest_name, guest_arch)
        find_cmd = 'dir /b /s %s\\netkvmco.dll | findstr "\\%s\\\\"'
        find_cmd %= (viowin_ltr, middle_path)
        netkvmco_path = session.cmd(find_cmd).strip()
        logging.info("Found netkvmco.dll file at %s", netkvmco_path)
        return netkvmco_path
コード例 #2
0
    def prepare_traceview_windows(session, timeout):
        """
        First check the driver installation status, then copy traceview.exe
        and corresponding pdb file to drive c: for future use.

        :param session: a session to send command
        :timeout: the command execute timeout
        :return: the session after driver checking.
        """

        # verify driver
        error_context.context("Check if the driver is installed and "
                              "verified", logging.info)
        driver_name = params.get("driver_name", "netkvm")
        session = utils_test.qemu.windrv_check_running_verifier(session, vm,
                                                                test,
                                                                driver_name,
                                                                timeout)

        # copy traceview.exe
        error_context.context("Copy traceview.exe to drive C", logging.info)
        traceview_path_template = params.get("traceview_path_template")
        cd_drive = utils_misc.get_winutils_vol(session)
        traceview_path = traceview_path_template % cd_drive
        _copy_file(session, traceview_path, "c:\\")

        # copy Netkvm.pdb
        error_context.context("Find Netkvm.pdb and copy to drive C", logging.info)
        viowin_ltr = virtio_win.drive_letter_iso(session)
        if not viowin_ltr:
            test.error("Could not find virtio-win drive in guest")
        guest_name = virtio_win.product_dirname_iso(session)
        if not guest_name:
            test.error("Could not get product dirname of the vm")
        guest_arch = virtio_win.arch_dirname_iso(session)
        if not guest_arch:
            test.error("Could not get architecture dirname of the vm")

        pdb_middle_path = "%s\\%s" % (guest_name, guest_arch)
        pdb_find_cmd = 'dir /b /s %s\\%s.pdb | findstr "\\%s\\\\"'
        pdb_find_cmd %= (viowin_ltr, driver_name, pdb_middle_path)
        pdb_path = session.cmd(pdb_find_cmd, timeout=timeout).strip()
        logging.info("Found Netkvm.pdb file at '%s'", pdb_path)
        _copy_file(session, pdb_path, "c:\\")
        return session
コード例 #3
0
    def prepare_traceview_windows(session, timeout):
        """
        First check the driver installation status, then copy traceview.exe
        and corresponding pdb file to drive c: for future use.

        :param session: a session to send command
        :timeout: the command execute timeout
        :return: the session after driver checking.
        """

        # verify driver
        error_context.context(
            "Check if the driver is installed and "
            "verified", logging.info)
        driver_name = params.get("driver_name", "netkvm")
        session = utils_test.qemu.windrv_check_running_verifier(
            session, vm, test, driver_name, timeout)

        # copy traceview.exe
        error_context.context("Copy traceview.exe to drive C", logging.info)
        traceview_path_template = params.get("traceview_path_template")
        cd_drive = utils_misc.get_winutils_vol(session)
        traceview_path = traceview_path_template % cd_drive
        _copy_file(session, traceview_path, "c:\\")

        # copy Netkvm.pdb
        error_context.context("Find Netkvm.pdb and copy to drive C",
                              logging.info)
        viowin_ltr = virtio_win.drive_letter_iso(session)
        if not viowin_ltr:
            test.error("Could not find virtio-win drive in guest")
        guest_name = virtio_win.product_dirname_iso(session)
        if not guest_name:
            test.error("Could not get product dirname of the vm")
        guest_arch = virtio_win.arch_dirname_iso(session)
        if not guest_arch:
            test.error("Could not get architecture dirname of the vm")

        pdb_middle_path = "%s\\%s" % (guest_name, guest_arch)
        pdb_find_cmd = 'dir /b /s %s\\%s.pdb | findstr "\\%s\\\\"'
        pdb_find_cmd %= (viowin_ltr, driver_name, pdb_middle_path)
        pdb_path = session.cmd(pdb_find_cmd, timeout=timeout).strip()
        logging.info("Found Netkvm.pdb file at '%s'", pdb_path)
        _copy_file(session, pdb_path, "c:\\")
        return session