• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python reporter.log函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中testdriver.reporter.log函数的典型用法代码示例。如果您正苦于以下问题:Python log函数的具体用法?Python log怎么用?Python log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了log函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: testIGuest_additionsVersion

    def testIGuest_additionsVersion(self, oGuest):
        """
        Returns False if no version string could be obtained, otherwise True
        even though errors are logged.
        """
        try:
            sVer = oGuest.additionsVersion
        except:
            reporter.errorXcpt("Getting the additions version failed.")
            return False
        reporter.log('IGuest::additionsVersion="%s"' % (sVer,))

        if sVer.strip() == "":
            reporter.error("IGuest::additionsVersion is empty.")
            return False

        if sVer != sVer.strip():
            reporter.error('IGuest::additionsVersion is contains spaces: "%s".' % (sVer,))

        asBits = sVer.split(".")
        if len(asBits) < 3:
            reporter.error(
                'IGuest::additionsVersion does not contain at least tree dot separated fields: "%s" (%d).'
                % (sVer, len(asBits))
            )

        ## @todo verify the format.
        return True
开发者ID:svn2github,项目名称:virtualbox,代码行数:28,代码来源:tdAddBasic1.py


示例2: moveVMToLocation

    def moveVMToLocation(self, sLocation, oVM):
        """
        Document me here, not with hashes above.
        """
        fRc = True
        try:

            ## @todo r=bird: Too much unncessary crap inside try clause.  Only oVM.moveTo needs to be here.
            ##               Though, you could make an argument for oVM.name too, perhaps.

            # move machine
            reporter.log('Moving machine "%s" to the "%s"' % (oVM.name, sLocation))
            sType = 'basic'
            oProgress = vboxwrappers.ProgressWrapper(oVM.moveTo(sLocation, sType), self.oTstDrv.oVBoxMgr, self.oTstDrv,
                                                     'moving machine "%s"' % (oVM.name,))

        except:
            return reporter.errorXcpt('Machine::moveTo("%s") for machine "%s" failed' % (sLocation, oVM.name,))

        oProgress.wait()
        if oProgress.logResult() is False:
            fRc = False
            reporter.log('Progress object returned False')
        else:
            fRc = True

        return fRc
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:27,代码来源:tdMoveVM1.py


示例3: logMemoryStats

def logMemoryStats():
    """
    Logs windows memory stats.
    """
    class MemoryStatusEx(ctypes.Structure):
        """ MEMORYSTATUSEX """
        kaFields = [
            ( 'dwLength',                    ctypes.c_ulong ),
            ( 'dwMemoryLoad',                ctypes.c_ulong ),
            ( 'ullTotalPhys',                ctypes.c_ulonglong ),
            ( 'ullAvailPhys',                ctypes.c_ulonglong ),
            ( 'ullTotalPageFile',            ctypes.c_ulonglong ),
            ( 'ullAvailPageFile',            ctypes.c_ulonglong ),
            ( 'ullTotalVirtual',             ctypes.c_ulonglong ),
            ( 'ullAvailVirtual',             ctypes.c_ulonglong ),
            ( 'ullAvailExtendedVirtual',     ctypes.c_ulonglong ),
        ];
        _fields_ = kaFields; # pylint: disable=invalid-name

        def __init__(self):
            super(MemoryStatusEx, self).__init__();
            self.dwLength = ctypes.sizeof(self);

    try:
        oStats = MemoryStatusEx();
        ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(oStats));
    except:
        reporter.logXcpt();
        return False;

    reporter.log('Memory statistics:');
    for sField, _ in MemoryStatusEx.kaFields:
        reporter.log('  %32s: %s' % (sField, getattr(oStats, sField)));
    return True;
开发者ID:miguelinux,项目名称:vbox,代码行数:34,代码来源:winbase.py


示例4: impersonate

    def impersonate(self, sImpersonation):
        """
        Impersonate a given device.
        """

        # Clear any previous impersonation
        self._clearImpersonation();
        self.sImpersonation = sImpersonation;

        if sImpersonation == g_ksGadgetImpersonationInvalid:
            return False;
        elif sImpersonation == g_ksGadgetImpersonationTest:
            return self._loadModule('g_zero');
        elif sImpersonation == g_ksGadgetImpersonationMsd:
            # @todo: Not complete
            return self._loadModule('g_mass_storage');
        elif sImpersonation == g_ksGadgetImpersonationWebcam:
            # @todo: Not complete
            return self._loadModule('g_webcam');
        elif sImpersonation == g_ksGadgetImpersonationEther:
            return self._loadModule('g_ether');
        else:
            reporter.log('Invalid impersonation');

        return False;
