Changeset 75375 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Nov 9, 2018 7:09:26 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/storage/tdStorageSnapshotMerging1.py
r75373 r75375 33 33 import os; 34 34 import sys; 35 import uuid;36 35 import zlib; 37 36 … … 123 122 # Construct the resource list the first time it's queried. 124 123 if self.asRsrcs is None: 125 self.asRsrcs = ['5.3/storage/mergeMedium/t-orig.vdi', '5.3/storage/mergeMedium/t-fixed.vdi', '5.3/storage/mergeMedium/t-resized.vdi']; 124 self.asRsrcs = ['5.3/storage/mergeMedium/t-orig.vdi', 125 '5.3/storage/mergeMedium/t-fixed.vdi', 126 '5.3/storage/mergeMedium/t-resized.vdi']; 126 127 return self.asRsrcs; 127 128 … … 152 153 try: 153 154 oProgressCom = oMedium.resize(cbNewSize); 154 oProgress = vboxwrappers.ProgressWrapper(oProgressCom, self.oVBoxMgr, self.oVBox.oTstDrv, 'Resize medium %s' % (oMedium.name)); 155 oProgress = vboxwrappers.ProgressWrapper(oProgressCom, self.oVBoxMgr, self.oVBox.oTstDrv, 156 'Resize medium %s' % (oMedium.name)); 155 157 oProgress.wait(cMsTimeout = 60 * 1000); 156 158 oProgress.logResult(); … … 228 230 try: 229 231 oProgressCom = oSrcHd.cloneTo(oTgtHd, (vboxcon.MediumVariant_Standard, ), None); 230 oProgress = vboxwrappers.ProgressWrapper(oProgressCom, self.oVBoxMgr, self.oVBox.oTstDrv, 'clone base disk %s to %s' % (oSrcHd.name, oTgtHd.name)); 232 oProgress = vboxwrappers.ProgressWrapper(oProgressCom, self.oVBoxMgr, self.oVBox.oTstDrv, 233 'clone base disk %s to %s' % (oSrcHd.name, oTgtHd.name)); 231 234 oProgress.wait(cMsTimeout = 60 * 1000); 232 235 oProgress.logResult(); … … 242 245 except: 243 246 reporter.logXcpt(); 244 pass; 245 247 246 248 if self.fpApiVer >= 4.0: 247 249 try: … … 316 318 oHd = oSession.createBaseHd(sHddPath, sFmt=oDskFmt.id, cb=oOrigBaseHd.logicalSize); 317 319 #if oSession.createBaseHd can't create disk because it exists, oHd will point to some stub object anyway 318 fRc = fRc and oHd is not None and oHd.logicalSize == oOrigBaseHd.logicalSize;320 fRc = fRc and oHd is not None and (oHd.logicalSize == oOrigBaseHd.logicalSize); 319 321 fRc = fRc and self.cloneMedium(oOrigBaseHd, oHd); 320 322 … … 341 343 sResFilePath = os.path.join(self.oVBox.oTstDrv.sScratchPath, 't_res.vmdk'); 342 344 sResFilePathRaw = os.path.join(self.oVBox.oTstDrv.sScratchPath, 't_res-flat.vmdk'); 343 oResHd = oSession.createBaseHd(sResFilePath, sFmt='VMDK', cb=oOrigWithDiffHd.logicalSize, tMediumVariant = (vboxcon.MediumVariant_Fixed, )); 345 oResHd = oSession.createBaseHd(sResFilePath, sFmt='VMDK', cb=oOrigWithDiffHd.logicalSize, 346 tMediumVariant = (vboxcon.MediumVariant_Fixed, )); 344 347 fRc = oResHd is not None; 345 348 fRc = fRc and self.cloneMedium(oHd, oResHd); 346 349 347 350 uResCrc32 = 0; 348 351 if fRc: 349 352 uResCrc32 = crc32_of_file(sResFilePathRaw); 350 353 if uResCrc32 == uOrigCrc: 351 reporter.log('Snapshot merged successfully. Data of the result medium are correspond to data of the original medium');354 reporter.log('Snapshot merged successfully. Crc32 is correct'); 352 355 fRc = True; 353 356 else: 354 reporter.error('Snapshot merging failed. Data of the result medium not correspond to data of the original medium');357 reporter.error('Snapshot merging failed. Crc32 is invalid'); 355 358 fRc = False; 356 359 357 360 self.oVBox.deleteHdByMedium(oResHd); 358 361 … … 360 363 if oHd is not None: 361 364 oSession.detachHd(sController, iPort = 0, iDevice = 0); 362 365 363 366 oSession.saveSettings(fClose = True); 364 367 if oHd is not None: 365 368 self.oVBox.deleteHdByMedium(oHd); 366 369 367 370 self.deleteVM(oVM); 368 371 return fRc; … … 374 377 if not self.importVBoxApi(): 375 378 return False; 376 379 377 380 sVmName = 'testvm'; 378 381 reporter.testStart(sVmName); … … 381 384 if aoDskFmts is None or len(aoDskFmts) < 1: 382 385 return False; 383 386 384 387 fRc = True; 385 388 for sStorageCtrl in self.asStorageCtrls: … … 397 400 else: 398 401 eStorageCtrl = None; 399 402 400 403 for oDskFmt in aoDskFmts: 401 if (oDskFmt.id in self.asDiskFormats):404 if oDskFmt.id in self.asDiskFormats: 402 405 reporter.testStart('%s' % (oDskFmt.id)); 403 406 fRc = self.test1OneCfg(eStorageCtrl, oDskFmt); … … 405 408 if not fRc: 406 409 break; 407 410 408 411 reporter.testDone(); 409 412 if not fRc: 410 413 break; 411 414 412 415 reporter.testDone(); 413 416 return fRc;
Note:
See TracChangeset
for help on using the changeset viewer.