Changeset 87678 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Feb 10, 2021 12:09:44 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 142720
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/storage/tdStorageRawDrive1.py
r87674 r87678 984 984 # pylint: disable=no-init 985 985 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; 991 991 asKeysNotFound = asHddData['Header'].keys(); 992 992 idxPartition = 0; … … 1003 1003 break; 1004 1004 sDrive = sValue; 1005 iParseState = ParseState. Drive;1005 iParseState = ParseState.kiDrive; 1006 1006 asKeysNotFound = asKeysNotFound = asHddData['Header'].keys(); 1007 1007 idxPartition = 0; 1008 1008 continue; 1009 if iParseState == ParseState. Drive:1009 if iParseState == ParseState.kiDrive: 1010 1010 if sLine.strip().startswith('Partitions:'): 1011 iParseState = ParseState. Partition;1011 iParseState = ParseState.kiPartition; 1012 1012 continue; 1013 1013 if oMatch is None or sKey is None: … … 1016 1016 asKeysNotFound.remove(sKey); 1017 1017 continue; 1018 if iParseState == ParseState. Partition:1018 if iParseState == ParseState.kiPartition: 1019 1019 if idxPartition < len(asHddData['Partitions']['Partitions']): 1020 1020 sPart = asHddData['Partitions']['Partitions'][idxPartition]; … … 1048 1048 # pylint: disable=no-init 1049 1049 class DescriptorParseState(object): 1050 Header = 1;1051 Extent = 2;1052 Database = 3;1050 kiHeader = 1; 1051 kiExtent = 2; 1052 kiDatabase = 3; 1053 1053 1054 1054 asHddData = self.asHdds[sHdd]; 1055 iParseState = DescriptorParseState. Header;1055 iParseState = DescriptorParseState.kiHeader; 1056 1056 1057 1057 asHeader = { 'version' : '1', … … 1076 1076 continue; 1077 1077 1078 if iParseState == DescriptorParseState. Header:1078 if iParseState == DescriptorParseState.kiHeader: 1079 1079 if sLine.startswith('ddb.'): 1080 1080 return reporter.error("VMDK descriptor has invalid order of sections"); … … 1082 1082 or sLine.startswith("RDONLY") \ 1083 1083 or sLine.startswith("NOACCESS"): 1084 iParseState = DescriptorParseState. Extent;1084 iParseState = DescriptorParseState.kiExtent; 1085 1085 else: 1086 1086 oMatch = oRegExp.match(sLine); … … 1098 1098 continue; 1099 1099 1100 if iParseState == DescriptorParseState. Extent:1100 if iParseState == DescriptorParseState.kiExtent: 1101 1101 if sLine.startswith('ddb.'): 1102 iParseState = DescriptorParseState. Database;1102 iParseState = DescriptorParseState.kiDatabase; 1103 1103 else: 1104 1104 if not sLine.startswith("RW") \ … … 1117 1117 continue; 1118 1118 1119 if iParseState == DescriptorParseState. Database:1119 if iParseState == DescriptorParseState.kiDatabase: 1120 1120 if not sLine.startswith('ddb.'): 1121 1121 return reporter.error("VMDK descriptor has invalid order of sections"); … … 1131 1131 return reporter.error("VMDK descriptor has value which was not expected"); 1132 1132 continue; 1133 return iParseState == DescriptorParseState. Database;1133 return iParseState == DescriptorParseState.kiDatabase; 1134 1134 1135 1135 def _setPermissionsToVmdkFiles(self, oGuestSession): … … 1152 1152 asHddData = self.asHdds[sHdd]; 1153 1153 fRc = True; 1154 try: oGuestSession.directoryCreate(self.sVMDKPath, 0777, (vboxcon.DirectoryCreateFlag_Parents,));1154 try: oGuestSession.directoryCreate(self.sVMDKPath, 777, (vboxcon.DirectoryCreateFlag_Parents,)); 1155 1155 except: fRc = reporter.errorXcpt('Create directory for VMDK files failed in the VM %s' % (self.sVmName)); 1156 1156 if fRc: … … 1555 1555 ksOsSolaris = 'tst-solaris'; 1556 1556 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']; 1559 1559 1560 1560 def __init__(self): … … 1572 1572 '6.0/windows7piglit/windows7piglit.vdi', eNic0Type = None, cMbRam = 2048, \ 1573 1573 cCpus = 2, fPae = True, sGuestAdditionsIso = self.getGuestAdditionsIso(), 1574 sBootSector = self. BootSectorPath),1574 sBootSector = self.ksBootSectorPath), 1575 1575 'linux' : tdStorageRawDriveOsLinux(oSet, self, self.ksOsLinux, 'Ubuntu_64', \ 1576 1576 '6.0/ub1804piglit/ub1804piglit.vdi', eNic0Type = None, \ 1577 1577 cMbRam = 2048, cCpus = 2, fPae = None, sGuestAdditionsIso = self.getGuestAdditionsIso(), 1578 sBootSector = self. BootSectorPath),1578 sBootSector = self.ksBootSectorPath), 1579 1579 'solaris' : None, #'tdAutostartOsSolaris', 1580 1580 'darwin' : None #'tdAutostartOsDarwin' … … 1629 1629 1630 1630 def getResourceSet(self): 1631 asRsrcs = self. asHdds[:];1632 asRsrcs.extend([self. BootSectorPath,]);1631 asRsrcs = self.kasHdds[:]; 1632 asRsrcs.extend([self.ksBootSectorPath,]); 1633 1633 asRsrcs.extend(vbox.TestDriver.getResourceSet(self)); 1634 1634 return asRsrcs; … … 1652 1652 self.logVmInfo(oVM); 1653 1653 1654 for sHdd in self. asHdds:1654 for sHdd in self.kasHdds: 1655 1655 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); 1657 1657 if fRc: 1658 1658 oSession = self.startVmByName(oTestVm.sVmName);
Note:
See TracChangeset
for help on using the changeset viewer.