Changeset 77477 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Feb 27, 2019 10:40:15 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r77476 r77477 138 138 self.oTest = tdCtxTest(oSession, oTxsSession, oTestVm); 139 139 return self.oTest; 140 141 def uploadLogData(self, oTstDrv, aData, sFileName, sDesc): 142 """ 143 Uploads (binary) data to a log file for manual (later) inspection. 144 """ 145 reporter.log('Creating + uploading log data file "%s"' % sFileName); 146 sHstFileName = os.path.join(oTstDrv.sScratchPath, sFileName); 147 try: 148 oCurTestFile = open(sHstFileName, "wb"); 149 oCurTestFile.write(aData); 150 oCurTestFile.close(); 151 reporter.addLogFile(sHstFileName, 'misc/other', sDesc); 152 except: 153 reporter.error('Unable to create temporary file for "%s"' % sDesc); 140 154 141 155 def createSession(self, sName): … … 3100 3114 3101 3115 # Create files with buffer contents and upload those for later (manual) inspection. 3102 sHstFileName = os.path.join(self.oTstDrv.sScratchPath, ('testGuestCtrlWriteTest%d-BufExcepted' % i)); 3103 try: 3104 oCurTestFile = open(sHstFileName, "wb"); 3105 oCurTestFile.write(curRes.aBuf); 3106 oCurTestFile.close(); 3107 reporter.addLogFile(sHstFileName, 'misc/other', 'Test #%d: Expected buffer' % i); 3108 except: 3109 reporter.error('Test #%d failed: Unable to create temporary expected buffer file "%s"' \ 3110 % (i, sHstFileName)); 3111 3112 sHstFileName = os.path.join(self.oTstDrv.sScratchPath, ('testGuestCtrlWriteTest%d-BufGot' % i)); 3113 try: 3114 oCurTestFile = open(sHstFileName, "wb"); 3115 oCurTestFile.write(aBufRead); 3116 oCurTestFile.close(); 3117 reporter.addLogFile(sHstFileName, 'misc/other', 'Test #%d: Got buffer' % i); 3118 except: 3119 reporter.error('Test #%d failed: Unable to create temporary got buffer file "%s"' \ 3120 % (i, sHstFileName)); 3116 self.uploadLogData(self.oTstDrv, curRes.aBuf, ('testGuestCtrlWriteTest%d-BufExcepted' % i), 3117 ('Test #%d: Expected buffer' % i)); 3118 self.uploadLogData(self.oTstDrv, aBufRead, ('testGuestCtrlWriteTest%d-BufGot' % i), 3119 ('Test #%d: Got buffer' % i)); 3121 3120 fRc = False; 3122 3121 # Test final offset.
Note:
See TracChangeset
for help on using the changeset viewer.