Changeset 87224 in vbox for trunk/src/VBox
- Timestamp:
- Jan 12, 2021 11:03:22 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/autostart/tdAutostart1.py
r87216 r87224 4 4 Autostart testcase using. 5 5 """ 6 #from pykickstart.commands import repo 6 7 7 __copyright__ = \ 8 8 """ … … 102 102 self.fPae = fPae; 103 103 self.sGuestAdditionsIso = sGuestAdditionsIso; 104 self._asTestBuildDirs = [];105 self. sTestBuild = None;106 self. sVBoxInstaller = "";104 self._asTestBuildDirs = oTstDrv.asTestBuildDirs; 105 self._sTestBuild = None; 106 self._sVBoxInstaller = ""; 107 107 self.asVirtModesSup = ['hwvirt-np',]; 108 108 self.asParavirtModesSup = ['default',]; … … 115 115 def asTestBuildDirs(self, value): 116 116 self._asTestBuildDirs = value; 117 self.sTestBuild = self._findFile(self. sVBoxInstaller, value);117 self.sTestBuild = self._findFile(self._sVBoxInstaller, value); 118 118 if not self.sTestBuild: 119 119 raise base.GenError("VirtualBox install package not found"); 120 121 @property 122 def sTestBuild(self): 123 return self._sTestBuild; 124 125 @sTestBuild.setter 126 def sTestBuild(self, value): 127 if not os.path.exists(value): 128 raise base.GenError("The %s does not exist" % (value,)); 129 self._sTestBuild = value; 120 130 121 131 def _findFile(self, sRegExp, asTestBuildDirs): … … 664 674 tdAutostartOs.__init__(self, oSet, oTstDrv, sVmName, sKind, sHdd, eNic0Type, cMbRam, \ 665 675 cCpus, fPae, sGuestAdditionsIso); 666 self. sVBoxInstaller = '^VirtualBox-.*\\.run$';676 self._sVBoxInstaller = '^VirtualBox-.*\\.run$'; 667 677 return; 668 678 … … 937 947 tdAutostartOs.__init__(self, oSet, oTstDrv, sVmName, sKind, sHdd, eNic0Type, cMbRam, \ 938 948 cCpus, fPae, sGuestAdditionsIso); 939 self. sVBoxInstaller = '^VirtualBox-.*\\.(exe|msi)$';949 self._sVBoxInstaller = '^VirtualBox-.*\\.(exe|msi)$'; 940 950 return; 941 951 … … 1285 1295 ksOsSolaris = 'tst-solaris' 1286 1296 ksOsFreeBSD = 'tst-freebsd' 1297 1287 1298 def __init__(self): 1288 1299 vbox.TestDriver.__init__(self); … … 1293 1304 ## @todo r=bird: The --test-build-dirs option as primary way to get the installation files to test 1294 1305 ## is not an acceptable test practice as we don't know wtf you're testing. See defect for more. 1295 self.asTestBuildDirs = None; #'D:/AlexD/TestBox/TestAdditionalFiles';1306 self.asTestBuildDirs = os.path.join(self.sScratchPath, 'bin'); 1296 1307 self.sGuestAdditionsIso = None; #'D:/AlexD/TestBox/TestAdditionalFiles/VBoxGuestAdditions_6.1.2.iso'; 1297 oSet = vboxtestvms.TestVmSet(self.oTestVmManager, acCpus = [2], fIgnoreSkippedVm = True);1308 oSet = vboxtestvms.TestVmSet(self.oTestVmManager, acCpus = [2], asVirtModes = ['hwvirt-np',], fIgnoreSkippedVm = True); 1298 1309 # pylint: disable=line-too-long 1299 oSet.aoTestVms.extend([1300 tdAutostartOsWin(oSet, self, self.ksOsWindows, 'Windows7_64', \1310 self.asTestVmClasses = { 1311 'win' : tdAutostartOsWin(oSet, self, self.ksOsWindows, 'Windows7_64', \ 1301 1312 '6.0/windows7piglit/windows7piglit.vdi', eNic0Type = None, cMbRam = 2048, \ 1302 1313 cCpus = 2, fPae = True, sGuestAdditionsIso = self.getGuestAdditionsIso()), 1303 tdAutostartOsLinux(oSet, self, self.ksOsLinux, 'Ubuntu_64', \1314 'linux' : tdAutostartOsLinux(oSet, self, self.ksOsLinux, 'Ubuntu_64', \ 1304 1315 '6.0/ub1804piglit/ub1804piglit.vdi', eNic0Type = None, \ 1305 cMbRam = 2048, cCpus = 2, fPae = None, sGuestAdditionsIso = self.getGuestAdditionsIso()) 1306 ]); 1316 cMbRam = 2048, cCpus = 2, fPae = None, sGuestAdditionsIso = self.getGuestAdditionsIso()), 1317 'solaris' : None, #'tdAutostartOsSolaris', 1318 'darwin' : None #'tdAutostartOsDarwin' 1319 }; 1320 oSet.aoTestVms.extend([oTestVm for oTestVm in self.asTestVmClasses.values() if oTestVm is not None]); 1321 sOs = self.getBuildOs(); 1322 if sOs in self.asTestVmClasses.keys(): 1323 for oTestVM in oSet.aoTestVms: 1324 if oTestVM is not None: 1325 oTestVM.fSkip = oTestVM != self.asTestVmClasses[sOs]; 1326 1307 1327 # pylint: enable=line-too-long 1308 1328 self.oTestVmSet = oSet; … … 1317 1337 reporter.log('tdAutostart Options:'); 1318 1338 reporter.log(' --test-build-dirs <path1[,path2[,...]]>'); 1319 reporter.log(' The list of directories with VirtualBox distros. The option is mandatory'); 1320 reporter.log(' without any default value. The test raises an exception if the'); 1321 reporter.log(' option is not specified. At least, one directory should be pointed.'); 1339 reporter.log(' The list of directories with VirtualBox distros. Overrides default path.'); 1340 reporter.log(' Default path is $TESTBOX_SCRATCH_PATH/bin.'); 1341 reporter.log(' --vbox-<os>-build <path>'); 1342 reporter.log(' The path to vbox build for the specified OS.'); 1343 reporter.log(' The OS can be one of "win", "linux", "solaris" and "darwin".'); 1344 reporter.log(' This option alse enables corresponding VM for testing.'); 1345 reporter.log(' (Default behaviour is testing only VM having host-like OS.)'); 1322 1346 return rc; 1323 1347 … … 1325 1349 if asArgs[iArg] == '--test-build-dirs': 1326 1350 iArg += 1; 1327 if iArg >= len(asArgs): raise base.InvalidOption('The "--test-build-dirs" takes a path sargument');1351 if iArg >= len(asArgs): raise base.InvalidOption('The "--test-build-dirs" takes a path argument'); 1328 1352 self.asTestBuildDirs = asArgs[iArg].split(','); 1329 1353 for oTestVm in self.oTestVmSet.aoTestVms: 1330 1354 oTestVm.asTestBuildDirs = self.asTestBuildDirs; 1355 elif asArgs[iArg] in [ '--vbox-%s-build' % os for os in self.asTestVmClasses.keys()]: 1356 iArg += 1; 1357 if iArg >= len(asArgs): raise base.InvalidOption('The "%s" take a path argument' % (asArgs[iArg - 1],)); 1358 oMatch = re.match("--vbox-([^-]+)-build", asArgs[iArg - 1]); 1359 if oMatch is not None: 1360 sOs = oMatch.group(1); 1361 oTestVm = self.asTestVmClasses.get(sOs); 1362 if oTestVm is not None: 1363 oTestVm.sTestBuild = asArgs[iArg]; 1364 oTestVm.fSkip = False; 1331 1365 else: 1332 1366 return vbox.TestDriver.parseOption(self, asArgs, iArg); 1333 1367 return iArg + 1; 1334 1335 def completeOptions(self):1336 # Remove skipped VMs from the test list.1337 if self.asTestBuildDirs is None:1338 raise base.InvalidOption('--test-build-dirs is not specified')1339 for sVM in self.asSkipVMs:1340 try: self.asTestVMs.remove(sVM);1341 except: pass;1342 return vbox.TestDriver.completeOptions(self);1343 1368 1344 1369 def actionConfig(self):
Note:
See TracChangeset
for help on using the changeset viewer.