Changeset 70660 in vbox for trunk/src/VBox/ValidationKit/tests/additions
- Timestamp:
- Jan 21, 2018 4:18:58 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r70521 r70660 3168 3168 curTest = aTest[0]; # tdTestFileReadWrite, use an index, later. 3169 3169 curRes = aTest[1]; # tdTestResult 3170 reporter.log('Testing #%d, sFile="%s", cbToReadWrite=%d, sOpenMode="%s", sDisposition="%s", cbOffset=%d ...' % \3170 reporter.log('Testing #%d, sFile="%s", cbToReadWrite=%d, sOpenMode="%s", sDisposition="%s", cbOffset=%d ...' % 3171 3171 (i, curTest.sFile, curTest.cbToReadWrite, curTest.sOpenMode, curTest.sDisposition, curTest.cbOffset)); 3172 3172 curTest.setEnvironment(oSession, oTxsSession, oTestVm); … … 3175 3175 reporter.error('Test #%d failed: Could not create session' % (i,)); 3176 3176 break; 3177 3177 3178 try: 3178 3179 if curTest.cbOffset > 0: # The offset parameter is gone. … … 3182 3183 curFile.seek(curTest.cbOffset, vboxcon.FileSeekOrigin_Begin); 3183 3184 else: 3184 curFile = curGuestSession.fileOpenEx(curTest.sFile, curTest.sOpenMode, curTest.sDisposition, \3185 curFile = curGuestSession.fileOpenEx(curTest.sFile, curTest.sOpenMode, curTest.sDisposition, 3185 3186 curTest.sSharingMode, curTest.lCreationMode, curTest.cbOffset); 3186 3187 curOffset = long(curFile.offset); 3187 3188 resOffset = long(curTest.cbOffset); 3188 3189 if curOffset != resOffset: 3189 reporter.error('Test #%d failed: Initial offset on open does not match: Got %d, expected %d' \3190 reporter.error('Test #%d failed: Initial offset on open does not match: Got %d, expected %d' 3190 3191 % (i, curOffset, resOffset)); 3191 3192 fRc = False; … … 3195 3196 curTest.lCreationMode); 3196 3197 else: 3197 curFile = curGuestSession.fileOpen(curTest.sFile, curTest.sOpenMode, curTest.sDisposition, \3198 curFile = curGuestSession.fileOpen(curTest.sFile, curTest.sOpenMode, curTest.sDisposition, 3198 3199 curTest.lCreationMode); 3199 if fRc \ 3200 and curTest.cbToReadWrite > 0: 3200 if fRc and curTest.cbToReadWrite > 0: 3201 3201 ## @todo Split this up in 64K writes. Later. 3202 3202 ## @todo Test timeouts. 3203 3203 cBytesWritten = curFile.write(curTest.aBuf, 30 * 1000); 3204 if curRes.cbProcessed > 0 \3205 and curRes.cbProcessed != cBytesWritten:3206 reporter.error('Test #%d failed: Written buffer length does not match: Got %d, expected %d' \3204 if curRes.cbProcessed > 0 \ 3205 and curRes.cbProcessed != cBytesWritten: 3206 reporter.error('Test #%d failed: Written buffer length does not match: Got %d, expected %d' 3207 3207 % (i, cBytesWritten, curRes.cbProcessed)); 3208 3208 fRc = False; … … 3218 3218 reporter.logXcpt('Seeking back to initial write position failed:'); 3219 3219 fRc = False; 3220 if fRc \ 3221 and long(curFile.offset) != curTest.cbOffset: 3222 reporter.error('Test #%d failed: Initial write position does not match current position, \ 3223 got %d, expected %d' \ 3224 % (i, long(curFile.offset), curTest.cbOffset)); 3220 if fRc and long(curFile.offset) != curTest.cbOffset: 3221 reporter.error('Test #%d failed: Initial write position does not match current position, ' 3222 'got %d, expected %d' % (i, long(curFile.offset), curTest.cbOffset)); 3225 3223 fRc = False; 3226 3224 if fRc: 3227 3225 aBufRead = curFile.read(curTest.cbToReadWrite, 30 * 1000); 3228 3226 if len(aBufRead) != curTest.cbToReadWrite: 3229 reporter.error('Test #%d failed: Got buffer length %d, expected %d' \3227 reporter.error('Test #%d failed: Got buffer length %d, expected %d' 3230 3228 % (i, len(aBufRead), curTest.cbToReadWrite)); 3231 3229 fRc = False; 3232 if fRc \3233 and curRes.aBuf is not None \3234 and buffer(curRes.aBuf)!= aBufRead:3235 reporter.error('Test #%d failed: Got buffer\n%s, expected\n%s' \3230 if fRc \ 3231 and curRes.aBuf is not None \ 3232 and curRes.aBuf != aBufRead: 3233 reporter.error('Test #%d failed: Got buffer\n%s, expected\n%s' 3236 3234 % (i, aBufRead, curRes.aBuf)); 3237 3235 fRc = False; … … 3240 3238 resOffset = long(curRes.cbOffset); 3241 3239 if curOffset != resOffset: 3242 reporter.error('Test #%d failed: Final offset does not match: Got %d, expected %d' \3240 reporter.error('Test #%d failed: Final offset does not match: Got %d, expected %d' 3243 3241 % (i, curOffset, resOffset)); 3244 3242 fRc = False;
Note:
See TracChangeset
for help on using the changeset viewer.