Commit Graph

10 Commits

Author SHA1 Message Date
Vasiliy Tolstov
6e244c659f qemu domain allow to set ip address, peer address and route
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2016-04-07 18:34:48 +01:00
Michal Privoznik
950a90d489 qemuxml2argvtest: Adapt to ethernet automatic tap creation
After 9c17d665fd the tap device for ethernet network type is
automatically precreated before spawning qemu. Problem is, the
qemuxml2argvtest wasn't updated and thus is failing. Because of
all the APIs that new code is calling, I had to mock a lot. Also,
since the tap FDs are labeled separately from the rest of the
devices/files I had to enable NOP security driver for the test
too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-03-24 07:38:46 +01:00
Michal Privoznik
4b527c1acf qemuxml2argv: Mock virSCSIDeviceGetSgName
When constructing SCSI hostdev command line for qemu, the
/sys/bus/scsi/devices/... dir is scanned. Unfortunately, even in
the tests. This is needed to determine the name of SCSI device to
passthrough to qemu, because in the domain XML we were given its
address instead. Anyway, we should not be touching live system
data in our test suite as it produced unpredictable results. The
test is regressing from 1e9a083742 on.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-03-23 12:50:19 +01:00
Peter Krempa
ace1ee225f test: qemuxml2argv: Mock virMemoryMaxValue to remove 32/64 bit difference
Always return LLONG_MAX even on 32 bit systems. The limitation
originates from our use of "unsigned long" in several APIs. The internal
data type is unsigned long long. Make the test suite deterministic by
removing the architecture difference.

Flaw was introduced in 645881139b where
I've added a test that uses too large numbers.
2015-12-11 12:23:38 +01:00
Stefan Berger
5ed7afa9de tpm: adapt sysfs cancel path for new TPM driver
This patch addresses BZ 1244895.

Adapt the sysfs TPM command cancel path for the TPM driver that
does not use a miscdevice anymore since Linux 4.0. Support old
and new paths and check their availability.

Add a mockup for the test cases to avoid the testing for
availability of the cancel path.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-17 20:52:13 -05:00
Daniel P. Berrange
b38da58423 Make tests independant of system page size
Some code paths have special logic depending on the page size
reported by sysconf, which in turn affects the test results.
We must mock this so tests always have a consistent page size.
2015-02-02 20:27:43 +00:00
Martin Kletzander
c63ef0452b numa: split util/ and conf/ and support non-contiguous nodesets
This is a reaction to Michal's fix [1] for non-NUMA systems that also
splits out conf/ out of util/ because libvirt_util shouldn't require
libvirt_conf if it is the other way around.  This particular use case
worked, but we're trying to avoid it as mentioned [2], many times.

The only functions from virnuma.c that needed numatune_conf were
virDomainNumatuneNodesetIsAvailable() and virNumaSetupMemoryPolicy().
The first one should be in numatune_conf as it works with
virDomainNumatune, the second one just needs nodeset and mode, both of
which can be passed without the need of numatune_conf.

Apart from fixing that, this patch also fixes recently added
code (between commits d2460f85^..5c8515620) that doesn't support
non-contiguous nodesets.  It uses new function
virNumaNodesetIsAvailable(), which doesn't need a stub as it doesn't use
any libnuma functions, to check if every specified nodeset is available.

[1] https://www.redhat.com/archives/libvir-list/2014-November/msg00118.html
[2] http://www.redhat.com/archives/libvir-list/2011-June/msg01040.html

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-11-06 15:13:55 +01:00
Chen Fan
902864184e numatune: add check for numatune nodeset range
There was no check for 'nodeset' attribute in numatune-related
elements.  This patch adds validation that any nodeset specified does
not exceed maximum host node.

Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
2014-11-04 07:03:36 +01:00
Michal Privoznik
35b7088534 qemuxml2argvmock: Mock time() on non-linux platforms too
The qemuxml2argvtest is run on more platforms than linux. For instance
FreeBSD. On these platforms we are, however, not mocking time() which
results in current time being fetched from system and hence tests number
32 and 33 failing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-02-06 15:15:10 +01:00
Michal Privoznik
e505db0f6c qemuxml2argvtest: Test localtime clock basis
When trying to introduce a test for previous patch, I've
noticed that the command line is constructed using current
time. This won't work in our test suite (unless you guys
wants to set a specific time prior to each test run :) ).
Therefore we need to mock calls to time(2) to return the
same value every time it's called.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-02-06 08:22:22 +01:00