[libvirt] [PATCH] tests: viriscsitest: make it work on big endian archs

Bjoern Walk bwalk at linux.ibm.com
Wed Aug 1 13:28:50 UTC 2018


Pino Toscano <ptoscano at redhat.com> [2018-08-01, 03:08PM +0200]:
> viriscsitest tries to ensure the interface IQN used is a specific one,
> checking later on that it is the same all during the whole test.  Since
> the IQN generation involves random bytes, viriscsitest got a fake
> virRandomBytes from the virrandommock helper library, setting static
> values.  virRandomBits(), called by virStorageBackendCreateIfaceIQN(),
> always requests 8 random bytes, chopping off the ones not requested by
> the caller -- this meant that on big endian machines it would chop bytes
> from the wrong size of the data buffer, and thus not returning the
> expected numbers.
> 
> As a fix, do not rely on the mock virRandomBytes, but provide an own
> version of it: this version will fill the values in the expected order,
> depending on the endianness of the system.  This way, the result of
> virStorageBackendCreateIfaceIQN() will be what the test actually
> expects.
> 
> Signed-off-by: Pino Toscano <ptoscano at redhat.com>

Tested-by: Bjoern Walk <bwalk at linux.ibm.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 902 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180801/c41042fa/attachment-0001.sig>


More information about the libvir-list mailing list