Changeset 97690 in vbox for trunk/src/VBox/ValidationKit/tests/additions
- Timestamp:
- Nov 28, 2022 11:53:56 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r97688 r97690 111 111 Applies credential defaults, based on the test VM (guest OS), if 112 112 no credentials were set yet. 113 114 Returns success status. 113 115 """ 114 116 self.oTestVm = oTestVm; 115 assert self.oTestVm is not None; 117 if not self.oTestVm: 118 reporter.log('VM object is invalid -- did VBoxSVC or a client crash?'); 119 return False; 116 120 117 121 if self.sUser is None: … … 123 127 if self.sDomain is None: 124 128 self.sDomain = ''; 129 130 return True; 125 131 126 132 class tdTestGuestCtrlBase(object): … … 141 147 """ 142 148 Sets the test environment required for this test. 149 150 Returns success status. 143 151 """ 144 152 _ = oTxsSession; 145 153 154 fRc = True; 146 155 try: 147 156 self.oGuest = oSession.o.console.guest; 148 157 self.oTestVm = oTestVm; 149 158 except: 150 reporter.errorXcpt();159 fRc = reporter.errorXcpt(); 151 160 152 161 if self.oCreds is None: 153 162 self.oCreds = tdCtxCreds(); 154 self.oCreds.applyDefaultsIfNotSet(self.oTestVm); 155 156 return True; 163 164 fRc = fRc and self.oCreds.applyDefaultsIfNotSet(self.oTestVm); 165 166 if not fRc: 167 reporter.log('Error setting up Guest Control testing environment!'); 168 169 return fRc; 157 170 158 171 def uploadLogData(self, oTstDrv, aData, sFileName, sDesc): … … 888 901 assert self.enmUser is None; # For later. 889 902 self.oCreds = tdCtxCreds(); 890 self.setEnvironment(oVmSession, oTxsSession, oTestVm); 903 fRc = self.setEnvironment(oVmSession, oTxsSession, oTestVm); 904 if not fRc: 905 return False; 891 906 reporter.log2('%s: %s steps' % (sMsgPrefix, len(self.aoSteps),)); 892 907 fRc, oCurSession = self.createSession(sMsgPrefix); … … 2543 2558 oCurRes = tTest[1] # type: tdTestResult 2544 2559 2545 oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 2560 fRc = oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 2561 if not fRc: 2562 break; 2546 2563 reporter.log('Testing #%d, user="%s", sPassword="%s", sDomain="%s" ...' 2547 2564 % (i, oCurTest.oCreds.sUser, oCurTest.oCreds.sPassword, oCurTest.oCreds.sDomain)); … … 2594 2611 for i in xrange(cMaxGuestSessions + 1): 2595 2612 aoMultiSessions[i] = tdTestSession(sSessionName = 'MultiSession #%d' % (i,)); 2596 aoMultiSessions[i].setEnvironment(oSession, oTxsSession, oTestVm); 2613 fRc = aoMultiSessions[i].setEnvironment(oSession, oTxsSession, oTestVm); 2614 if not fRc: 2615 break; 2597 2616 2598 2617 cCurSessions = aoMultiSessions[i].getSessionCount(self.oTstDrv.oVBoxMgr); … … 3181 3200 oCurTest = tTest[0] # type: tdTestExec 3182 3201 oCurRes = tTest[1] # type: tdTestResultExec 3183 oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 3202 fRc = oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 3203 if not fRc: 3204 break; 3184 3205 fRc2, oCurGuestSession = oCurTest.createSession('testGuestCtrlExec: Test #%d' % (i,)); 3185 3206 if fRc2 is not True: … … 3238 3259 oCurRes = tTest[1] # type: tdTestResultExec 3239 3260 3240 oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 3261 fRc = oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 3262 if not fRc: 3263 break; 3241 3264 fRc = self.gctrlExecDoTest(i, oCurTest, oCurRes, oCurGuestSession); 3242 3265 if fRc is False: … … 3603 3626 reporter.log('Testing #%d, sDirectory="%s" ...' % (i, limitString(oCurTest.sDirectory))); 3604 3627 3605 oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 3628 fRc = oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 3629 if not fRc: 3630 break; 3606 3631 fRc, oCurGuestSession = oCurTest.createSession('testGuestCtrlDirCreate: Test #%d' % (i,)); 3607 3632 if fRc is False: … … 3701 3726 (i, oCurTest.sTemplate, oCurTest.fMode, oCurTest.sDirectory, oCurTest.fSecure)); 3702 3727 3703 oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 3728 fRc = oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 3729 if not fRc: 3730 break; 3704 3731 fRc, oCurGuestSession = oCurTest.createSession('testGuestCtrlDirCreateTemp: Test #%d' % (i,)); 3705 3732 if fRc is False: … … 3794 3821 3795 3822 reporter.log('Testing #%d, dir="%s" ...' % (i, oCurTest.sDirectory)); 3796 oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 3823 fRc = oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 3824 if not fRc: 3825 break; 3797 3826 fRc, oCurGuestSession = oCurTest.createSession('testGuestCtrlDirRead: Test #%d' % (i,)); 3798 3827 if fRc is not True: … … 3836 3865 if fRc is True: 3837 3866 oCurTest = tdTestDirRead(); 3838 oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 3839 fRc, oCurGuestSession = oCurTest.createSession('testGuestCtrlDirRead: gctrlReadDirTree2'); 3867 fRc = oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 3868 if fRc: 3869 fRc, oCurGuestSession = oCurTest.createSession('testGuestCtrlDirRead: gctrlReadDirTree2'); 3840 3870 if fRc is True: 3841 3871 for oDir in (self.oTestFiles.oEmptyDir, self.oTestFiles.oManyDir, self.oTestFiles.oTreeDir): … … 3929 3959 for (i, oTest) in enumerate(aoTests): # int, tdTestRemoveBase 3930 3960 reporter.log('Testing #%d, path="%s" %s ...' % (i, oTest.sPath, oTest.__class__.__name__)); 3931 oTest.setEnvironment(oSession, oTxsSession, oTestVm); 3961 fRc = oTest.setEnvironment(oSession, oTxsSession, oTestVm); 3962 if not fRc: 3963 break; 3932 3964 fRc, _ = oTest.createSession('testGuestCtrlFileRemove: Test #%d' % (i,)); 3933 3965 if fRc is False: … … 3939 3971 if fRc is True: 3940 3972 oCurTest = tdTestDirRead(); 3941 oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 3942 fRc, oCurGuestSession = oCurTest.createSession('remove final'); 3973 fRc = oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 3974 if fRc: 3975 fRc, oCurGuestSession = oCurTest.createSession('remove final'); 3943 3976 if fRc is True: 3944 3977 … … 4054 4087 4055 4088 oTest = tdTestGuestCtrlBase(); 4056 oTest.setEnvironment(oSession, oTxsSession, oTestVm); 4089 fRc = oTest.setEnvironment(oSession, oTxsSession, oTestVm); 4090 if not fRc: 4091 return (False, oTxsSession); 4057 4092 fRc2, oGuestSession = oTest.createSession('FsStat on TestFileSet'); 4058 4093 if fRc2 is not True: … … 4264 4299 4265 4300 oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 4301 if not fRc: 4302 break; 4266 4303 fRc, _ = oCurTest.createSession('testGuestCtrlFileOpen: Test #%d' % (i,)); 4267 4304 if fRc is not True: … … 4290 4327 # 4291 4328 oTest = tdTestGuestCtrlBase(); 4292 oTest.setEnvironment(oSession, oTxsSession, oTestVm); 4329 fRc = oTest.setEnvironment(oSession, oTxsSession, oTestVm); 4330 if not fRc: 4331 return (False, oTxsSession); 4293 4332 fRc2, oGuestSession = oTest.createSession('FsStat on TestFileSet'); 4294 4333 if fRc2 is not True: … … 4706 4745 for (i, oCurTest) in enumerate(aoTests): 4707 4746 reporter.log('Testing #%d: %s ...' % (i, oCurTest.toString(),)); 4708 4709 oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 4747 fRc = oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 4748 if not fRc: 4749 break; 4710 4750 fRc, _ = oCurTest.createSession('testGuestCtrlFileWrite: Test #%d' % (i,)); 4711 4751 if fRc is not True: … … 4963 5003 4964 5004 oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 5005 if not fRc: 5006 break; 4965 5007 fRc, oCurGuestSession = oCurTest.createSession('testGuestCtrlCopyTo: Test #%d' % (i,)); 4966 5008 if fRc is not True: … … 5192 5234 fRc = oCurTest.execute(self.oTstDrv, oSession, oTxsSession, oTestVm, 'testing #%d' % (i,)); 5193 5235 else: 5194 oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 5236 fRc = oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 5237 if not fRc: 5238 break; 5195 5239 fRc2, oCurGuestSession = oCurTest.createSession('testGuestCtrlCopyFrom: Test #%d' % (i,)); 5196 5240 if fRc2 is not True: … … 5283 5327 5284 5328 oCurTest.setEnvironment(oSession, oTxsSession, oTestVm); 5329 if not fRc: 5330 break; 5285 5331 fRc, _ = oCurTest.createSession('Test #%d' % (i,)); 5286 5332 if fRc is not True:
Note:
See TracChangeset
for help on using the changeset viewer.