Changeset 79452 in vbox
- Timestamp:
- Jul 1, 2019 4:49:51 PM (5 years ago)
- Location:
- trunk/src/VBox/ValidationKit/tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r79394 r79452 2235 2235 2236 2236 # 2237 # Parameters.2237 # Tests: 2238 2238 # 2239 2239 atTests = [ 2240 2240 # Invalid parameters. 2241 [ tdTestSession(sUser = ''), tdTestResultSession() ], 2242 [ tdTestSession(sPassword = 'bar'), tdTestResultSession() ], 2243 [ tdTestSession(sDomain = 'boo'),tdTestResultSession() ], 2244 [ tdTestSession(sPassword = 'bar', sDomain = 'boo'), tdTestResultSession() ], 2241 [ tdTestSession(sUser = ''), tdTestResultSession() ], 2245 2242 # User account without a passwort - forbidden. 2246 [ tdTestSession(sPassword = "" ), tdTestResultSession() ], 2247 # Wrong credentials. 2248 # Note: On Guest Additions < 4.3 this always succeeds because these don't 2243 [ tdTestSession(sPassword = "" ), tdTestResultSession() ], 2244 # Various wrong credentials. 2245 # Note! Only windows cares about sDomain, the other guests ignores it. 2246 # Note! On Guest Additions < 4.3 this always succeeds because these don't 2249 2247 # support creating dedicated sessions. Instead, guest process creation 2250 2248 # then will fail. See note below. 2249 [ tdTestSession(sPassword = 'bar'), tdTestResultSession() ], 2250 [ tdTestSession(sUser = 'foo', sPassword = 'bar'), tdTestResultSession() ], 2251 [ tdTestSession(sPassword = 'bar', sDomain = 'boo'), tdTestResultSession() ], 2251 2252 [ tdTestSession(sUser = 'foo', sPassword = 'bar', sDomain = 'boo'), tdTestResultSession() ], 2252 # Correct credentials.2253 [ tdTestSession(), tdTestResultSession(fRc = True, cNumSessions = 1) ]2254 2253 ]; 2255 2254 if oTestVm.isWindows(): # domain is ignored elsewhere. 2255 atTests.append([ tdTestSession(sDomain = 'boo'), tdTestResultSession() ]); 2256 2257 # Finally, correct credentials. 2258 atTests.append([ tdTestSession(), tdTestResultSession(fRc = True, cNumSessions = 1) ]); 2259 2260 # 2261 # Run the tests. 2262 # 2256 2263 fRc = True; 2257 2264 for (i, tTest) in enumerate(atTests): … … 2739 2746 # Basic execution. 2740 2747 [ tdTestExec(sCmd = sImageOut, asArgs = [ sImageOut, '-R', sSystemDir ]), 2741 tdTestResultExec(fRc = True , iExitCode = 1) ],2748 tdTestResultExec(fRc = True) ], 2742 2749 [ tdTestExec(sCmd = sImageOut, asArgs = [ sImageOut, sFileForReading ]), 2743 2750 tdTestResultExec(fRc = True) ], … … 2808 2815 oCurRes = tTest[1] # type: tdTestResultExec 2809 2816 oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 2810 fRc , oCurGuestSession = oCurTest.createSession('testGuestCtrlExec: Test #%d' % (i,));2811 if fRc is not True:2812 reporter.error('Test #%d failed: Could not create session' % (i,));2817 fRc2, oCurGuestSession = oCurTest.createSession('testGuestCtrlExec: Test #%d' % (i,)); 2818 if fRc2 is not True: 2819 fRc = reporter.error('Test #%d failed: Could not create session' % (i,)); 2813 2820 break; 2814 fRc = self.gctrlExecDoTest(i, oCurTest, oCurRes, oCurGuestSession); 2815 if fRc is not True: 2816 break; 2817 fRc = oCurTest.closeSession(); 2818 if fRc is not True: 2819 break; 2821 fRc = self.gctrlExecDoTest(i, oCurTest, oCurRes, oCurGuestSession) and fRc; 2822 fRc = oCurTest.closeSession() and fRc; 2820 2823 2821 2824 reporter.log('Execution of all tests done, checking for stale sessions'); … … 3436 3439 ]; 3437 3440 for sDir in asTestDirs: 3438 if oTxsSession.syncMkDir(sDir ) is not True:3441 if oTxsSession.syncMkDir(sDir, 0o777) is not True: 3439 3442 return reporter.error('Failed to create test dir "%s"!' % (sDir,)); 3440 3443 for sFile in asTestFiles: 3441 if oTxsSession.syncUploadString(sFile, sFile ) is not True:3444 if oTxsSession.syncUploadString(sFile, sFile, 0o666) is not True: 3442 3445 return reporter.error('Failed to create test file "%s"!' % (sFile,)); 3443 3446 … … 3524 3527 # Recursively delete the entire test file tree from the root up. 3525 3528 # 3529 # Note! On unix we cannot delete the root dir itself since it is residing 3530 # in /var/tmp where only the owner may delete it. Root is the owner. 3531 # 3532 if oTestVm.isWindows() or oTestVm.isOS2(): 3533 afFlags = [vboxcon.DirectoryRemoveRecFlag_ContentAndDir,]; 3534 else: 3535 afFlags = [vboxcon.DirectoryRemoveRecFlag_ContentOnly,]; 3526 3536 try: 3527 oProgress = oCurGuestSession.directoryRemoveRecursive(self.oTestFiles.oRoot.sPath, 3528 [vboxcon.DirectoryRemoveRecFlag_ContentAndDir,]); 3537 oProgress = oCurGuestSession.directoryRemoveRecursive(self.oTestFiles.oRoot.sPath, afFlags); 3529 3538 except: 3530 3539 fRc = reporter.errorXcpt('Removing tree "%s" failed' % (self.oTestFiles.oRoot.sPath,)); 3531 3540 else: 3532 reporter.log2('#3: fRc=%s' % (fRc));3533 3541 oWrappedProgress = vboxwrappers.ProgressWrapper(oProgress, self.oTstDrv.oVBoxMgr, self.oTstDrv, 3534 3542 "remove-tree-root: %s" % (self.oTestFiles.oRoot.sPath,)); … … 3704 3712 sContent = 'abcdefghijklmnopqrstuvwxyz0123456789'; 3705 3713 for sFile in asNonEmptyFiles: 3706 if oTxsSession.syncUploadString(sContent, sFile ) is not True:3714 if oTxsSession.syncUploadString(sContent, sFile, 0o666) is not True: 3707 3715 return reporter.error('Failed to create "%s" via TXS' % (sFile,)); 3708 3716 … … 3728 3736 eAction = vboxcon.FileOpenAction_OpenExistingTruncated), tdTestResultFailure() ], 3729 3737 [ tdTestFileOpen(sFile = oTestVm.pathJoin(sTempDir, 'no-such-dir', 'no-such-file')), tdTestResultFailure() ], 3730 # Wrong type: 3731 [ tdTestFileOpen(sFile = self.getGuestTempDir(oTestVm)), tdTestResultFailure() ], 3732 [ tdTestFileOpen(sFile = self.getGuestSystemDir(oTestVm)), tdTestResultFailure() ], 3738 ]; 3739 if oTestVm.isWindows() or not self.fSkipKnownBugs: # We can open directories on linux, but we shouldn't, right... 3740 atTests.extend([ 3741 # Wrong type: 3742 [ tdTestFileOpen(sFile = self.getGuestTempDir(oTestVm)), tdTestResultFailure() ], 3743 [ tdTestFileOpen(sFile = self.getGuestSystemDir(oTestVm)), tdTestResultFailure() ], 3744 ]); 3745 atTests.extend([ 3733 3746 # O_EXCL and such: 3734 3747 [ tdTestFileOpen(sFile = sFileForReading, eAction = vboxcon.FileOpenAction_CreateNew, … … 3799 3812 [ tdTestFileOpenCheckSize(sFile = asNonEmptyFiles[2], eAction = vboxcon.FileOpenAction_CreateOrReplace, 3800 3813 eAccessMode = vboxcon.FileAccessMode_WriteOnly), tdTestResultSuccess() ], 3801 ] ;3814 ]); 3802 3815 3803 3816 # … … 4000 4013 fRc = reporter.errorXcpt('%s: offFile=%s cbToRead=%s cbContent=%s' 4001 4014 % (oTestFile.sPath, offFile, cbToRead, oTestFile.cbContent)); 4015 cbRead = 0; 4002 4016 else: 4003 4017 cbRead = len(abRead); … … 4037 4051 fRc = reporter.errorXcpt('%s: offFile=%s cbToRead=%s cbContent=%s' 4038 4052 % (oTestFile.sPath, offFile, cbToRead, oTestFile.cbContent)); 4053 cbRead = 0; 4039 4054 else: 4040 4055 cbRead = len(abRead); … … 4042 4057 fRc = reporter.error('%s: random readAt mismatch @ %s LB %s' % (oTestFile.sPath, offFile, cbRead,)); 4043 4058 4044 if not self.fSkipKnownBugs: 4045 ## @todo See todo in GuestFile::getOffset() from r127065 (restored in r131439), but essentially 4046 ## the issue is that 'mCurOffset += cbActuallyRead' doesn't work for non-linear readAt calls. 4047 ## It should be 'mCurOffset = readAt.offsetParam + cbActuallyRead'. 4048 try: 4049 offActual = oFile.offset; 4050 except: 4051 fRc = reporter.errorXcpt('%s: offFile=%s cbToRead=%s cbContent=%s (#2)' 4052 % (oTestFile.sPath, offFile, cbToRead, oTestFile.cbContent)); 4053 else: 4054 if offActual != offFile + cbRead: 4055 fRc = reporter.error('%s: IFile.offset is %s, expected %s (offFile=%s cbToRead=%s cbRead=%s) (#2)' 4056 % (oTestFile.sPath, offActual, offFile + cbRead, offFile, cbToRead, cbRead)); 4057 ## @todo The trouble here is that RTFileReadAt may or may not do the seeking depending on the OS (see docs). 4058 ## In addition, windows will not update the position if the offset is beyond EOF it seems. 4059 ## Fix is to always do a RTFileSeek after a successful RTFileReadAt call. 4060 try: 4061 offActual = oFile.seek(0, vboxcon.FileSeekOrigin_Current); 4062 except: 4063 fRc = reporter.errorXcpt('%s: offFile=%s cbToRead=%s cbContent=%s (#2)' 4064 % (oTestFile.sPath, offFile, cbToRead, oTestFile.cbContent)); 4065 else: 4066 if offActual != offFile + cbRead: 4067 fRc = reporter.error('%s: seek(0,cur) -> %s, expected %s (offFile=%s cbToRead=%s cbRead=%s) (#2)' 4068 % (oTestFile.sPath, offActual, offFile + cbRead, offFile, cbToRead, cbRead)); 4059 try: 4060 offActual = oFile.offset; 4061 except: 4062 fRc = reporter.errorXcpt('%s: offFile=%s cbToRead=%s cbContent=%s (#2)' 4063 % (oTestFile.sPath, offFile, cbToRead, oTestFile.cbContent)); 4064 else: 4065 if offActual != offFile + cbRead: 4066 fRc = reporter.error('%s: IFile.offset is %s, expected %s (offFile=%s cbToRead=%s cbRead=%s) (#2)' 4067 % (oTestFile.sPath, offActual, offFile + cbRead, offFile, cbToRead, cbRead)); 4068 4069 try: 4070 offActual = oFile.seek(0, vboxcon.FileSeekOrigin_Current); 4071 except: 4072 fRc = reporter.errorXcpt('%s: offFile=%s cbToRead=%s cbContent=%s (#2)' 4073 % (oTestFile.sPath, offFile, cbToRead, oTestFile.cbContent)); 4074 else: 4075 if offActual != offFile + cbRead: 4076 fRc = reporter.error('%s: seek(0,cur) -> %s, expected %s (offFile=%s cbToRead=%s cbRead=%s) (#2)' 4077 % (oTestFile.sPath, offActual, offFile + cbRead, offFile, cbToRead, cbRead)); 4069 4078 4070 4079 # … … 4319 4328 4320 4329 for sDir in (sScratchGst, sScratchDstDir1Gst, sScratchDstDir2Gst, sScratchDstDir3Gst, sScratchDstDir4Gst): 4321 if oTxsSession.syncMkDir(sDir ) is not True:4330 if oTxsSession.syncMkDir(sDir, 0o777) is not True: 4322 4331 return reporter.error('TXS failed to create directory "%s"!' % (sDir,)); 4323 4332 -
trunk/src/VBox/ValidationKit/tests/additions/tdAddSharedFolders1.py
r79092 r79452 51 51 """ 52 52 53 def __init__(self, oTstDrv , fUseAltFsPerfPathForWindows = False):53 def __init__(self, oTstDrv): 54 54 base.SubTestDriverBase.__init__(self, oTstDrv, 'add-shared-folders', 'Shared Folders'); 55 55 56 self.asTestsDef = [ 'fsperf', ]; 57 self.asTests = self.asTestsDef; 58 self.asExtraArgs = []; 59 self.sGstFsPerfPath = '${CDROM}/vboxvalidationkit/${OS/ARCH}/FsPerf${EXESUFF}'; 60 self.sGstFsPerfPathAlt = 'C:/Apps/FsPerf${EXESUFF}'; 61 self.fUseAltFsPerfPathForWindows = fUseAltFsPerfPathForWindows; 56 self.asTestsDef = [ 'fsperf', ]; 57 self.asTests = self.asTestsDef; 58 self.asExtraArgs = []; 59 self.asGstFsPerfPaths = [ 60 '${CDROM}/vboxvalidationkit/${OS/ARCH}/FsPerf${EXESUFF}', 61 '${CDROM}/${OS/ARCH}/FsPerf${EXESUFF}', 62 '${TXSDIR}/${OS/ARCH}/FsPerf${EXESUFF}', 63 '${TXSDIR}/FsPerf${EXESUFF}', 64 'E:/vboxvalidationkit/${OS/ARCH}/FsPerf${EXESUFF}', 65 ]; 62 66 63 67 def parseOption(self, asArgs, iArg): … … 206 210 # Add the extra arguments from the command line and kick it off: 207 211 asArgs.extend(self.asExtraArgs); 212 213 # Run FsPerf: 208 214 reporter.log2('Starting guest FsPerf (%s)...' % (asArgs,)); 209 sFsPerfPath = self.sGstFsPerfPath; 210 if oTestVm.isWindows() and self.fUseAltFsPerfPathForWindows: # bird: Temp hack till we get UDF cloning implemented. 211 sFsPerfPath = self.sGstFsPerfPathAlt; # Helps making unattended install tests work. 215 sFsPerfPath = self._locateGstFsPerf(oTxsSession); 212 216 fRc = self.oTstDrv.txsRunTest(oTxsSession, 'FsPerf', 30 * 60 * 1000, sFsPerfPath, asArgs); 213 217 reporter.log2('FsPerf -> %s' % (fRc,)); … … 225 229 226 230 231 def _locateGstFsPerf(self, oTxsSession): 232 """ 233 Returns guest side path to FsPerf. 234 """ 235 for sFsPerfPath in self.asGstFsPerfPaths: 236 if oTxsSession.syncIsFile(sFsPerfPath): 237 return sFsPerfPath; 238 reporter.log('Unable to find guest FsPerf in any of these places: %s' % ('\n '.join(self.asGstFsPerfPaths),)); 239 return self.asGstFsPerfPaths[0]; 240 241 227 242 228 243 if __name__ == '__main__': -
trunk/src/VBox/ValidationKit/tests/installation/tdGuestOsUnattendedInst1.py
r79424 r79452 185 185 return [self.sInstallIso,]; 186 186 return []; 187 188 def _createVmDoIt(self, oTestDrv, eNic0AttachType, sDvdImage): 189 # 190 # Use HostOnly networking for ubuntu and debian VMs to prevent them from 191 # downloading updates and doing database updates during installation. 192 # We want predicable results. 193 # 194 if eNic0AttachType is None \ 195 and self.isLinux() \ 196 and ( 'ubuntu' in self.sKind.lower() 197 or 'debian' in self.sKind.lower() ): 198 eNic0AttachType = vboxcon.NetworkAttachmentType_HostOnly; 199 200 return vboxtestvms.BaseTestVm._createVmDoIt(self, oTestDrv, eNic0AttachType, sDvdImage); 201 187 202 188 203 def _createVmPost(self, oTestDrv, oVM, eNic0AttachType, sDvdImage): … … 374 389 oSet.aoTestVms.extend([ 375 390 # Windows7 RTM: 376 UnattendedVm(oSet, 'tst-w7-32', 'Windows7', '6.0/uaisos/en_windows_7_enterprise_x86_dvd_x15-70745.iso'), 377 UnattendedVm(oSet, 'tst-w7-64', 'Windows7_64', '6.0/uaisos/en_windows_7_enterprise_x64_dvd_x15-70749.iso'), 391 UnattendedVm(oSet, 'tst-w7-32', 'Windows7', '6.0/uaisos/en_windows_7_enterprise_x86_dvd_x15-70745.iso'), # 5.7GiB 392 UnattendedVm(oSet, 'tst-w7-64', 'Windows7_64', '6.0/uaisos/en_windows_7_enterprise_x64_dvd_x15-70749.iso'), # 10GiB 393 UnattendedVm(oSet, 'tst-ubuntu-16.04-64', 'Ubuntu_64', '6.0/uaisos/ubuntu-16.04-desktop-amd64.iso'), 394 #UnattendedVm(oSet, 'tst-ubuntu-18.04-64', 'Ubuntu_64', '6.0/uaisos/ubuntu-18.04-desktop-amd64.iso'), # >=5.7GiB 378 395 ]); 379 396 self.oTestVmSet = oSet; … … 391 408 # Sub-test drivers. 392 409 # 393 self.addSubTestDriver(SubTstDrvAddSharedFolders1(self , fUseAltFsPerfPathForWindows = True)); # !HACK ALERT! UDF cloning.410 self.addSubTestDriver(SubTstDrvAddSharedFolders1(self)); 394 411 self.addSubTestDriver(SubTstDrvAddGuestCtrl(self)); 395 412 … … 511 528 if not self.importVBoxApi(): # So we can use the constant below. 512 529 return False; 513 return self.oTestVmSet.actionConfig(self , eNic0AttachType = vboxcon.NetworkAttachmentType_NAT);530 return self.oTestVmSet.actionConfig(self); 514 531 515 532 def actionExecute(self):
Note:
See TracChangeset
for help on using the changeset viewer.