VirtualBox

Changeset 75375 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Nov 9, 2018 7:09:26 PM (6 years ago)
Author:
vboxsync
Message:

Main: bugref:6598: Fixed pylint notices

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/storage/tdStorageSnapshotMerging1.py

    r75373 r75375  
    3333import os;
    3434import sys;
    35 import uuid;
    3635import zlib;
    3736
     
    123122        # Construct the resource list the first time it's queried.
    124123        if self.asRsrcs is None:
    125             self.asRsrcs = ['5.3/storage/mergeMedium/t-orig.vdi', '5.3/storage/mergeMedium/t-fixed.vdi', '5.3/storage/mergeMedium/t-resized.vdi'];
     124            self.asRsrcs = ['5.3/storage/mergeMedium/t-orig.vdi',
     125                            '5.3/storage/mergeMedium/t-fixed.vdi',
     126                            '5.3/storage/mergeMedium/t-resized.vdi'];
    126127        return self.asRsrcs;
    127128
     
    152153        try:
    153154            oProgressCom = oMedium.resize(cbNewSize);
    154             oProgress = vboxwrappers.ProgressWrapper(oProgressCom, self.oVBoxMgr, self.oVBox.oTstDrv, 'Resize medium %s' % (oMedium.name));
     155            oProgress = vboxwrappers.ProgressWrapper(oProgressCom, self.oVBoxMgr, self.oVBox.oTstDrv,
     156                                                     'Resize medium %s' % (oMedium.name));
    155157            oProgress.wait(cMsTimeout = 60 * 1000);
    156158            oProgress.logResult();
     
    228230        try:
    229231            oProgressCom = oSrcHd.cloneTo(oTgtHd, (vboxcon.MediumVariant_Standard, ), None);
    230             oProgress = vboxwrappers.ProgressWrapper(oProgressCom, self.oVBoxMgr, self.oVBox.oTstDrv, 'clone base disk %s to %s' % (oSrcHd.name, oTgtHd.name));
     232            oProgress = vboxwrappers.ProgressWrapper(oProgressCom, self.oVBoxMgr, self.oVBox.oTstDrv,
     233                                                     'clone base disk %s to %s' % (oSrcHd.name, oTgtHd.name));
    231234            oProgress.wait(cMsTimeout = 60 * 1000);
    232235            oProgress.logResult();
     
    242245        except:
    243246            reporter.logXcpt();
    244             pass;
    245        
     247
    246248        if self.fpApiVer >= 4.0:
    247249            try:
     
    316318        oHd = oSession.createBaseHd(sHddPath, sFmt=oDskFmt.id, cb=oOrigBaseHd.logicalSize);
    317319        #if oSession.createBaseHd can't create disk because it exists, oHd will point to some stub object anyway
    318         fRc = fRc and oHd is not None and oHd.logicalSize == oOrigBaseHd.logicalSize;
     320        fRc = fRc and oHd is not None and (oHd.logicalSize == oOrigBaseHd.logicalSize);
    319321        fRc = fRc and self.cloneMedium(oOrigBaseHd, oHd);
    320322           
     
    341343                    sResFilePath = os.path.join(self.oVBox.oTstDrv.sScratchPath, 't_res.vmdk');
    342344                    sResFilePathRaw = os.path.join(self.oVBox.oTstDrv.sScratchPath, 't_res-flat.vmdk');
    343                     oResHd = oSession.createBaseHd(sResFilePath, sFmt='VMDK', cb=oOrigWithDiffHd.logicalSize, tMediumVariant = (vboxcon.MediumVariant_Fixed, ));
     345                    oResHd = oSession.createBaseHd(sResFilePath, sFmt='VMDK', cb=oOrigWithDiffHd.logicalSize,
     346                                                   tMediumVariant = (vboxcon.MediumVariant_Fixed, ));
    344347                    fRc = oResHd is not None;
    345348                    fRc = fRc and self.cloneMedium(oHd, oResHd);
    346                    
     349
    347350                    uResCrc32 = 0;
    348351                    if fRc:
    349352                        uResCrc32 = crc32_of_file(sResFilePathRaw);
    350353                        if uResCrc32 == uOrigCrc:
    351                             reporter.log('Snapshot merged successfully. Data of the result medium are correspond to data of the original medium');
     354                            reporter.log('Snapshot merged successfully. Crc32 is correct');
    352355                            fRc = True;
    353356                        else:
    354                             reporter.error('Snapshot merging failed. Data of the result medium not correspond to data of the original medium');
     357                            reporter.error('Snapshot merging failed. Crc32 is invalid');
    355358                            fRc = False;
    356                    
     359
    357360                    self.oVBox.deleteHdByMedium(oResHd);
    358361
     
    360363            if oHd is not None:
    361364                oSession.detachHd(sController, iPort = 0, iDevice = 0);
    362                
     365
    363366            oSession.saveSettings(fClose = True);
    364367            if oHd is not None:
    365368                self.oVBox.deleteHdByMedium(oHd);
    366        
     369
    367370        self.deleteVM(oVM);
    368371        return fRc;
     
    374377        if not self.importVBoxApi():
    375378            return False;
    376        
     379
    377380        sVmName = 'testvm';
    378381        reporter.testStart(sVmName);
     
    381384        if aoDskFmts is None or len(aoDskFmts) < 1:
    382385            return False;
    383        
     386
    384387        fRc = True;
    385388        for sStorageCtrl in self.asStorageCtrls:
     
    397400            else:
    398401                eStorageCtrl = None;
    399            
     402
    400403            for oDskFmt in aoDskFmts:
    401                 if (oDskFmt.id in self.asDiskFormats):
     404                if oDskFmt.id in self.asDiskFormats:
    402405                    reporter.testStart('%s' % (oDskFmt.id));
    403406                    fRc = self.test1OneCfg(eStorageCtrl, oDskFmt);
     
    405408                    if not fRc:
    406409                        break;
    407        
     410
    408411            reporter.testDone();
    409412            if not fRc:
    410413                break;
    411        
     414
    412415        reporter.testDone();
    413416        return fRc;
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