Changeset 77383 in vbox for trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
- Timestamp:
- Feb 20, 2019 1:45:36 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r77368 r77383 1064 1064 reporter.testDone(fSkip); 1065 1065 1066 #reporter.testStart('File write');1067 #fSkip = 'file_write' not in self.asTests or fRc is False;1068 #if fSkip is False:1069 #fRc, oTxsSession = self.testGuestCtrlFileWrite(oSession, oTxsSession, oTestVm);1070 #reporter.testDone(fSkip);1066 reporter.testStart('File write'); 1067 fSkip = 'file_write' not in self.asTests or fRc is False; 1068 if fSkip is False: 1069 fRc, oTxsSession = self.testGuestCtrlFileWrite(oSession, oTxsSession, oTestVm); 1070 reporter.testDone(fSkip); 1071 1071 1072 1072 reporter.testStart('Updating Guest Additions'); … … 3000 3000 aaTests = []; 3001 3001 3002 cScratchBuf = 512;3003 aScratchBuf = array('b', [random.randint(-128, 127) for i in range(cScratchBuf)]);3002 cScratchBuf = random.randint(1, 4096); 3003 aScratchBuf = os.urandom(cScratchBuf); 3004 3004 aaTests.extend([ 3005 3005 # Write to a non-existing file. … … 3011 3011 ]); 3012 3012 3013 aScratchBuf2 = array('b', [random.randint(-128, 127) for i in range(cScratchBuf)]);3013 aScratchBuf2 = os.urandom(cScratchBuf); 3014 3014 aaTests.extend([ 3015 3015 # Append the same amount of data to the just created file. … … 3037 3037 if self.oTstDrv.fpApiVer >= 5.0: 3038 3038 curFile = curGuestSession.fileOpenEx(curTest.sFile, curTest.getAccessMode(), curTest.getOpenAction(), 3039 curTest.getSharingMode(), []);3039 curTest.getSharingMode(), curTest.lCreationMode, []); 3040 3040 curFile.seek(curTest.cbOffset, vboxcon.FileSeekOrigin_Begin); 3041 3041 else: … … 3050 3050 else: 3051 3051 if self.oTstDrv.fpApiVer >= 5.0: 3052 curFile = curGuestSession.fileOpen (curTest.sFile, curTest.getAccessMode(), curTest.getOpenAction(),3053 curTest.lCreationMode);3052 curFile = curGuestSession.fileOpenEx(curTest.sFile, curTest.getAccessMode(), curTest.getOpenAction(), 3053 curTest.getSharingMode(), curTest.lCreationMode, []); 3054 3054 else: 3055 3055 curFile = curGuestSession.fileOpen(curTest.sFile, curTest.sOpenMode, curTest.sDisposition, 3056 3056 curTest.lCreationMode); 3057 3057 if fRc and curTest.cbToReadWrite > 0: 3058 reporter.log("File '%s' opened" % curTest.sFile); 3058 3059 ## @todo Split this up in 64K writes. Later. 3059 3060 ## @todo Test timeouts. … … 3088 3089 and curRes.aBuf is not None \ 3089 3090 and curRes.aBuf != aBufRead: 3090 reporter.error('Test #%d failed: Got buffer\n%s, expected\n%s' \ 3091 % (i, aBufRead, curRes.aBuf)); 3091 reporter.error('Test #%d failed: Read back buffer (%d bytes) does not match written content (%d bytes)' \ 3092 % (i, len(curRes.aBuf), len(aBufRead))); 3093 reporter.error('Test #%d failed: Got:\n%s' % (i, aBufRead.encode('hex'))); 3094 reporter.error('Test #%d failed: Expected:\n%s' % (i, curRes.aBuf.encode('hex'))); 3092 3095 fRc = False; 3093 3096 # Test final offset. … … 3099 3102 fRc = False; 3100 3103 curFile.close(); 3104 reporter.log("File '%s' closed" % curTest.sFile); 3101 3105 except: 3102 3106 reporter.logXcpt('Opening "%s" failed:' % (curTest.sFile,));
Note:
See TracChangeset
for help on using the changeset viewer.