Index: /trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
===================================================================
--- /trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py	(revision 65962)
+++ /trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py	(revision 65963)
@@ -1403,5 +1403,5 @@
                         reporter.log2('Test #%d passed: Buffers match (%d bytes)' % (i, len(oRes.sBuf)));
                 elif     oRes.sBuf is not None \
-                     and len(oRes.sBuf):
+                     and oRes.sBuf:
                     reporter.error('Test #%d failed: Got no buffer data, expected\n%s (%dbytes)' %
                                    (i, map(hex, map(ord, oRes.sBuf)), len(oRes.sBuf)));
@@ -1460,18 +1460,18 @@
                                 or waitResult == vboxcon.ProcessWaitResult_WaitFlagNotSupported:
                                 reporter.log2('Reading stdout ...');
-                                buf = curProc.Read(1, 64 * 1024, oTest.timeoutMS);
-                                if len(buf):
-                                    reporter.log2('Process (PID %d) got %d bytes of stdout data' % (curProc.PID, len(buf)));
-                                    oTest.cbStdOut += len(buf);
-                                    oTest.sBuf = buf; # Appending does *not* work atm, so just assign it. No time now.
+                                abBuf = curProc.Read(1, 64 * 1024, oTest.timeoutMS);
+                                if abBuf:
+                                    reporter.log2('Process (PID %d) got %d bytes of stdout data' % (curProc.PID, len(abBuf)));
+                                    oTest.cbStdOut += len(abBuf);
+                                    oTest.sBuf = abBuf; # Appending does *not* work atm, so just assign it. No time now.
                             # Try stderr.
                             if     waitResult == vboxcon.ProcessWaitResult_StdErr \
                                 or waitResult == vboxcon.ProcessWaitResult_WaitFlagNotSupported:
                                 reporter.log2('Reading stderr ...');
-                                buf = curProc.Read(2, 64 * 1024, oTest.timeoutMS);
-                                if len(buf):
-                                    reporter.log2('Process (PID %d) got %d bytes of stderr data' % (curProc.PID, len(buf)));
-                                    oTest.cbStdErr += len(buf);
-                                    oTest.sBuf = buf; # Appending does *not* work atm, so just assign it. No time now.
+                                abBuf = curProc.Read(2, 64 * 1024, oTest.timeoutMS);
+                                if abBuf:
+                                    reporter.log2('Process (PID %d) got %d bytes of stderr data' % (curProc.PID, len(abBuf)));
+                                    oTest.cbStdErr += len(abBuf);
+                                    oTest.sBuf = abBuf; # Appending does *not* work atm, so just assign it. No time now.
                             # Use stdin.
                             if     waitResult == vboxcon.ProcessWaitResult_StdIn \
Index: /trunk/src/VBox/ValidationKit/tests/autostart/tdAutostart1.py
===================================================================
--- /trunk/src/VBox/ValidationKit/tests/autostart/tdAutostart1.py	(revision 65962)
+++ /trunk/src/VBox/ValidationKit/tests/autostart/tdAutostart1.py	(revision 65963)
@@ -69,5 +69,5 @@
                 # Extract the value
             idxVmNameStart = sLine.find('"');
-            if idxVmNameStart is -1:
+            if idxVmNameStart == -1:
                 raise Exception('VBoxManageStdOutWrapper: Invalid output');
 
Index: /trunk/src/VBox/ValidationKit/tests/storage/remoteexecutor.py
===================================================================
--- /trunk/src/VBox/ValidationKit/tests/storage/remoteexecutor.py	(revision 65962)
+++ /trunk/src/VBox/ValidationKit/tests/storage/remoteexecutor.py	(revision 65963)
@@ -101,6 +101,5 @@
         if self.oTxsSession is not None:
             return self.oTxsSession.syncIsFile(sFile);
-        else:
-            return os.path.isfile(sFile);
+        return os.path.isfile(sFile);
 
     def _getBinaryPath(self, sBinary):
Index: /trunk/src/VBox/ValidationKit/tests/storage/storagecfg.py
===================================================================
--- /trunk/src/VBox/ValidationKit/tests/storage/storagecfg.py	(revision 65962)
+++ /trunk/src/VBox/ValidationKit/tests/storage/storagecfg.py	(revision 65963)
@@ -291,5 +291,5 @@
             fRc = oExec.execBinaryNoStdOut('sfdisk', ('--no-reread', '--wipe', 'always', '-q', '-f', sDiskPath), sFdiskScript);
             if fRc:
-                if sDiskPath.find('nvme') is not -1:
+                if sDiskPath.find('nvme') != -1:
                     sBlkDev = sDiskPath + 'p1';
                 else:
Index: /trunk/src/VBox/ValidationKit/tests/storage/tdStorageBenchmark1.py
===================================================================
--- /trunk/src/VBox/ValidationKit/tests/storage/tdStorageBenchmark1.py	(revision 65962)
+++ /trunk/src/VBox/ValidationKit/tests/storage/tdStorageBenchmark1.py	(revision 65963)
@@ -228,5 +228,5 @@
                         # Extract the value
                         idxValue = sLine.rfind('=');
-                        if idxValue is -1:
+                        if idxValue == -1:
                             raise Exception('IozoneTest: Invalid state');
 
@@ -243,5 +243,5 @@
 
                         for sNeedle, sTestVal in self.lstTests:
-                            if sLine.rfind(sNeedle) is not -1:
+                            if sLine.rfind(sNeedle) != -1:
                                 reporter.testValue(sTestVal, sLine[idxValue:idxValueEnd],
                                                    constants.valueunit.g_asNames[constants.valueunit.KILOBYTES_PER_SEC]);
@@ -281,5 +281,5 @@
         # Get the first non blacklisted test.
         asTestCfg = self.getCurrentTestCfg();
-        while len(asTestCfg) > 0 and self.isTestCfgBlacklisted(asTestCfg):
+        while asTestCfg and self.isTestCfgBlacklisted(asTestCfg):
             asTestCfg = self.advanceTestCfg();
 
@@ -305,6 +305,5 @@
         if fnTestFmt is not None:
             return fnTestFmt(oCfg);
-        else:
-            return oCfg;
+        return oCfg;
 
     def isTestCfgBlacklisted(self, asTestCfg):
@@ -375,5 +374,5 @@
 
         asTestCfg = self.advanceTestCfg();
-        while len(asTestCfg) > 0 and self.isTestCfgBlacklisted(asTestCfg):
+        while asTestCfg and self.isTestCfgBlacklisted(asTestCfg):
             asTestCfg = self.advanceTestCfg();
 
@@ -381,5 +380,5 @@
         # categories.
         reporter.testDone(fSkippedLast);
-        if len(asTestCfg) > 0:
+        if asTestCfg:
             idxSame = 0;
             while asTestCfgCur[idxSame] == asTestCfg[idxSame]:
@@ -832,15 +831,14 @@
             if fHardDisk:
                 return ('ahci', False);
-            else:
-                return ('ahci', True);
-        elif eStorageCtrl == vboxcon.StorageControllerType_PIIX4:
+            return ('ahci', True);
+        if eStorageCtrl == vboxcon.StorageControllerType_PIIX4:
             return ('piix3ide', False);
-        elif eStorageCtrl == vboxcon.StorageControllerType_LsiLogicSas:
+        if eStorageCtrl == vboxcon.StorageControllerType_LsiLogicSas:
             return ('lsilogicsas', True);
-        elif eStorageCtrl == vboxcon.StorageControllerType_LsiLogic:
+        if eStorageCtrl == vboxcon.StorageControllerType_LsiLogic:
             return ('lsilogicscsi', True);
-        elif eStorageCtrl == vboxcon.StorageControllerType_BusLogic:
+        if eStorageCtrl == vboxcon.StorageControllerType_BusLogic:
             return ('buslogic', True);
-        elif eStorageCtrl == vboxcon.StorageControllerType_NVMe:
+        if eStorageCtrl == vboxcon.StorageControllerType_NVMe:
             return ('nvme', False);
 
@@ -854,9 +852,9 @@
         # Check whether the disk variant is supported by the selected format.
         asVariants = self.getDiskFormatVariantsForTesting(asTestCfg[self.kiDiskFmt], [ asTestCfg[self.kiDiskVar] ]);
-        if len(asVariants) == 0:
+        if not asVariants:
             return False;
 
         # For iSCSI check whether we have targets configured.
-        if asTestCfg[self.kiDiskFmt] == 'iSCSI' and len(self.asIscsiTargets) == 0:
+        if asTestCfg[self.kiDiskFmt] == 'iSCSI' and not self.asIscsiTargets:
             return False;
 
@@ -879,6 +877,5 @@
         if cCpus == 1:
             return '1 cpu';
-        else:
-            return '%u cpus' % (cCpus);
+        return '%u cpus' % (cCpus);
 
     def fnFormatVirtMode(self, sVirtMode):
@@ -1172,5 +1169,5 @@
         fRc = True;
         asTestCfg = oTstCfgMgr.getCurrentTestCfg();
-        while len(asTestCfg) > 0:
+        while asTestCfg:
             fRc = self.testOneCfg(asTestCfg[self.kiVmName], self.getStorageCtrlFromName(asTestCfg[self.kiStorageCtrl]), \
                                   asTestCfg[self.kiHostIoCache], asTestCfg[self.kiDiskFmt], asTestCfg[self.kiDiskVar],
Index: /trunk/src/VBox/ValidationKit/tests/teleportation/tdTeleportLocal1.py
===================================================================
--- /trunk/src/VBox/ValidationKit/tests/teleportation/tdTeleportLocal1.py	(revision 65962)
+++ /trunk/src/VBox/ValidationKit/tests/teleportation/tdTeleportLocal1.py	(revision 65963)
@@ -115,5 +115,5 @@
             iArg += 1;
             if iArg >= len(asArgs): raise base.InvalidOption('The "--test-vms" takes colon separated list');
-            if len(asArgs[iArg]) > 0:
+            if asArgs[iArg]:
                 self.asTestVMs = asArgs[iArg].split(':');
                 for s in self.asTestVMs:
Index: /trunk/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py
===================================================================
--- /trunk/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py	(revision 65962)
+++ /trunk/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py	(revision 65963)
@@ -346,5 +346,5 @@
                 sPathName = 'Path';
             sPath = os.environ.get(sPathName, '.');
-            if len(sPath) > 0 and sPath[-1] != ';':
+            if sPath and sPath[-1] != ';':
                 sPath += ';';
             os.environ[sPathName] = sPath + self.sVBoxInstallRoot + ';';
@@ -463,5 +463,5 @@
                     try:    aiValue = [int(sComp) for sComp in sValue.replace('r', '.').split('.')];
                     except: aiValue = ();
-                    if len(aiValue) == 0 or len(aiValue) > 4:
+                    if not aiValue or len(aiValue) > 4:
                         reporter.error('Invalid exclusion expression for %s: "%s" [%s]' % (sTest, sSubExpr, dExclList[sTest]));
                         return True;
Index: /trunk/src/VBox/ValidationKit/tests/usb/usbgadget.py
===================================================================
--- /trunk/src/VBox/ValidationKit/tests/usb/usbgadget.py	(revision 65962)
+++ /trunk/src/VBox/ValidationKit/tests/usb/usbgadget.py	(revision 65963)
@@ -349,5 +349,5 @@
                                        ord(sOpcode[6]), \
                                        ord(sOpcode[7]) ) ) );
-            if len(abPayload) > 0:
+            if abPayload:
                 abMsg.extend(abPayload);
         except:
@@ -374,5 +374,5 @@
 
         # Read the header.
-        if len(self.abReadAheadHdr) > 0:
+        if self.abReadAheadHdr:
             assert(len(self.abReadAheadHdr) == 16);
             abHdr = self.abReadAheadHdr;
@@ -1165,5 +1165,5 @@
                 self.oSocket.setblocking(0);    # just in case it's not set.
                 sData = "1";
-                while len(sData) > 0:
+                while sData:
                     sData = self.oSocket.recv(16384);
             except:
@@ -1181,5 +1181,5 @@
         self.oCv.release();
 
-    def sendBytes(self, abMsg, cMsTimeout):
+    def sendBytes(self, abBuf, cMsTimeout):
         if self.oSocket is None:
             reporter.error('TransportTcp.sendBytes: No connection.');
@@ -1188,10 +1188,10 @@
         # Try send it all.
         try:
-            cbSent = self.oSocket.send(abMsg);
-            if cbSent == len(abMsg):
+            cbSent = self.oSocket.send(abBuf);
+            if cbSent == len(abBuf):
                 return True;
         except Exception, oXcpt:
             if not self.__isWouldBlockXcpt(oXcpt):
-                reporter.errorXcpt('TranportTcp.sendBytes: %s bytes' % (len(abMsg)));
+                reporter.errorXcpt('TranportTcp.sendBytes: %s bytes' % (len(abBuf)));
                 return False;
             cbSent = 0;
@@ -1202,5 +1202,5 @@
             cMsElapsed = base.timestampMilli() - msStart;
             if cMsElapsed > cMsTimeout:
-                reporter.error('TranportTcp.sendBytes: %s bytes timed out (1)' % (len(abMsg)));
+                reporter.error('TranportTcp.sendBytes: %s bytes timed out (1)' % (len(abBuf)));
                 break;
 
@@ -1208,9 +1208,9 @@
             try:
                 ttRc = select.select([], [self.oSocket], [self.oSocket], (cMsTimeout - cMsElapsed) / 1000.0);
-                if len(ttRc[2]) > 0 and len(ttRc[1]) == 0:
+                if ttRc[2] and not ttRc[1]:
                     reporter.error('TranportTcp.sendBytes: select returned with exception');
                     break;
-                if len(ttRc[1]) == 0:
-                    reporter.error('TranportTcp.sendBytes: %s bytes timed out (2)' % (len(abMsg)));
+                if not ttRc[1]:
+                    reporter.error('TranportTcp.sendBytes: %s bytes timed out (2)' % (len(abBuf)));
                     break;
             except:
@@ -1220,10 +1220,10 @@
             # Try send more.
             try:
-                cbSent += self.oSocket.send(abMsg[cbSent:]);
-                if cbSent == len(abMsg):
+                cbSent += self.oSocket.send(abBuf[cbSent:]);
+                if cbSent == len(abBuf):
                     return True;
             except Exception, oXcpt:
                 if not self.__isWouldBlockXcpt(oXcpt):
-                    reporter.errorXcpt('TranportTcp.sendBytes: %s bytes' % (len(abMsg)));
+                    reporter.errorXcpt('TranportTcp.sendBytes: %s bytes' % (len(abBuf)));
                     break;
 
@@ -1246,5 +1246,5 @@
             try:
                 abBuf = self.oSocket.recv(cb - len(self.abReadAhead));
-                if len(abBuf) > 0:
+                if abBuf:
                     self.abReadAhead.extend(array.array('B', abBuf));
             except Exception, oXcpt:
@@ -1261,5 +1261,5 @@
             cMsElapsed = base.timestampMilli() - msStart;
             if cMsElapsed > cMsTimeout:
-                if not fNoDataOk or len(self.abReadAhead) > 0:
+                if not fNoDataOk or self.abReadAhead:
                     reporter.error('TranportTcp.recvBytes: %s/%s bytes timed out (1)' % (len(self.abReadAhead), cb));
                 break;
@@ -1268,9 +1268,9 @@
             try:
                 ttRc = select.select([self.oSocket], [], [self.oSocket], (cMsTimeout - cMsElapsed) / 1000.0);
-                if len(ttRc[2]) > 0 and len(ttRc[0]) == 0:
+                if ttRc[2] and not ttRc[0]:
                     reporter.error('TranportTcp.recvBytes: select returned with exception');
                     break;
-                if len(ttRc[0]) == 0:
-                    if not fNoDataOk or len(self.abReadAhead) > 0:
+                if not ttRc[0]:
+                    if not fNoDataOk or self.abReadAhead:
                         reporter.error('TranportTcp.recvBytes: %s/%s bytes timed out (2) fNoDataOk=%s'
                                        % (len(self.abReadAhead), cb, fNoDataOk));
@@ -1283,5 +1283,5 @@
             try:
                 abBuf = self.oSocket.recv(cb - len(self.abReadAhead));
-                if len(abBuf) == 0:
+                if not abBuf:
                     reporter.error('TranportTcp.recvBytes: %s/%s bytes (%s) - connection has been shut down'
                                    % (len(self.abReadAhead), cb, fNoDataOk));
@@ -1294,5 +1294,5 @@
                 reporter.log('recv => exception %s' % (oXcpt,));
                 if not self.__isWouldBlockXcpt(oXcpt):
-                    if not fNoDataOk  or  not self.__isConnectionReset(oXcpt)  or  len(self.abReadAhead) > 0:
+                    if not fNoDataOk  or  not self.__isConnectionReset(oXcpt)  or  self.abReadAhead:
                         reporter.errorXcpt('TranportTcp.recvBytes: %s/%s bytes (%s)' % (len(self.abReadAhead), cb, fNoDataOk));
                     break;
@@ -1310,5 +1310,5 @@
         try:
             ttRc = select.select([], [], [self.oSocket], 0.0);
-            if len(ttRc[2]) > 0:
+            if ttRc[2]:
                 return False;
 
@@ -1321,5 +1321,5 @@
         try:
             ttRc = select.select([self.oSocket], [], [], cMsTimeout / 1000.0);
-            if len(ttRc[0]) == 0:
+            if not ttRc[0]:
                 return False;
         except:
