VirtualBox

Changeset 84544 in vbox


Ignore:
Timestamp:
May 26, 2020 4:07:58 PM (4 years ago)
Author:
vboxsync
Message:

Validation Kit/tdAddGuestCtrl.py: Decreased default verbosity for gctrlExecute() a bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py

    r84483 r84544  
    19351935                cOthers += aSubResult[3];
    19361936            elif eType is vboxcon.FsObjType_File:
    1937                 reporter.log2('  File "%s"' % oFsObjInfo.name);
     1937                reporter.log4('  File "%s"' % oFsObjInfo.name);
    19381938                cFiles += 1;
    19391939            elif eType is vboxcon.FsObjType_Symlink:
    1940                 reporter.log2('  Symlink "%s" -- not tested yet' % oFsObjInfo.name);
     1940                reporter.log4('  Symlink "%s" -- not tested yet' % oFsObjInfo.name);
    19411941                cOthers += 1;
    19421942            elif    oTestVm.isWindows() \
     
    20982098        return fRc;
    20992099
    2100     def gctrlExecute(self, oTest, oGuestSession, fIsError):
     2100    def gctrlExecute(self, oTest, oGuestSession, fIsError):                     # pylint: disable=too-many-statements
    21012101        """
    21022102        Helper function to execute a program on a guest, specified in the current test.
     
    21252125        # Start the process:
    21262126        #
    2127         reporter.log2('Executing sCmd=%s, afFlags=%s, timeoutMS=%d, asArgs=%s, asEnv=%s'
    2128                       % (oTest.sCmd, oTest.afFlags, oTest.timeoutMS, oTest.asArgs, oTest.aEnv,));
     2127        reporter.log2('Executing sCmd=%s, afFlags=%s, timeoutMS=%d, asEnv=%s'
     2128                      % (oTest.sCmd, oTest.afFlags, oTest.timeoutMS, oTest.aEnv,));
     2129
     2130        # Don't be too noisy by default when testing reeeeeeally long arguments.
     2131        if len(oTest.asArgs) <= 64:
     2132            reporter.log2('asArgs=%s' % (oTest.asArgs,));
     2133        else:
     2134            reporter.log4('asArgs=%s' % (oTest.asArgs,));
     2135
    21292136        try:
    21302137            oProcess = oGuestSession.processCreate(oTest.sCmd,
     
    22052212                                        reporter.log2('Process (PID %d) got %d bytes of %s data (type: %s)'
    22062213                                                      % (iPid, len(abBuf), sFdNm, type(abBuf)));
    2207                                         sBuf = '';
    2208                                         if sys.version_info >= (2, 7):
    2209                                             if isinstance(abBuf, memoryview): ## @todo Why is this happening?
    2210                                                 abBuf = abBuf.tobytes();
    2211                                                 sBuf  = abBuf.decode("utf-8");
    2212                                         if isinstance(abBuf, buffer):
    2213                                             sBuf = str(abBuf);
    2214                                         for sLine in sBuf.splitlines():
    2215                                             reporter.log('%s: %s' % (sFdNm, sLine));
     2214                                        if reporter.getVerbosity() >= 4:
     2215                                            sBuf = '';
     2216                                            if sys.version_info >= (2, 7):
     2217                                                if isinstance(abBuf, memoryview): ## @todo Why is this happening?
     2218                                                    abBuf = abBuf.tobytes();
     2219                                                    sBuf  = abBuf.decode("utf-8");
     2220                                            if isinstance(abBuf, buffer):
     2221                                                sBuf = str(abBuf);
     2222                                            for sLine in sBuf.splitlines():
     2223                                                reporter.log4('%s: %s' % (sFdNm, sLine));
    22162224                                        acbFdOut[iFd] += len(abBuf);
    22172225                                        oTest.sBuf     = abBuf; ## @todo Figure out how to uniform + append!
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette