Adam Litke has posted comments on this change.

Change subject: storagetestlib: qemu chain verification
......................................................................


Patch Set 3: Verified+1

(5 comments)

https://gerrit.ovirt.org/#/c/60999/2/tests/storagetestlib.py
File tests/storagetestlib.py:

Line 290:         raise ChainVerificationError("Verification of volume %s 
failed. "
Line 291:                                      "Pattern 0x%x not found at 
offset %s" %
Line 292:                                      (path, pattern, offset))
Line 293: 
Line 294: 
> This fails if you rebase on master:
Done
Line 295: def write_qemu_chain(vol_list):
Line 296:     # Starting with the base volume in vol_list, write to the chain 
in a
Line 297:     # pattern like the following:
Line 298:     #


Line 290:         raise ChainVerificationError("Verification of volume %s 
failed. "
Line 291:                                      "Pattern 0x%x not found at 
offset %s" %
Line 292:                                      (path, pattern, offset))
Line 293: 
Line 294: 
> pattern must be a number now, so just use 0xf0 + i
Done
Line 295: def write_qemu_chain(vol_list):
Line 296:     # Starting with the base volume in vol_list, write to the chain 
in a
Line 297:     # pattern like the following:
Line 298:     #


Line 307:         offset = "{}k".format(i)
Line 308:         pattern = 0xf0 + i
Line 309:         qemu_pattern_write(vol.volumePath, vol_fmt, offset=offset,
Line 310:                            len='1k', pattern=pattern)
Line 311: 
> Same, remove str()
Done
Line 312: 
Line 313: def verify_qemu_chain(vol_list):
Line 314:     # Check the integrity of a volume chain by reading the leaf volume
Line 315:     # and verifying the pattern written by write_chain.  Also, check 
each


Line 315:     # and verifying the pattern written by write_chain.  Also, check 
each
Line 316:     # volume in the chain to ensure it contains the correct data.
Line 317:     top_vol = vol_list[-1]
Line 318:     top_vol_fmt = sc.fmt2str(top_vol.getFormat())
Line 319:     for i, vol in enumerate(vol_list):
> This works only because we tested that the pattern does not exists in the p
Done
Line 320:         offset = "{}k".format(i)
Line 321:         pattern = 0xf0 + i
Line 322: 
Line 323:         # Check that the correct pattern can be read through the top 
volume


Line 322: 
Line 323:         # Check that the correct pattern can be read through the top 
volume
Line 324:         qemu_pattern_verify(top_vol.volumePath, top_vol_fmt, 
offset=offset,
Line 325:                             len='1k', pattern=pattern)
Line 326: 
> Nice!
Thanks!
Line 327:         # Check the volume where the pattern was originally written
Line 328:         vol_fmt = sc.fmt2str(vol.getFormat())
Line 329:         qemu_pattern_verify(vol.volumePath, vol_fmt, offset=offset, 
len='1k',
Line 330:                             pattern=pattern)


-- 
To view, visit https://gerrit.ovirt.org/60999
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I88008b26f340a87466e9fa98ffb34b5df7509390
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <ali...@redhat.com>
Gerrit-Reviewer: Adam Litke <ali...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org

Reply via email to