Changeset 79067 in vbox
- Timestamp:
- Jun 10, 2019 10:56:46 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 131227
- Location:
- trunk/src/VBox/ValidationKit
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/Config.kmk
r79019 r79067 166 166 # 167 167 if1of ($(KBUILD_TARGET), win os2) 168 VBOX_PYTHONPATH_VALIDATIONKIT = $(PYTHONPATH);$(VBOX_PATH_VALIDATIONKIT_SRC);$(VBOX_PATH_VALIDATIONKIT_SRC)/testboxscript;$(VBOX_PATH_VALIDATIONKIT_SRC)/testmanager :$(VBOX_PATH_VALIDATIONKIT_SRC)/../VMM/VMMAll168 VBOX_PYTHONPATH_VALIDATIONKIT = $(PYTHONPATH);$(VBOX_PATH_VALIDATIONKIT_SRC);$(VBOX_PATH_VALIDATIONKIT_SRC)/testboxscript;$(VBOX_PATH_VALIDATIONKIT_SRC)/testmanager;$(VBOX_PATH_VALIDATIONKIT_SRC)/tests/additions;$(VBOX_PATH_VALIDATIONKIT_SRC)/../VMM/VMMAll 169 169 else 170 VBOX_PYTHONPATH_VALIDATIONKIT = $(PYTHONPATH):$(VBOX_PATH_VALIDATIONKIT_SRC):$(VBOX_PATH_VALIDATIONKIT_SRC)/testboxscript:$(VBOX_PATH_VALIDATIONKIT_SRC)/testmanager ;$(VBOX_PATH_VALIDATIONKIT_SRC)/../VMM/VMMAll170 VBOX_PYTHONPATH_VALIDATIONKIT = $(PYTHONPATH):$(VBOX_PATH_VALIDATIONKIT_SRC):$(VBOX_PATH_VALIDATIONKIT_SRC)/testboxscript:$(VBOX_PATH_VALIDATIONKIT_SRC)/testmanager:$(VBOX_PATH_VALIDATIONKIT_SRC)/tests/additions:$(VBOX_PATH_VALIDATIONKIT_SRC)/../VMM/VMMAll 171 171 endif 172 172 BLDDIRS += $(PATH_TARGET)/pylint $(PATH_TARGET)/pyunittest -
trunk/src/VBox/ValidationKit/testdriver/base.py
r78973 r79067 741 741 """ 742 742 743 def __init__(self, sName, oTstDrv): 744 self.sName = sName; 745 self.oTstDrv = oTstDrv # type: TestDriverBase 746 self.asRsrcs = []; 743 def __init__(self, oTstDrv, sName, sTestName): 744 self.oTstDrv = oTstDrv # type: TestDriverBase 745 self.sName = sName; # For use with options (--enable-sub-driver sName:sName2) 746 self.sTestName = sTestName; # More descriptive for passing to reporter.testStart(). 747 self.asRsrcs = [] # type: List(str) 748 self.fEnabled = True; # TestDriverBase --enable-sub-driver and --disable-sub-driver. 747 749 748 750 def showUsage(self): … … 753 755 """ 754 756 reporter.log(''); 755 reporter.log('Options for sub-test driver %s :' % (self.sName,));757 reporter.log('Options for sub-test driver %s (%s):' % (self.sTestName, self.sName,)); 756 758 return True; 757 759 … … 981 983 return iNext; 982 984 return iArgs; 985 986 def findSubTstDrvByShortName(self, sShortName): 987 """ 988 Locates a sub-test driver by it's short name. 989 Returns sub-test driver object reference if found, None if not. 990 """ 991 for oSubTstDrv in self.aoSubTstDrvs: 992 if oSubTstDrv.sName == sShortName: 993 return oSubTstDrv; 994 return None; 983 995 984 996 … … 1320 1332 reporter.log(' Do not wipe clean the scratch area during the two clean up'); 1321 1333 reporter.log(' actions. This is for facilitating nested test driver execution.'); 1334 if self.aoSubTstDrvs: 1335 reporter.log(' --enable-sub-driver <sub1>[:..]'); 1336 reporter.log(' --disable-sub-driver <sub1>[:..]'); 1337 reporter.log(' Enables or disables one or more of the sub drivers: %s' 1338 % (', '.join([oSubTstDrv.sName for oSubTstDrv in self.aoSubTstDrvs]),)); 1322 1339 return True; 1323 1340 … … 1348 1365 elif asArgs[iArg] == '--no-wipe-clean': 1349 1366 self.fNoWipeClean = True; 1367 elif asArgs[iArg] in ('--enable-sub-driver', '--disable-sub-driver') and self.aoSubTstDrvs: 1368 sOption = asArgs[iArg]; 1369 iArg = self.requireMoreArgs(1, asArgs, iArg); 1370 for sSubTstDrvName in asArgs[iArg].split(':'): 1371 oSubTstDrv = self.findSubTstDrvByShortName(sSubTstDrvName); 1372 if oSubTstDrv is None: 1373 raise InvalidOption('Unknown sub-test driver given to %s: %s' % (sOption, sSubTstDrvName,)); 1374 oSubTstDrv.fEnabled = sOption == '--enable-sub-driver'; 1350 1375 elif (asArgs[iArg] == 'all' or asArgs[iArg] in self.asNormalActions) \ 1351 1376 and self.asActions in self.asSpecialActions: -
trunk/src/VBox/ValidationKit/tests/additions/tdAddBasic1.py
r78797 r79067 47 47 from testdriver import vboxcon; 48 48 49 # Sub 49 # Sub-test driver imports. 50 50 sys.path.append(os.path.dirname(os.path.abspath(__file__))); # For sub-test drivers. 51 51 from tdAddGuestCtrl import SubTstDrvAddGuestCtrl; -
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r78636 r79067 944 944 945 945 def __init__(self, oTstDrv): 946 base.SubTestDriverBase.__init__(self, 'add-guest-ctrl', oTstDrv);946 base.SubTestDriverBase.__init__(self, oTstDrv, 'add-guest-ctrl', 'Guest Control'); 947 947 948 948 ## @todo base.TestBase. -
trunk/src/VBox/ValidationKit/tests/additions/tdAddSharedFolders1.py
r78797 r79067 52 52 53 53 def __init__(self, oTstDrv): 54 base.SubTestDriverBase.__init__(self, 'add-shared-folders', oTstDrv);54 base.SubTestDriverBase.__init__(self, oTstDrv, 'add-shared-folders', 'Shared Folders'); 55 55 56 56 self.asTestsDef = [ 'fsperf', ]; -
trunk/src/VBox/ValidationKit/tests/api/tdAppliance1.py
r77777 r79067 54 54 55 55 def __init__(self, oTstDrv): 56 base.SubTestDriverBase.__init__(self, 'appliance', oTstDrv);56 base.SubTestDriverBase.__init__(self, oTstDrv, 'appliance', 'Applicance'); 57 57 58 58 def testIt(self): -
trunk/src/VBox/ValidationKit/tests/api/tdCreateVMWithDefaults1.py
r79066 r79067 53 53 54 54 def __init__(self, oTstDrv): 55 base.SubTestDriverBase.__init__(self, 'create-vm-with-defaults', oTstDrv) 56 self.asRsrcs = [] 55 base.SubTestDriverBase.__init__(self, oTstDrv, 'create-vm-with-defaults', 'Create VMs with defaults'); 57 56 58 57 def testIt(self): … … 61 60 """ 62 61 reporter.log('ValidationKit folder is "%s"' % (g_ksValidationKitDir,)) 63 reporter.testStart( 'Create VMs with defaults');62 reporter.testStart(self.sTestName); 64 63 fRc = self.testCreateVMWithDefaults(); 65 64 reporter.testDone(); -
trunk/src/VBox/ValidationKit/tests/api/tdMoveMedium1.py
r78391 r79067 54 54 55 55 def __init__(self, oTstDrv): 56 base.SubTestDriverBase.__init__(self, 'move-medium', oTstDrv)56 base.SubTestDriverBase.__init__(self, oTstDrv, 'move-medium', 'Move Medium'); 57 57 58 58 def testIt(self): -
trunk/src/VBox/ValidationKit/tests/api/tdMoveVM1.py
r78460 r79067 57 57 58 58 def __init__(self, oTstDrv): 59 base.SubTestDriverBase.__init__(self, 'move-vm', oTstDrv)59 base.SubTestDriverBase.__init__(self, oTstDrv, 'move-vm', 'Move VM'); 60 60 61 61 # Note! Hardcoded indexing in test code further down. … … 80 80 Execute the sub-testcase. 81 81 """ 82 reporter.testStart(self.sTestName); 82 83 reporter.log('ValidationKit folder is "%s"' % (g_ksValidationKitDir,)) 83 return self.testVMMove() 84 fRc = self.testVMMove(); 85 return reporter.testDone(fRc is None)[1] == 0; 84 86 85 87 # … … 562 564 Test machine moving. 563 565 """ 564 reporter.testStart('machine moving')565 566 566 if not self.oTstDrv.importVBoxApi(): 567 567 return False … … 572 572 if fSupported is False: 573 573 reporter.log('API version %s is too old. Just skip this test.' % (self.oTstDrv.fpApiVer)) 574 return reporter.testDone()[1] == 0 575 else: 576 reporter.log('API version is "%s".' % (self.oTstDrv.fpApiVer)) 574 return None; 575 reporter.log('API version is "%s".' % (self.oTstDrv.fpApiVer)) 577 576 578 577 # Scenarios … … 638 637 if fRc is False: 639 638 reporter.testFailure('!!!!!!!!!!!!!!!!!! 1st scenario: Check locations failed... !!!!!!!!!!!!!!!!!!') 640 return reporter.testDone()[1] == 0639 return False; 641 640 else: 642 641 reporter.testFailure('!!!!!!!!!!!!!!!!!! 1st scenario: Move VM failed... !!!!!!!!!!!!!!!!!!') 643 return reporter.testDone()[1] == 0642 return False; 644 643 645 644 fRc = oSession.saveSettings() … … 660 659 fRc = self.__testScenario_2(oSession, oMachine, sNewLoc, sOldLoc) 661 660 if fRc is False: 662 return reporter.testDone()[1] == 0661 return False; 663 662 664 663 # … … 674 673 fRc = self.__testScenario_3(oSession, oMachine, sNewLoc) 675 674 if fRc is False: 676 return reporter.testDone()[1] == 0675 return False; 677 676 678 677 # … … 698 697 fRc = self.__testScenario_4(oMachine, sNewLoc) 699 698 if fRc is False: 700 return reporter.testDone()[1] == 0699 return False; 701 700 702 701 # … … 712 711 fRc = self.__testScenario_5(oMachine, sNewLoc, sOldLoc) 713 712 if fRc is False: 714 return reporter.testDone()[1] == 0713 return False; 715 714 716 715 # … … 726 725 fRc = self.__testScenario_6(oMachine, sNewLoc, sOldLoc) 727 726 if fRc is False: 728 return reporter.testDone()[1] == 0727 return False; 729 728 730 729 # # … … 743 742 reporter.errorXcpt() 744 743 745 return reporter.testDone()[1] == 0744 return fRc; 746 745 747 746 -
trunk/src/VBox/ValidationKit/tests/api/tdPython1.py
r76553 r79067 54 54 55 55 def __init__(self, oTstDrv): 56 base.SubTestDriverBase.__init__(self, 'python-binding', oTstDrv)56 base.SubTestDriverBase.__init__(self, oTstDrv, 'python-binding', 'Python bindings'); 57 57 58 58 def testIt(self): -
trunk/src/VBox/ValidationKit/tests/api/tdTreeDepth1.py
r76553 r79067 53 53 54 54 def __init__(self, oTstDrv): 55 base.SubTestDriverBase.__init__(self, 'tree-depth', oTstDrv)55 base.SubTestDriverBase.__init__(self, oTstDrv, 'tree-depth', 'Media and Snapshot tree depths'); 56 56 57 57 def testIt(self): -
trunk/src/VBox/ValidationKit/tests/installation/tdGuestOsUnattendedInst1.py
r79056 r79067 50 50 from testdriver import vboxtestvms; 51 51 52 # Sub-test driver imports. 53 sys.path.append(os.path.join(g_ksValidationKitDir, 'tests', 'additions')); 54 from tdAddGuestCtrl import SubTstDrvAddGuestCtrl; 55 from tdAddSharedFolders1 import SubTstDrvAddSharedFolders1; 56 52 57 53 58 class UnattendedVm(vboxtestvms.BaseTestVm): … … 64 69 kasIdeIrqDelay = [ 'VBoxInternal/Devices/piix3ide/0/Config/IRQDelay:1', ]; 65 70 66 ## Install ISO paths relative to the testrsrc root.67 kasIosPathBases = [ os.path.join('6.0', 'isos'), os.path.join('6.1', 'isos'), ];68 69 71 def __init__(self, oSet, sVmName, sKind, sInstallIso, fFlags = 0): 70 72 vboxtestvms.BaseTestVm.__init__(self, sVmName, oSet = oSet, sKind = sKind, 71 73 fRandomPvPModeCrap = False if (fFlags & self.kfNoWin81Paravirt) else True); 72 self.sInstallIso = sInstallIso;73 self.fInstVmFlags = fFlags;74 self.sInstallIso = sInstallIso; 75 self.fInstVmFlags = fFlags; 74 76 75 77 # Adjustments over the defaults. 76 self.iOptRamAdjust = 0;77 self.fOptIoApic = None;78 self.fOptPae = None;79 self.fOptInstall GAs= False;80 self.asOptExtraData = [];78 self.iOptRamAdjust = 0; 79 self.fOptIoApic = None; 80 self.fOptPae = None; 81 self.fOptInstallAdditions = False; 82 self.asOptExtraData = []; 81 83 if fFlags & self.kfIdeIrqDelay: 82 self.asOptExtraData = self.kasIdeIrqDelay;84 self.asOptExtraData = self.kasIdeIrqDelay; 83 85 84 86 def _unattendedConfigure(self, oIUnattended, oTestDrv): # type: (Any, vbox.TestDriver) -> bool … … 104 106 # Install GAs? 105 107 # 106 if self.fOptInstall GAs:108 if self.fOptInstallAdditions: 107 109 try: oIUnattended.installGuestAdditions = True; 108 110 except: return reporter.errorXcpt(); … … 179 181 # 180 182 183 def getResourceSet(self): 184 if not os.path.isabs(self.sInstallIso): 185 return [self.sInstallIso,]; 186 return []; 187 181 188 def _createVmPost(self, oTestDrv, oVM, eNic0AttachType, sDvdImage): 182 189 # … … 190 197 fRc = True; 191 198 192 # Set proper boot order (needed?)193 fRc = fRc and oSession.setBootOrder(1, vboxcon.DeviceType_HardDisk)194 fRc = fRc and oSession.setBootOrder(2, vboxcon.DeviceType_DVD)199 ## Set proper boot order - IUnattended::reconfigureVM does this, doesn't it? 200 #fRc = fRc and oSession.setBootOrder(1, vboxcon.DeviceType_HardDisk) 201 #fRc = fRc and oSession.setBootOrder(2, vboxcon.DeviceType_DVD) 195 202 196 203 # Adjust memory if requested. 197 204 if self.iOptRamAdjust != 0: 198 205 try: cMbRam = oSession.o.machine.memorySize; 199 except: fRc = reporter.errorXcpt();206 except: fRc = reporter.errorXcpt(); 200 207 else: 201 fRc = fRc and oSession.setRamSize(cMbRam + self.iOptRamAdjust);208 fRc = oSession.setRamSize(cMbRam + self.iOptRamAdjust) and fRc; 202 209 203 210 # I/O APIC: 204 211 if self.fOptIoApic is not None: 205 fRc = fRc and oSession.enableIoApic(self.fOptIoApic);212 fRc = oSession.enableIoApic(self.fOptIoApic) and fRc; 206 213 207 214 # I/O APIC: 208 215 if self.fOptPae is not None: 209 fRc = fRc and oSession.enablePae(self.fOptPae);216 fRc = oSession.enablePae(self.fOptPae) and fRc; 210 217 211 218 # Set extra data 212 219 for sExtraData in self.asOptExtraData: 213 try: 214 sKey, sValue = sExtraData.split(':') 215 except ValueError: 216 raise base.InvalidOption('Invalid extradata specified: %s' % sExtraData) 220 sKey, sValue = sExtraData.split(':'); 217 221 reporter.log('Set extradata: %s => %s' % (sKey, sValue)) 218 fRc = fRc and oSession.setExtraData(sKey, sValue)222 fRc = oSession.setExtraData(sKey, sValue) and fRc; 219 223 220 224 # Save the settings. … … 272 276 return True; 273 277 278 274 279 # 275 280 # Our methods. … … 330 335 class tdGuestOsInstTest1(vbox.TestDriver): 331 336 """ 332 Guest OS installation tests.337 Unattended Guest OS installation tests using IUnattended. 333 338 334 339 Scenario: 335 - Create new VM that corresponds specified installation ISO image. 336 - Create HDD that corresponds to OS type that will be installed. 337 - Boot VM from ISO image (i.e. install guest OS). 338 - Wait for incomming TCP connection (guest should initiate such a 339 connection in case installation has been completed successfully). 340 - Create a new VM with default settings using IMachine::applyDefaults. 341 - Setup unattended installation using IUnattended. 342 - Start the VM and do the installation. 343 - Wait for TXS to report for service. 344 - If installing GAs: 345 - Wait for GAs to report operational runlevel. 346 - Save & restore state. 347 - If installing GAs: 348 - Test guest properties (todo). 349 - Test guest controls. 350 - Test shared folders. 340 351 """ 341 352 … … 349 360 assert self.fEnableVrdp; # in parent driver. 350 361 362 351 363 # 352 364 # Our install test VM set. … … 354 366 oSet = vboxtestvms.TestVmSet(self.oTestVmManager, fIgnoreSkippedVm = True); 355 367 oSet.aoTestVms.extend([ 356 UnattendedVm(oSet, 'tst-w7-32', 'Windows7', ' en_windows_7_enterprise_x86_dvd_x15-70745.iso'),368 UnattendedVm(oSet, 'tst-w7-32', 'Windows7', '6.0/uaisos/en_windows_7_enterprise_x86_dvd_x15-70745.iso'), 357 369 ]); 358 370 self.oTestVmSet = oSet; … … 363 375 # Number of VMs to test in parallel: 364 376 self.cInParallel = 1; 377 378 # Whether to do the save-and-restore test. 379 self.fTestSaveAndRestore = True; 380 381 # 382 # Sub-test drivers. 383 # 384 self.addSubTestDriver(SubTstDrvAddSharedFolders1(self)); 385 self.addSubTestDriver(SubTstDrvAddGuestCtrl(self)); 386 365 387 366 388 # … … 450 472 elif asArgs[iArg] == '--set-extradata': 451 473 iArg = self.requireMoreArgs(1, asArgs, iArg) 452 for oTestVm in self.aoSelectedVms: 453 oTestVm.asOptExtraData.append(asArgs[iArg]); 474 sExtraData = asArgs[iArg]; 475 try: _, _ = sExtraData.split(':'); 476 except: raise base.InvalidOption('Invalid extradata specified: %s' % (sExtraData, )); 477 for oTestVm in self.aoSelectedVms: 478 oTestVm.asOptExtraData.append(sExtraData); 454 479 elif asArgs[iArg] == '--ioapic': 455 480 for oTestVm in self.aoSelectedVms: … … 466 491 elif asArgs[iArg] == '--install-additions': 467 492 for oTestVm in self.aoSelectedVms: 468 oTestVm.fOptInstall GAs = True;493 oTestVm.fOptInstallAdditions = True; 469 494 elif asArgs[iArg] == '--no-install-additions': 470 495 for oTestVm in self.aoSelectedVms: 471 oTestVm.fOptInstall GAs = False;496 oTestVm.fOptInstallAdditions = False; 472 497 else: 473 498 return vbox.TestDriver.parseOption(self, asArgs, iArg); … … 491 516 492 517 self.logVmInfo(oVM) 493 reporter.testStart('Installing %s%s' % (oTestVm.sVmName, ' with GAs' if oTestVm.fOptInstall GAs else ''))518 reporter.testStart('Installing %s%s' % (oTestVm.sVmName, ' with GAs' if oTestVm.fOptInstallAdditions else '')) 494 519 495 520 cMsTimeout = 40*60000; … … 497 522 cMsTimeout = 180 * 60000; # will be adjusted down. 498 523 499 oSession, _= self.startVmAndConnectToTxsViaTcp(oTestVm.sVmName, fCdWait = False, cMsTimeout = cMsTimeout);524 oSession, oTxsSession = self.startVmAndConnectToTxsViaTcp(oTestVm.sVmName, fCdWait = False, cMsTimeout = cMsTimeout); 500 525 #oSession = self.startVmByName(oTestVm.sVmName); # (for quickly testing waitForGAs) 501 526 if oSession is not None: 502 527 # The guest has connected to TXS. 503 528 reporter.log('Guest reported success via TXS.'); 504 #reporter.log('VM started...'); # (for quickly testing waitForGAs)529 reporter.testDone(); 505 530 506 531 # If we're installing GAs, wait for them to come online: 507 532 fRc = True; 508 if oTestVm.fOptInstallGAs: 533 if oTestVm.fOptInstallAdditions: 534 reporter.testStart('Guest additions'); 509 535 aenmRunLevels = [vboxcon.AdditionsRunLevelType_Userland,]; 510 536 if oTestVm.isLoggedOntoDesktop(): 511 537 aenmRunLevels.append(vboxcon.AdditionsRunLevelType_Desktop); 512 538 fRc = self.waitForGAs(oSession, cMsTimeout = cMsTimeout / 2, aenmWaitForRunLevels = aenmRunLevels); 539 reporter.testDone(); 513 540 514 541 # Now do a save & restore test: 515 if fRc is True :516 pass; ## @todo Do save + restore.542 if fRc is True and self.fTestSaveAndRestore: 543 fRc, oSession, oTxsSession = self.testSaveAndRestore(oSession, oTxsSession, oTestVm); 517 544 518 545 # Test GAs if requested: 519 if oTestVm.fOptInstallGAs and fRc is True: 520 pass; 521 522 reporter.testDone() 523 fRc = self.terminateVmBySession(oSession) and fRc; 546 if oTestVm.fOptInstallAdditions and fRc is True: 547 for oSubTstDrv in self.aoSubTstDrvs: 548 if oSubTstDrv.fEnabled: 549 reporter.testStart(oSubTstDrv.sTestName); 550 fRc2, oTxsSession = oSubTstDrv.testIt(oTestVm, oSession, oTxsSession); 551 reporter.testDone(fRc2 is None); 552 if fRc2 is False: 553 fRc = False; 554 555 if oSession is not None: 556 fRc = self.terminateVmBySession(oSession) and fRc; 524 557 return fRc is True 525 558 … … 529 562 return False 530 563 564 def testSaveAndRestore(self, oSession, oTxsSession, oTestVm): 565 """ 566 Tests saving and restoring the VM. 567 """ 568 _ = oTestVm; 569 reporter.testStart('Save'); 570 ## @todo 571 reporter.testDone(); 572 reporter.testStart('Restore'); 573 ## @todo 574 reporter.testDone(); 575 return (True, oSession, oTxsSession); 576 531 577 if __name__ == '__main__': 532 578 sys.exit(tdGuestOsInstTest1().main(sys.argv))
Note:
See TracChangeset
for help on using the changeset viewer.