VirtualBox

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


Ignore:
Timestamp:
Feb 10, 2021 12:09:44 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
142720
Message:

Main: bugref:9224: Testcase: fixed pylint issues

File:
1 edited

Legend:

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

    r87674 r87678  
    984984                # pylint: disable=no-init
    985985                class ParseState(object):
    986                     Nothing   = 0;
    987                     Drive     = 1;
    988                     Partition = 2;
    989 
    990                 iParseState = ParseState.Nothing;
     986                    kiNothing   = 0;
     987                    kikDrive    = 1;
     988                    kiPartition = 2;
     989
     990                iParseState = ParseState.kiNothing;
    991991                asKeysNotFound = asHddData['Header'].keys();
    992992                idxPartition = 0;
     
    10031003                                break;
    10041004                            sDrive = sValue;
    1005                             iParseState = ParseState.Drive;
     1005                            iParseState = ParseState.kiDrive;
    10061006                            asKeysNotFound = asKeysNotFound = asHddData['Header'].keys();
    10071007                            idxPartition = 0;
    10081008                            continue;
    1009                     if iParseState == ParseState.Drive:
     1009                    if iParseState == ParseState.kiDrive:
    10101010                        if sLine.strip().startswith('Partitions:'):
    1011                             iParseState = ParseState.Partition;
     1011                            iParseState = ParseState.kiPartition;
    10121012                            continue;
    10131013                        if oMatch is None or sKey is None:
     
    10161016                            asKeysNotFound.remove(sKey);
    10171017                        continue;
    1018                     if iParseState == ParseState.Partition:
     1018                    if iParseState == ParseState.kiPartition:
    10191019                        if idxPartition < len(asHddData['Partitions']['Partitions']):
    10201020                            sPart = asHddData['Partitions']['Partitions'][idxPartition];
     
    10481048        # pylint: disable=no-init
    10491049        class DescriptorParseState(object):
    1050             Header   = 1;
    1051             Extent   = 2;
    1052             Database = 3;
     1050            kiHeader   = 1;
     1051            kiExtent   = 2;
     1052            kiDatabase = 3;
    10531053
    10541054        asHddData = self.asHdds[sHdd];
    1055         iParseState = DescriptorParseState.Header;
     1055        iParseState = DescriptorParseState.kiHeader;
    10561056
    10571057        asHeader = { 'version'    : '1',
     
    10761076                continue;
    10771077
    1078             if iParseState == DescriptorParseState.Header:
     1078            if iParseState == DescriptorParseState.kiHeader:
    10791079                if sLine.startswith('ddb.'):
    10801080                    return reporter.error("VMDK descriptor has invalid order of sections");
     
    10821082                   or sLine.startswith("RDONLY") \
    10831083                   or sLine.startswith("NOACCESS"):
    1084                     iParseState = DescriptorParseState.Extent;
     1084                    iParseState = DescriptorParseState.kiExtent;
    10851085                else:
    10861086                    oMatch = oRegExp.match(sLine);
     
    10981098                    continue;
    10991099
    1100             if iParseState == DescriptorParseState.Extent:
     1100            if iParseState == DescriptorParseState.kiExtent:
    11011101                if sLine.startswith('ddb.'):
    1102                     iParseState = DescriptorParseState.Database;
     1102                    iParseState = DescriptorParseState.kiDatabase;
    11031103                else:
    11041104                    if     not sLine.startswith("RW")     \
     
    11171117                    continue;
    11181118
    1119             if iParseState == DescriptorParseState.Database:
     1119            if iParseState == DescriptorParseState.kiDatabase:
    11201120                if not sLine.startswith('ddb.'):
    11211121                    return reporter.error("VMDK descriptor has invalid order of sections");
     
    11311131                    return reporter.error("VMDK descriptor has value which was not expected");
    11321132                continue;
    1133         return iParseState == DescriptorParseState.Database;
     1133        return iParseState == DescriptorParseState.kiDatabase;
    11341134
    11351135    def _setPermissionsToVmdkFiles(self, oGuestSession):
     
    11521152        asHddData = self.asHdds[sHdd];
    11531153        fRc = True;
    1154         try:    oGuestSession.directoryCreate(self.sVMDKPath, 0777, (vboxcon.DirectoryCreateFlag_Parents,));
     1154        try:    oGuestSession.directoryCreate(self.sVMDKPath, 777, (vboxcon.DirectoryCreateFlag_Parents,));
    11551155        except: fRc = reporter.errorXcpt('Create directory for VMDK files failed in the VM %s' % (self.sVmName));
    11561156        if fRc:
     
    15551555    ksOsSolaris = 'tst-solaris';
    15561556    ksOsFreeBSD = 'tst-freebsd';
    1557     BootSectorPath = '6.1/storage/t-bootsector.bin';
    1558     asHdds = ['6.1/storage/t-gpt.vdi', '6.1/storage/t-mbr.vdi'];
     1557    ksBootSectorPath = '6.1/storage/t-bootsector.bin';
     1558    kasHdds = ['6.1/storage/t-gpt.vdi', '6.1/storage/t-mbr.vdi'];
    15591559
    15601560    def __init__(self):
     
    15721572                             '6.0/windows7piglit/windows7piglit.vdi', eNic0Type = None, cMbRam = 2048,  \
    15731573                             cCpus = 2, fPae = True, sGuestAdditionsIso = self.getGuestAdditionsIso(),
    1574                              sBootSector = self.BootSectorPath),
     1574                             sBootSector = self.ksBootSectorPath),
    15751575            'linux'   : tdStorageRawDriveOsLinux(oSet, self, self.ksOsLinux, 'Ubuntu_64', \
    15761576                               '6.0/ub1804piglit/ub1804piglit.vdi', eNic0Type = None, \
    15771577                               cMbRam = 2048, cCpus = 2, fPae = None, sGuestAdditionsIso = self.getGuestAdditionsIso(),
    1578                                sBootSector = self.BootSectorPath),
     1578                               sBootSector = self.ksBootSectorPath),
    15791579            'solaris' : None, #'tdAutostartOsSolaris',
    15801580            'darwin'  : None  #'tdAutostartOsDarwin'
     
    16291629
    16301630    def getResourceSet(self):
    1631         asRsrcs = self.asHdds[:];
    1632         asRsrcs.extend([self.BootSectorPath,]);
     1631        asRsrcs = self.kasHdds[:];
     1632        asRsrcs.extend([self.ksBootSectorPath,]);
    16331633        asRsrcs.extend(vbox.TestDriver.getResourceSet(self));
    16341634        return asRsrcs;
     
    16521652        self.logVmInfo(oVM);
    16531653
    1654         for sHdd in self.asHdds:
     1654        for sHdd in self.kasHdds:
    16551655            reporter.testStart('%s with %s disk' % ( oTestVm.sVmName, sHdd))
    1656             fRc = oTestVm.reattachHdd(oVM, sHdd, self.asHdds);
     1656            fRc = oTestVm.reattachHdd(oVM, sHdd, self.kasHdds);
    16571657            if fRc:
    16581658                oSession = self.startVmByName(oTestVm.sVmName);
Note: See TracChangeset for help on using the changeset viewer.

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