开发者ID:swimming198243,项目名称:virtualbox,代码行数:25,代码来源:usbgadget.py


示例5: parseOption

 def parseOption(self, asArgs, iArg):  # pylint: disable=R0912,R0915
     if asArgs[iArg] == "--test-build-dir":
         iArg += 1
         if iArg >= len(asArgs):
             raise base.InvalidOption('The "--test-build-dir" takes a path argument')
         self.sTestBuildDir = asArgs[iArg]
     elif asArgs[iArg] == "--test-vms":
         iArg += 1
         if iArg >= len(asArgs):
             raise base.InvalidOption('The "--test-vms" takes colon separated list')
         self.asTestVMs = asArgs[iArg].split(":")
         for s in self.asTestVMs:
             if s not in self.asTestVMsDef:
                 raise base.InvalidOption(
                     'The "--test-vms" value "%s" is not valid; valid values are: %s'
                     % (s, " ".join(self.asTestVMsDef))
                 )
     elif asArgs[iArg] == "--skip-vms":
         iArg += 1
         if iArg >= len(asArgs):
             raise base.InvalidOption('The "--skip-vms" takes colon separated list')
         self.asSkipVMs = asArgs[iArg].split(":")
         for s in self.asSkipVMs:
             if s not in self.asTestVMsDef:
                 reporter.log('warning: The "--test-vms" value "%s" does not specify any of our test VMs.' % (s))
     else:
         return vbox.TestDriver.parseOption(self, asArgs, iArg)
     return iArg + 1
开发者ID:miguelinux,项目名称:vbox,代码行数:28,代码来源:tdAutostart1.py


示例6: _sudoExecuteSync

    def _sudoExecuteSync(self, asArgs, sInput):
        """
        Executes a sudo child process synchronously.
        Returns a tuple [True, 0] if the process executed successfully
        and returned 0, otherwise [False, rc] is returned.
        """
        reporter.log('Executing [sudo]: %s' % (asArgs, ));
        reporter.flushall();
        fRc = True;
        sOutput = '';
        sError = '';
        try:
            oProcess = utils.sudoProcessPopen(asArgs, stdout=subprocess.PIPE, stdin=subprocess.PIPE,
                                              stderr=subprocess.PIPE, shell = False, close_fds = False);

            sOutput, sError = oProcess.communicate(sInput);
            iExitCode  = oProcess.poll();

            if iExitCode is not 0:
                fRc = False;
        except:
            reporter.errorXcpt();
            fRc = False;
        reporter.log('Exit code [sudo]: %s (%s)' % (fRc, asArgs));
        return (fRc, str(sOutput), str(sError));
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:25,代码来源:remoteexecutor.py


示例7: installVirtualBox

    def installVirtualBox(self, oSession, oTxsSession):
        """
        Install VirtualBox in the guest.
        """
        fRc = False;

        if self.sTestBuild is not None:
            reporter.log('Testing build: %s' % (self.sTestBuild));
            sTestBuildFilename = os.path.basename(self.sTestBuild);

            # Construct the .pkg filename from the tar.gz name.
            oMatch = re.search(r'\d+.\d+.\d+-SunOS-r\d+', sTestBuildFilename);
            if oMatch is not None:
                sPkgFilename = 'VirtualBox-' + oMatch.group() + '.pkg';

                reporter.log('Extracted package filename: %s' % (sPkgFilename));

                fRc = self.oTestDriver.txsUploadFile(oSession, oTxsSession, self.sTestBuild, \
                                                     '${SCRATCH}/' + sTestBuildFilename, \
                                                     cMsTimeout = 120 * 1000);
                fRc = fRc and self.oTestDriver.txsUnpackFile(oSession, oTxsSession, \
                                                             '${SCRATCH}/' + sTestBuildFilename, \
                                                             '${SCRATCH}', cMsTimeout = 120 * 1000);
                fRc = fRc and self.oTestDriver.txsRunTest(oTxsSession, 'Installing package', 240 * 1000, \
                                                          '/usr/sbin/pkgadd',
                                                          ('pkgadd', '-d', '${SCRATCH}/' + sPkgFilename, \
                                                           '-n', '-a', '${SCRATCH}/autoresponse', 'SUNWvbox'));
        return fRc;
开发者ID:swimming198243,项目名称:virtualbox,代码行数:28,代码来源:tdAutostart1.py


示例8: impersonate

    def impersonate(self, sImpersonation):
        """
        Impersonate a given device.
        """

        # Clear any previous impersonation
        self._clearImpersonation();
        self.sImpersonation = sImpersonation;

        if sImpersonation == 'Invalid':
            return False;
        elif sImpersonation == 'Test':
            return self._loadModule('g_zero');
        elif sImpersonation == 'Msd':
            # @todo: Not complete
            return self._loadModule('g_mass_storage');
        elif sImpersonation == 'Webcam':
            # @todo: Not complete
            return self._loadModule('g_webcam');
        elif sImpersonation == 'Network':
            return self._loadModule('g_ether');
        else:
            reporter.log('Invalid impersonation');

        return False;
开发者ID:mcenirm,项目名称:vbox,代码行数:25,代码来源:usbgadget.py


示例9: isHostCpuAffectedByUbuntuNewAmdBug

    def isHostCpuAffectedByUbuntuNewAmdBug(self, oTestDrv):
        """
        Checks if the host OS is affected by older ubuntu installers being very
        picky about which families of AMD CPUs it would run on.

        The installer checks for family 15, later 16, later 20, and in 11.10
        they remove the family check for AMD CPUs.
        """
        if not oTestDrv.isHostCpuAmd():
            return False;
        try:
            (uMaxExt, _, _, _) = oTestDrv.oVBox.host.getProcessorCPUIDLeaf(0, 0x80000000, 0);
            (uFamilyModel, _, _, _) = oTestDrv.oVBox.host.getProcessorCPUIDLeaf(0, 0x80000001, 0);
        except:
            reporter.logXcpt();
            return False;
        if uMaxExt < 0x80000001 or uMaxExt > 0x8000ffff:
            return False;

        uFamily = (uFamilyModel >> 8) & 0xf
        if uFamily == 0xf:
            uFamily = ((uFamilyModel >> 20) & 0x7f) + 0xf;
        ## @todo Break this down into which old ubuntu release supports exactly
        ##       which AMD family, if we care.
        if uFamily <= 15:
            return False;
        reporter.log('Skipping "%s" because host CPU is a family %u AMD, which may cause trouble for the guest OS installer.'
                     % (self.sVmName, uFamily,));
        return True;
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:29,代码来源:tdGuestOsInstTest1.py


示例10: installVirtualBox

    def installVirtualBox(self, oSession, oTxsSession):
        """
        Install VirtualBox in the guest.
        """
        fRc = False

        if self.sTestBuild is not None:
            reporter.log("Testing build: %s" % (self.sTestBuild))
            sTestBuildFilename = os.path.basename(self.sTestBuild)

            # Construct the .pkg filename from the tar.gz name.
            oMatch = re.search(r"\d+.\d+.\d+-SunOS-r\d+", sTestBuildFilename)
            if oMatch is not None:
                sPkgFilename = "VirtualBox-" + oMatch.group() + ".pkg"

                reporter.log("Extracted package filename: %s" % (sPkgFilename))

                fRc = self.oTestDriver.txsUploadFile(
                    oSession, oTxsSession, self.sTestBuild, "${SCRATCH}/" + sTestBuildFilename, cMsTimeout=120 * 1000
                )
                fRc = fRc and self.oTestDriver.txsUnpackFile(
                    oSession, oTxsSession, "${SCRATCH}/" + sTestBuildFilename, "${SCRATCH}", cMsTimeout=120 * 1000
                )
                fRc = fRc and self.oTestDriver.txsRunTest(
                    oTxsSession,
                    "Installing package",
                    240 * 1000,
                    "/usr/sbin/pkgadd",
                    ("pkgadd", "-d", "${SCRATCH}/" + sPkgFilename, "-n", "-a", "${SCRATCH}/autoresponse", "SUNWvbox"),
                )
        return fRc
开发者ID:miguelinux,项目名称:vbox,代码行数:31,代码来源:tdAutostart1.py


示例11: testOneVmConfig

    def testOneVmConfig(self, oVM, oTestVm):
        """
        Install guest OS and wait for result
        """

        self.logVmInfo(oVM)
        reporter.testStart('Installing %s' % (oTestVm.sVmName,))

        cMsTimeout = 40*60000;
        if not reporter.isLocal(): ## @todo need to figure a better way of handling timeouts on the testboxes ...
            cMsTimeout = 180 * 60000; # will be adjusted down.

        oSession, _ = self.startVmAndConnectToTxsViaTcp(oTestVm.sVmName, fCdWait = False, cMsTimeout = cMsTimeout);
        if oSession is not None:
            # The guest has connected to TXS, so we're done (for now anyways).
            reporter.log('Guest reported success')
            ## @todo Do save + restore.

            reporter.testDone()
            fRc = self.terminateVmBySession(oSession)
            return fRc is True

        reporter.error('Installation of %s has failed' % (oTestVm.sVmName,))
        oTestVm.detatchAndDeleteHd(self); # Save space.
        reporter.testDone()
        return False
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:26,代码来源:tdGuestOsInstTest1.py


示例12: parseOption

 def parseOption(self, asArgs, iArg):                                        # pylint: disable=R0912,R0915
     if asArgs[iArg] == '--storage-ctrls':
         iArg += 1;
         if iArg >= len(asArgs):
             raise base.InvalidOption('The "--storage-ctrls" takes a colon separated list of Storage controller types');
         self.asStorageCtrls = asArgs[iArg].split(':');
     elif asArgs[iArg] == '--disk-formats':
         iArg += 1;
         if iArg >= len(asArgs): raise base.InvalidOption('The "--disk-formats" takes a colon separated list of disk formats');
         self.asDiskFormats = asArgs[iArg].split(':');
     elif asArgs[iArg] == '--test-vms':
         iArg += 1;
         if iArg >= len(asArgs): raise base.InvalidOption('The "--test-vms" takes colon separated list');
         self.asTestVMs = asArgs[iArg].split(':');
         for s in self.asTestVMs:
             if s not in self.asTestVMsDef:
                 raise base.InvalidOption('The "--test-vms" value "%s" is not valid; valid values are: %s' \
                     % (s, ' '.join(self.asTestVMsDef)));
     elif asArgs[iArg] == '--skip-vms':
         iArg += 1;
         if iArg >= len(asArgs): raise base.InvalidOption('The "--skip-vms" takes colon separated list');
         self.asSkipVMs = asArgs[iArg].split(':');
         for s in self.asSkipVMs:
             if s not in self.asTestVMsDef:
                 reporter.log('warning: The "--test-vms" value "%s" does not specify any of our test VMs.' % (s));
     else:
         return vbox.TestDriver.parseOption(self, asArgs, iArg);
     return iArg + 1;
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:28,代码来源:tdStorageSnapshotMerging1.py


示例13: moveTo

    def moveTo(self, sLocation, aoMediumAttachments):
        for oAttachment in aoMediumAttachments:
            try:
                oMedium = oAttachment.medium
                reporter.log('Move medium "%s" to "%s"' % (oMedium.name, sLocation,))
            except:
                reporter.errorXcpt('failed to get the medium from the IMediumAttachment "%s"' % (oAttachment))

            if self.oTstDrv.fpApiVer >= 5.3 and self.oTstDrv.uRevision > 124748:
                try:
                    oProgress = vboxwrappers.ProgressWrapper(oMedium.moveTo(sLocation), self.oTstDrv.oVBoxMgr, self.oTstDrv,
                                                             'move "%s"' % (oMedium.name,));
                except:
                    return reporter.errorXcpt('Medium::moveTo("%s") for medium "%s" failed' % (sLocation, oMedium.name,));
            else:
                try:
                    oProgress = vboxwrappers.ProgressWrapper(oMedium.setLocation(sLocation), self.oTstDrv.oVBoxMgr, self.oTstDrv,
                                                             'move "%s"' % (oMedium.name,));
                except:
                    return reporter.errorXcpt('Medium::setLocation("%s") for medium "%s" failed' % (sLocation, oMedium.name,));


            oProgress.wait()
            if oProgress.logResult() is False:
                return False
        return True
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:26,代码来源:tdMoveMedium1.py


示例14: actionExecuteOnRunnigVM

    def actionExecuteOnRunnigVM(self):
        if not self.importVBoxApi():
            return False;

        oVirtualBox = self.oVBoxMgr.getVirtualBox()
        oMachine = oVirtualBox.findMachine(self.sVMname)

        if oMachine == None:
            reporter.log("Machine '%s' is unknown" % (oMachine.name))
            return False

        if oMachine.state != self.oVBoxMgr.constants.MachineState_Running:
            reporter.log("Machine '%s' is not Running" % (oMachine.name))
            return False

        oSession = self.oVBoxMgr.mgr.getSessionObject(oVirtualBox)
        oMachine.lockMachine(oSession, self.oVBoxMgr.constants.LockType_Shared)

        self.doTest(oSession);

        oSession.unlockMachine()

        del oSession
        del oMachine
        del oVirtualBox
        return True
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:26,代码来源:tdGuestHostTimings.py


示例15: _installExtPack

    def _installExtPack(self):
        """ Installs the extension pack. """
        sVBox = self._getVBoxInstallPath(fFailIfNotFound = True);
        if sVBox is None:
            return False;
        sExtPackDir = os.path.join(sVBox, 'ExtensionPacks');

        if self._uninstallAllExtPacks() is not True:
            return False;

        sExtPack = self._findFile('Oracle_VM_VirtualBox_Extension_Pack.vbox-extpack');
        if sExtPack is None:
            sExtPack = self._findFile('Oracle_VM_VirtualBox_Extension_Pack.*.vbox-extpack');
        if sExtPack is None:
            return True;

        sDstDir = os.path.join(sExtPackDir, 'Oracle_VM_VirtualBox_Extension_Pack');
        reporter.log('Installing extension pack "%s" to "%s"...' % (sExtPack, sExtPackDir));
        fRc, _ = self._sudoExecuteSync([ self.getBinTool('vts_tar'),
                                         '--extract',
                                         '--verbose',
                                         '--gzip',
                                         '--file',                sExtPack,
                                         '--directory',           sDstDir,
                                         '--file-mode-and-mask',  '0644',
                                         '--file-mode-or-mask',   '0644',
                                         '--dir-mode-and-mask',   '0755',
                                         '--dir-mode-or-mask',    '0755',
                                         '--owner',               '0',
                                         '--group',               '0',
                                       ]);
        return fRc;
开发者ID:zBMNForks,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:32,代码来源:vboxinstaller.py


示例16: testSnapshotTreeDepth

    def testSnapshotTreeDepth(self):
        """
        Test snapshot tree depth.
        """
        reporter.testStart('snapshotTreeDepth')

        try:
            oVM = self.createTestVM('test-snap', 1, None, 4)
            assert oVM is not None

            # modify the VM config, create and attach empty HDD
            oSession = self.openSession(oVM)
            sHddPath = os.path.join(self.sScratchPath, 'TestSnapEmpty.vdi')
            fRc = True
            fRc = fRc and oSession.createAndAttachHd(sHddPath, cb=1024*1024, sController='SATA Controller', fImmutable=False)
            fRc = fRc and oSession.saveSettings()

            # take 250 snapshots (snapshot tree depth limit)
            for i in range(1, 251):
                fRc = fRc and oSession.takeSnapshot('Snapshot ' + str(i))
            fRc = oSession.close() and fRc

            # unregister and re-register to test loading of settings
            sSettingsFile = oVM.settingsFilePath
            reporter.log('unregistering VM')
            oVM.unregister(vboxcon.CleanupMode_DetachAllReturnNone)
            oVBox = self.oVBoxMgr.getVirtualBox()
            reporter.log('opening VM %s, testing config reading' % (sSettingsFile))
            oVM = oVBox.openMachine(sSettingsFile)

            assert fRc is True
        except:
            reporter.errorXcpt()

        return reporter.testDone()[1] == 0
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:35,代码来源:tdTreeDepth1.py


示例17: parseOption

 def parseOption(self, asArgs, iArg):                                        # pylint: disable=R0912,R0915
     if asArgs[iArg] == '--virt-modes':
         iArg += 1;
         if iArg >= len(asArgs): raise base.InvalidOption('The "--virt-modes" takes a colon separated list of modes');
         self.asVirtModes = asArgs[iArg].split(':');
         for s in self.asVirtModes:
             if s not in self.asVirtModesDef:
                 raise base.InvalidOption('The "--virt-modes" value "%s" is not valid; valid values are: %s' \
                     % (s, ' '.join(self.asVirtModesDef)));
     elif asArgs[iArg] == '--cpu-counts':
         iArg += 1;
         if iArg >= len(asArgs): raise base.InvalidOption('The "--cpu-counts" takes a colon separated list of cpu counts');
         self.acCpus = [];
         for s in asArgs[iArg].split(':'):
             try: c = int(s);
             except: raise base.InvalidOption('The "--cpu-counts" value "%s" is not an integer' % (s,));
             if c <= 0:  raise base.InvalidOption('The "--cpu-counts" value "%s" is zero or negative' % (s,));
             self.acCpus.append(c);
     elif asArgs[iArg] == '--storage-ctrls':
         iArg += 1;
         if iArg >= len(asArgs):
             raise base.InvalidOption('The "--storage-ctrls" takes a colon separated list of Storage controller types');
         self.asStorageCtrls = asArgs[iArg].split(':');
     elif asArgs[iArg] == '--disk-formats':
         iArg += 1;
         if iArg >= len(asArgs): raise base.InvalidOption('The "--disk-formats" takes a colon separated list of disk formats');
         self.asDiskFormats = asArgs[iArg].split(':');
     elif asArgs[iArg] == '--disk-dirs':
         iArg += 1;
         if iArg >= len(asArgs): raise base.InvalidOption('The "--disk-dirs" takes a colon separated list of directories');
         self.asDirs = asArgs[iArg].split(':');
     elif asArgs[iArg] == '--iscsi-targets':
         iArg += 1;
         if iArg >= len(asArgs):
             raise base.InvalidOption('The "--iscsi-targets" takes a colon separated list of iscsi targets');
         self.asIscsiTargets = asArgs[iArg].split(':');
     elif asArgs[iArg] == '--tests':
         iArg += 1;
         if iArg >= len(asArgs): raise base.InvalidOption('The "--tests" takes a colon separated list of disk formats');
         self.asTests = asArgs[iArg].split(':');
     elif asArgs[iArg] == '--test-vms':
         iArg += 1;
         if iArg >= len(asArgs): raise base.InvalidOption('The "--test-vms" takes colon separated list');
         self.asTestVMs = asArgs[iArg].split(':');
         for s in self.asTestVMs:
             if s not in self.asTestVMsDef:
                 raise base.InvalidOption('The "--test-vms" value "%s" is not valid; valid values are: %s' \
                     % (s, ' '.join(self.asTestVMsDef)));
     elif asArgs[iArg] == '--skip-vms':
         iArg += 1;
         if iArg >= len(asArgs): raise base.InvalidOption('The "--skip-vms" takes colon separated list');
         self.asSkipVMs = asArgs[iArg].split(':');
         for s in self.asSkipVMs:
             if s not in self.asTestVMsDef:
                 reporter.log('warning: The "--test-vms" value "%s" does not specify any of our test VMs.' % (s));
     else:
         return vbox.TestDriver.parseOption(self, asArgs, iArg);
     return iArg + 1;
开发者ID:mcenirm,项目名称:vbox,代码行数:58,代码来源:tdStorageBenchmark1.py


示例18: test1Sub7

 def test1Sub7(self, oVmSrc, oVmDst):
     """
     Test the password check.
     """
     reporter.testStart('Bad password')
     if    self.test1ResetVmConfig(oVmSrc, fTeleporterEnabled = False) \
       and self.test1ResetVmConfig(oVmDst, fTeleporterEnabled = True):
         # Start the target VM.
         oSessionDst, oProgressDst = self.startVmEx(
             oVmDst, fWait=False)
         if oSessionDst is not None:
             if oProgressDst.waitForOperation(iOperation=-3) == 0:
                 # Start the source VM.
                 oSessionSrc = self.startVm(oVmSrc)
                 if oSessionSrc is not None:
                     tsPasswords = (
                         'password-bad',
                         'passwor',
                         'pass',
                         'p',
                         '',
                         'Password',
                     )
                     for sPassword in tsPasswords:
                         reporter.testStart(sPassword)
                         oProgressSrc = oSessionSrc.teleport(
                             'localhost', 6502, sPassword)
                         if oProgressSrc:
                             oProgressSrc.wait()
                             reporter.log(
                                 'src: %s' % oProgressSrc.stringifyResult())
                             if oProgressSrc.isSuccess():
                                 reporter.testFailure(
                                     'IConsole::teleport succeeded with bad password "%s"'
                                     % sPassword)
                             elif oProgressSrc.getErrInfoResultCode(
                             ) != vbox.ComError.E_FAIL:
                                 reporter.testFailure('IConsole::teleport returns %s instead of E_FAIL' \
                                                      % (vbox.ComError.toString(oProgressSrc.getErrInfoResultCode()),))
                             elif oProgressSrc.getErrInfoText(
                             ) != 'Invalid password':
                                 reporter.testFailure('IConsole::teleport returns "%s" instead of "Invalid password"' \
                                                      % (oProgressSrc.getErrInfoText(),))
                             elif oProgressDst.isCompleted():
                                 reporter.testFailure('Destination completed unexpectedly after bad password "%s"' \
                                                      % sPassword)
                         else:
                             reporter.testFailure(
                                 'IConsole::teleport failed with password "%s"'
                                 % sPassword)
                         if reporter.testDone()[1] != 0:
                             break
                     self.terminateVmBySession(oSessionSrc, oProgressSrc)
             self.terminateVmBySession(oSessionDst, oProgressDst)
     else:
         reporter.testFailure('reconfig failed')
     return reporter.testDone()[1] == 0
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:57,代码来源:tdTeleportLocal1.py


示例19: _installVBox

    def _installVBox(self):
        """
        Download / copy the build files into the scratch area and install them.
        """
        reporter.testStart('Installing VirtualBox');
        reporter.log('CWD=%s' % (os.getcwd(),)); # curious

        #
        # Download the build files.
        #
        for i in range(len(self._asBuildUrls)):
            if webutils.downloadFile(self._asBuildUrls[i], self._asBuildFiles[i],
                                     self.sBuildPath, reporter.log, reporter.log) is not True:
                reporter.testDone(fSkipped = True);
                return None; # Failed to get binaries, probably deleted. Skip the test run.

        #
        # Unpack anything we know what is and append it to the build files
        # list.  This allows us to use VBoxAll*.tar.gz files.
        #
        for sFile in list(self._asBuildFiles):
            if self._maybeUnpackArchive(sFile, fNonFatal = True) is not True:
                reporter.testDone(fSkipped = True);
                return None; # Failed to unpack. Probably local error, like busy
                             # DLLs on windows, no reason for failing the build.

        #
        # Go to system specific installation code.
        #
        sHost = utils.getHostOs()
        if   sHost == 'darwin':     fRc = self._installVBoxOnDarwin();
        elif sHost == 'linux':      fRc = self._installVBoxOnLinux();
        elif sHost == 'solaris':    fRc = self._installVBoxOnSolaris();
        elif sHost == 'win':        fRc = self._installVBoxOnWindows();
        else:
            reporter.error('Unsupported host "%s".' % (sHost,));
        if fRc is False:
            reporter.testFailure('Installation error.');

        #
        # Install the extension pack.
        #
        if fRc is True  and  self._fAutoInstallPuelExtPack:
            fRc = self._installExtPack();
            if fRc is False:
                reporter.testFailure('Extension pack installation error.');

        # Some debugging...
        try:
            cMbFreeSpace = utils.getDiskUsage(self.sScratchPath);
            reporter.log('Disk usage after VBox install: %d MB available at %s' % (cMbFreeSpace, self.sScratchPath,));
        except:
            reporter.logXcpt('Unable to get disk free space. Ignored. Continuing.');

        reporter.testDone();
        return fRc;
开发者ID:zBMNForks,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:56,代码来源:vboxinstaller.py


示例20: __getSnapshotsFiles

 def __getSnapshotsFiles(self, oMachine, fPrint = False):
     asSnapshotsFilesList = set()
     sFolder = oMachine.snapshotFolder
     for sFile in os.listdir(sFolder):
         if sFile.endswith(".sav") is False:
             sFullPath = os.path.join(sFolder, sFile)
             asSnapshotsFilesList.add(sFullPath)
             if fPrint is True:
                 reporter.log("Snapshot file is %s" % (sFullPath))
     return asSnapshotsFilesList
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:10,代码来源:tdMoveVM1.py



注:本文中的testdriver.reporter.log函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python reporter.logXcpt函数代码示例发布时间:2022-05-27
下一篇:
Python reporter.errorXcpt函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap