Changeset 94123 in vbox for trunk/src/VBox/ValidationKit/tests
- Timestamp:
- Mar 8, 2022 1:51:26 PM (3 years ago)
- Location:
- trunk/src/VBox/ValidationKit/tests/storage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/storage/tdStorageRawDrive1.py
r93115 r94123 31 31 # Standard Python imports. 32 32 import os; 33 import re; 33 34 import sys; 34 import re;35 import zlib;36 35 37 36 # Only the main script needs to modify the path. … … 42 41 43 42 # Validation Kit imports. 43 from common import utils; 44 44 from testdriver import reporter; 45 45 from testdriver import base; … … 49 49 from testdriver import vboxwrappers; 50 50 51 52 def crc32_of_file(filepath):53 fileobj = open(filepath,'rb');54 current = 0;55 56 while True:57 buf = fileobj.read(1024 * 1024);58 if not buf:59 break60 current = zlib.crc32(buf, current);61 62 fileobj.close();63 return current % 2**32;64 51 65 52 class tdStorageRawDriveOs(vboxtestvms.BaseTestVm): … … 1212 1199 reporter.error('Download vmdktest-pt.vmdk from guest to host failed'); 1213 1200 else: 1214 uResCrc32 = crc32_of_file(sDstFile);1201 uResCrc32 = utils.calcCrc32OfFile(sDstFile); 1215 1202 if uResCrc32 != action['data-crc'][sHdd]: 1216 1203 fRc = reporter.error('vmdktest-pt.vmdk does not match what was expected'); -
trunk/src/VBox/ValidationKit/tests/storage/tdStorageSnapshotMerging1.py
r93115 r94123 43 43 44 44 # Validation Kit imports. 45 from common import utils; 45 46 from testdriver import reporter; 46 47 from testdriver import base; … … 52 53 if sys.version_info[0] >= 3: 53 54 long = int; # pylint: disable=redefined-builtin,invalid-name 54 55 56 def crc32_of_file(filepath):57 fileobj = open(filepath,'rb');58 current = 0;59 60 while True:61 buf = fileobj.read(1024 * 1024);62 if not buf:63 break64 current = zlib.crc32(buf, current);65 66 fileobj.close();67 return current % 2**32;68 55 69 56 … … 349 336 uResCrc32 = long(0); 350 337 if fRc: 351 uResCrc32 = long( crc32_of_file(sResFilePathRaw));338 uResCrc32 = long(utils.calcCrc32OfFile(sResFilePathRaw)); 352 339 if uResCrc32 == uOrigCrc: 353 340 reporter.log('Snapshot merged successfully. Crc32 is correct');
Note:
See TracChangeset
for help on using the changeset viewer.