Changeset 79328 in vbox for trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
- Timestamp:
- Jun 25, 2019 2:41:07 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r79327 r79328 64 64 """ 65 65 Class for handling a guest process input/output stream. 66 67 @todo write stdout/stderr tests. 66 68 """ 67 69 def appendStream(self, stream, convertTo = '<b'): … … 72 74 self.extend(struct.pack(convertTo, stream)); 73 75 74 class tdCtxTest(object):75 """76 Provides the actual test environment.77 Should be kept as generic as possible.78 """79 def __init__(self, oSession, oTxsSession, oTestVm): # pylint: disable=unused-argument80 ## The desired Main API result.81 self.fRc = False;82 ## IGuest reference.83 self.oGuest = oSession.o.console.guest; ## @todo may throw shit84 self.oSession = oSession;85 self.oTxsSession = oTxsSession;86 self.oTestVm = oTestVm;87 76 88 77 class tdCtxCreds(object): … … 121 110 """ 122 111 def __init__(self): 123 self.oTest = None; 124 self.oCreds = None; 125 self.timeoutMS = 30 * 1000; # 30s timeout 126 ## IGuestSession reference or None. 127 self.oGuestSession = None; 112 self.oGuest = None; ##< IGuest. 113 self.oCreds = None ##< type: tdCtxCreds 114 self.timeoutMS = 30 * 1000; ##< 30s timeout 115 self.oGuestSession = None; ##< IGuestSession reference or None. 128 116 129 117 def setEnvironment(self, oSession, oTxsSession, oTestVm): … … 131 119 Sets the test environment required for this test. 132 120 """ 133 self.oTest = tdCtxTest(oSession, oTxsSession, oTestVm); 121 _ = oTxsSession; 122 123 try: 124 self.oGuest = oSession.o.console.guest; 125 except: 126 reporter.errorXcpt(); 127 134 128 if self.oCreds is None: 135 129 self.oCreds = tdCtxCreds(); 136 130 self.oCreds.applyDefaultsIfNotSet(oTestVm); 137 return self.oTest; 131 132 return True; 138 133 139 134 def uploadLogData(self, oTstDrv, aData, sFileName, sDesc): … … 162 157 reporter.log('Creating session "%s" ...' % (sName,)); 163 158 try: 164 self.oGuestSession = self.o Test.oGuest.createSession(self.oCreds.sUser,165 166 167 159 self.oGuestSession = self.oGuest.createSession(self.oCreds.sUser, 160 self.oCreds.sPassword, 161 self.oCreds.sDomain, 162 sName); 168 163 except: 169 164 # Just log, don't assume an error here (will be done in the main loop then). … … 832 827 opened guest sessions of a VM. 833 828 """ 834 if self.o Test.oGuest is None:829 if self.oGuest is None: 835 830 return 0; 836 831 try: 837 aoSession = oVBoxMgr.getArray(self.o Test.oGuest, 'sessions')832 aoSession = oVBoxMgr.getArray(self.oGuest, 'sessions') 838 833 except: 839 834 reporter.errorXcpt('sSessionName: %s' % (self.sSessionName,)); … … 2366 2361 # Try check that none of the remaining sessions got closed. 2367 2362 try: 2368 aoGuestSessions = self.oTstDrv.oVBoxMgr.getArray(atTests[0][0].o Test.oGuest, 'sessions');2363 aoGuestSessions = self.oTstDrv.oVBoxMgr.getArray(atTests[0][0].oGuest, 'sessions'); 2369 2364 except: 2370 2365 return (reporter.errorXcpt('i=%d/%d' % (i, cMaxGuestSessions,)), oTxsSession); … … 4801 4796 break; 4802 4797 try: 4803 oCurProgress = oCurTest.o Test.oGuest.updateGuestAdditions(oCurTest.sSrc, oCurTest.asArgs, oCurTest.fFlags);4798 oCurProgress = oCurTest.oGuest.updateGuestAdditions(oCurTest.sSrc, oCurTest.asArgs, oCurTest.fFlags); 4804 4799 if oCurProgress is not None: 4805 4800 oProgress = vboxwrappers.ProgressWrapper(oCurProgress, self.oTstDrv.oVBoxMgr, self.oTstDrv, "gctrlUpGA");
Note:
See TracChangeset
for help on using the changeset viewer.