Commit Graph

4 Commits

Author SHA1 Message Date
John Ferlan
4b6ee784de tests: Add new fchosttest tests for management of a vHBA
Add a test that will mimic creation and destruction of a vHBA
by using node device XML. The design will allow for testing the
multiple mechanisms.

The first test uses just <parent> in the node device XML. This is
somewhat similar to the existing objecteventtest, except that this
test will not provide input wwnn/wwpn's (similar to how the process
is described for the the libvirt wiki).

This requires mocking the virRandomGenerateWWN since parsing the
input XML (virNodeDevCapSCSIHostParseXML) requires either a provided
wwnn/wwpn in the XML or the ability to randomly generate the wwnn/wwpn.
2017-02-19 06:45:09 -05:00
Eric Blake
fc9cc507b8 build: virrandommock.c not needed on mingw
We can't mock tests on Mingw, which lacks dlopen() and friends;
follow the paradigms used in other mock files of conditionally
compiling nothing when not building for Linux.

Signed-off-by: Eric Blake <eblake@redhat.com>
2016-07-12 08:51:15 -06:00
Ján Tomko
743bda062b tests: mock gnutls_dh_params_generate2
This function generates some big random numbers.

Cache the result and supply it to any subsequent generate2 calls.
2016-06-20 18:12:53 +02:00
John Ferlan
6a3f4121a5 tests: Add mock for virRandomBytes
Create a mock for virRandomBytes to generate a not so random value.
This should be usable by other tests that need a not so random number
to be generated by including the virrandommock at preload.

The "random number" generated is based upon the size of the expected
stream of bytes being returned where each byte in the result gets
the index of the array - hence a 4 byte array returns 0x00010203.
2016-05-20 09:36:28 -04:00