|
15 | 15 |
|
16 | 16 | PV_FOR_VG_DATA = "/dev/mapper/3600a098038314650465d523777417142" |
17 | 17 |
|
| 18 | +VHD_UTIL = '/usr/bin/vhd-util' |
| 19 | + |
| 20 | +TEST_VHD_HEADER = """ |
| 21 | +VHD Footer Summary: |
| 22 | +------------------- |
| 23 | +Cookie : conectix |
| 24 | +Features : (0x00000002) <RESV> |
| 25 | +File format version : Major: 1, Minor: 0 |
| 26 | +Data offset : 512 |
| 27 | +Timestamp : Mon Apr 14 09:32:51 2025 |
| 28 | +Creator Application : 'tap' |
| 29 | +Creator version : Major: 1, Minor: 3 |
| 30 | +Creator OS : Unknown! |
| 31 | +Original disk size : 49096 MB (51480887296 Bytes) |
| 32 | +Current disk size : 49096 MB (51480887296 Bytes) |
| 33 | +Geometry : Cyl: 24644, Hds: 16, Sctrs: 255 |
| 34 | + : = 49095 MB (51480330240 Bytes) |
| 35 | +Disk type : Dynamic hard disk |
| 36 | +Checksum : 0xffffed34|0xffffed34 (Good!) |
| 37 | +UUID : e21541f1-0daf-4394-9d80-3c0bfe957b1b |
| 38 | +Saved state : No |
| 39 | +Hidden : 0 |
| 40 | +
|
| 41 | +VHD Header Summary: |
| 42 | +------------------- |
| 43 | +Cookie : cxsparse |
| 44 | +Data offset (unusd) : 18446744073709551615 |
| 45 | +Table offset : 1536 |
| 46 | +Header version : 0x00010000 |
| 47 | +Max BAT size : 24548 |
| 48 | +Block size : 2097152 (2 MB) |
| 49 | +Parent name : |
| 50 | +Parent UUID : 00000000-0000-0000-0000-000000000000 |
| 51 | +Parent timestamp : Sat Jan 1 00:00:00 2000 |
| 52 | +Checksum : 0xfffff334|0xfffff334 (Good!) |
| 53 | +
|
| 54 | +VHD Batmap Summary: |
| 55 | +------------------- |
| 56 | +Batmap offset : 100352 |
| 57 | +Batmap size (secs) : 6 |
| 58 | +Batmap version : 0x00010002 |
| 59 | +Checksum : 0xfffeb525|0xfffeb525 (Good!) |
| 60 | +""" |
| 61 | + |
| 62 | + |
18 | 63 |
|
19 | 64 | class SMLog(object): |
20 | 65 | def __call__(self, *args): |
@@ -318,6 +363,12 @@ def test_snapshotof_success(self, |
318 | 363 | mock_lock, |
319 | 364 | mock_ipc, |
320 | 365 | mock_cleanup): |
| 366 | + |
| 367 | + def test_function(args, inp): |
| 368 | + assert args[1] == "read" |
| 369 | + return 0, TEST_VHD_HEADER, "" |
| 370 | + |
| 371 | + context.add_executable(VHD_UTIL, test_function) |
321 | 372 | sr_uuid = str(uuid.uuid4()) |
322 | 373 | self.stubout('sm.drivers.LVHDSR.lvutil._checkVG', autospec=True) |
323 | 374 | mock_lvm_cache = self.stubout('sm.drivers.LVHDSR.lvmcache.LVMCache') |
|
0 commit comments