- 23 8月, 2019 1 次提交
-
-
由 Roman Bolshakov 提交于
In preparation libtool "-module" flag removal, add lib prefix to all mock shared objects. While at it, introduce VIR_TEST_MOCK macros that makes path out of mock name to be used with VIR_TEST_PRELOAD or VIR_TEST_MAIN_PRELOAD. That, hopefully, improves readability, reduces line length and allows to tailor VIR_TEST_MOCK for specific platform if it has shared library suffix different from ".so". Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
-
- 14 8月, 2019 1 次提交
-
-
由 Jiri Denemark 提交于
This reverts commit f38d553e. Gnulib's make coverage (or init-coverage, build-coverage, gen-coverage) is not a 1-1 replacement for the original configure option. Our old --enable-test-coverage seems to be close to gnulib's make build-coverage except gnulib runs lcov in that phase and the build actually fails for me even before lcov is run. And since we want to be able to just build libvirt without running lcov, I suggest reverting to our own implementation. Signed-off-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Acked-By: NEric Blake <eblake@redhat.com>
-
- 13 8月, 2019 1 次提交
-
-
由 Daniel Henrique Barboza 提交于
If /etc/qemu/firmware directory exists, but is not readable then qemuxml2xmltest fails. This is because once domain XML is parsed it is validated. For that domain capabilities are needed. However, when constructing domain capabilities, FW descriptors are loaded and this is the point where the test fails, because it fails to open one of the directories. Fixes: 5b9819ee domain capabilities: Expose firmware auto selection feature Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 27 7月, 2019 3 次提交
-
-
由 Eric Blake 提交于
Similar to virsh-snapshots. Provides decent coverage of the checkpoint API, the test driver implementation, and the virsh access to the API. A later patch will worry about testing that snapshots and checkpoints are mutually exclusive (in part so it is easier to revert that when we finally implement the interaction and lift that restriction). Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Eric Blake 提交于
Add a new file checkpoint_conf.c that performs the translation to and from new XML describing a checkpoint. The code shares a common base class with snapshots, since a checkpoint similarly represents the domain state at a moment in time. Add some basic testing of round trip XML handling through the new code. Of note - this code intentionally differs from snapshots in that XML schema validation is unconditional, rather than based on a public API flag. We have many existing interfaces that still need to add a flag for opt-in schema validation, but those interfaces have existing clients that may not have been producing strictly-compliant XML, or we may still uncover bugs where our RNG grammar is inconsistent with our code (where omitting the opt-in flag allows existing apps to keep working while waiting for an RNG patch). But since checkpoints are brand-new, it's easier to ensure the code matches the schema by always using the schema. If needed, a later patch could extend the API and add a flag to turn on to request schema validation, rather than having it forced (possibly just the validation of the <domain> sub-element during REDEFINE) - but if a user encounters XML that looks like it should be good but fails to validate with our RNG schema, they would either have to upgrade to a new libvirt that adds the new flag, or upgrade to a new libvirt that fixes the RNG schema, which implies adding such a flag won't help much. Also, the redefine flag requires the <domain> sub-element to be present, rather than catering to historical back-compat to older versions. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Prepare for new checkpoint APIs by describing the XML that will represent a checkpoint. The checkpoint XML is modeled heavily after virDomainSnapshotPtr. See the docs for more details. Add testsuite coverage for some minimal uses of the XML (bare minimum, the sample from html, and a full dumpxml, and some counter-examples that should fail schema validation). Although use of the REDEFINE flag will require the <domain> subelement to be present, it is easier for most of the tests to provide counterpart output produced with the NO_DOMAIN flag (particularly since synthesizing a valid <domain> during testing is not trivial). Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 18 7月, 2019 1 次提交
-
-
由 Cole Robinson 提交于
This maps to XML like: <network xmlns:dnsmasq='http://libvirt.org/schemas/network/dnsmasq/1.0'> ... <dnsmasq:options> <dnsmasq:option value="foo=bar"/> <dnsmasq:option value="cname=*.foo.example.com,master.example.com"/> </dnsmasq:options> </network> To dnsmasq config options ... foo=bar cname=*.foo.example.com,master.example.com Reviewed-by: NLaine Stump <laine@laine.org> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 16 7月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
Test if our parsing of interface stats as returned by ovs-vsctl works as expected. To achieve this without having to mock virCommand* I'm separating parsing of stats into a separate function. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 09 7月, 2019 3 次提交
-
-
由 Peter Krempa 提交于
Now that we no longer support sexpr conversion to the internal config we can drop the test. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
The test was the only place calling 'xenFormatSxpr'. Drop it as there are no other users of that code since we've dropped xend support in commit 1dac5fbb. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Eric Blake 提交于
Make it obvious that the domainsnapshotxml2xml test is only run when compiling in support for qemu. Suggested-by: NPeter Krempa <pkrempa@redhat.com> Signed-off-by: NEric Blake <eblake@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
- 20 6月, 2019 1 次提交
-
-
由 Peter Krempa 提交于
Now that we no longer use that functionality we can also drop the tests. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
- 17 6月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
Introduce a virNetworkPortDefPtr struct to represent the data associated with a virtual network port. Add APIs for parsing/formatting XML docs with the data. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 13 6月, 2019 3 次提交
-
-
由 Andrea Bolognani 提交于
At this point, all test programs that use qemu_LDADDS also use LDADDS, so we can remove a bunch of repetition by simply including the latter in the former. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NJim Fehlig <jfehlig@suse.com>
-
由 Andrea Bolognani 提交于
We optionally include QEMU and LXC support in this test and depending on which is enabled (if either is enabled at all) we need to link in different objects. Right now we implicitly depend on the fact that qemu_LDADDS is empty when QEMU is not enabled to get the correct set of objects, but it's better to be explicit about it. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NJim Fehlig <jfehlig@suse.com>
-
由 Andrea Bolognani 提交于
We want all test programs using qemu_LDADDS to also use LDADDS, and cputest is the only existing exception. We can't just replace GNULIB_LIBS with LDADDS though, even though the latter is a superset of the former, because that would result in a linking error due to including the same object twice: /usr/bin/ld: ../src/libvirt_probes.o:.../src/libvirt_probes.o.dtrace-temp.c:141: multiple definition of `libvirt_object_new_semaphore'; ../src/libvirt_probes.o:.../src/libvirt_probes.o.dtrace-temp.c:141: first defined here To work around this, we include both qemu_LDADDS and LDADDS when QEMU support is enabled, and just LDADDS otherwise. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NJim Fehlig <jfehlig@suse.com>
-
- 04 6月, 2019 1 次提交
-
-
由 Jiri Denemark 提交于
The qemuTestParseCapabilitiesArch call would eventually lead to the host CPU being probed via virCPUGetHost. Let's divert this to a mocked version already used by the qemuxml2argvtest. Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 30 5月, 2019 1 次提交
-
-
由 Jim Fehlig 提交于
openSUSE Factory is in the process of enabling Link Time Optimization [0] and stumbled upon missing symbols when linking libqemutestdriver libtool: link: gcc -shared -fPIC -DPIC ../src/libvirt_qemu_probes.o \ -Wl,--whole-archive ../src/.libs/libvirt_driver_qemu_impl.a \ ../src/.libs/libvirt_driver_network_impl.a \ ../src/.libs/libvirt_driver_storage_impl.a -Wl,--no-whole-archive \ -lcap-ng -lgnutls -lnl-route-3 -lnl-3 -ldbus-1 -lselinux -lapparmor \ /usr/lib/libxml2.so -ldl -lz -llzma -lm -lblkid -ltirpc \ -fstack-protector-strong -O2 -fstack-protector-strong -flto=16 -g -O2 \ -fstack-protector-strong -flto=16 -g \ -Wl,-soname -Wl,libqemutestdriver.so -o .libs/libqemutestdriver.so ... /usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `mdir_name' /usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `rpl_ioctl' /usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `rpl_pipe2' /usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `recvfd' /usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `c_strcasecmp' The missing symbols are provided by GNUlib. Add it when linking libqemutestdriver. [0] https://en.opensuse.org/openSUSE:LTOSigned-off-by: NJim Fehlig <jfehlig@suse.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 10 4月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
If a management application wants to use firmware auto selection feature it can't currently know if the libvirtd it's talking to support is or not. Moreover, it doesn't know which values that are accepted for the @firmware attribute of <os/> when parsing will allow successful start of the domain later, i.e. if the mgmt application wants to use 'bios' whether there exists a FW descriptor in the system that describes bios. This commit then adds 'firmware' enum to <os/> element in <domainCapabilities/> XML like this: <enum name='firmware'> <value>bios</value> <value>efi</value> </enum> We can see both 'bios' and 'efi' listed which means that there are descriptors for both found in the system (matched with the machine type and architecture reported in the domain capabilities earlier and not shown here). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Acked-by: NLaszlo Ersek <lersek@redhat.com>
-
- 03 4月, 2019 2 次提交
-
-
由 Daniel P. Berrangé 提交于
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Quite a few of the tests have a need to mock the stat() / lstat() functions and they are taking somewhat different & inconsistent approaches none of which are actually fully correct. This is shown by fact that 'make check' fails on 32-bit hosts. Investigation revealed that the code was calling into the native C library impl, not getting intercepted by our mocks. The POSIX stat() function might resolve to any number of different symbols in the C library. The may be an additional stat64() function exposed by the headers too. On 64-bit hosts the stat & stat64 functions are identical, always refering to the 64-bit ABI. On 32-bit hosts they refer to the 32-bit & 64-bit ABIs respectively. Libvirt uses _FILE_OFFSET_BITS=64 on 32-bit hosts, which causes the C library to transparently rewrite stat() calls to be stat64() calls. Libvirt will never see the 32-bit ABI from the traditional stat() call. We cannot assume this rewriting is done using a macro. It might be, but on GLibC it is done with a magic __asm__ statement to apply the rewrite at link time instead of at preprocessing. In GLibC there may be two additional functions exposed by the headers, __xstat() and __xstat64(). When these exist, stat() and stat64() are transparently rewritten to call __xstat() and __xstat64() respectively. The former symbols will not actally exist in the library at all, only the header. The leading "__" indicates the symbols are a private impl detail of the C library that applications should not care about. Unfortunately, because we are trying to mock replace the C library, we need to know about this internal impl detail. With all this in mind the list of functions we have to mock will depend on several factors - If _FILE_OFFSET_BITS is set, then we are on a 32-bit host, and we only need to mock stat64 and __xstat64. The other stat / __xstat functions exist, but we'll never call them so they can be ignored for mocking. - If _FILE_OFFSET_BITS is not set, then we are on a 64-bit host and we should mock stat, stat64, __xstat & __xstat64. Either may be called by app code. - If __xstat & __xstat64 exist, then stat & stat64 will not exist as symbols in the library, so the latter should not be mocked. The same all applies to lstat() These rules are complex enough that we don't want to duplicate them across every mock file, so this centralizes all the logic in a helper file virmockstathelper.c that should be #included when needed. The code merely need to provide a filename rewriting callback called virMockStatRedirect(). Optionally VIR_MOCK_STAT_HOOK can be defined as a macro if further processing is needed inline. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 25 3月, 2019 1 次提交
-
-
test:///default由 Eric Blake 提交于
Had this been in place earlier, I would have avoided the bugs in commit 0baf6945 and 55c2ab3e. Writing the test required me to extend the power of virsh - creating enough snapshots to cause fanout requires enough input in a single session that adding comments and markers makes it easier to check that output is correct. It's still a bit odd that with test:///default, reverting to a snapshot changes the domain from running to paused (possibly a bug in how the test driver copied from the qemu driver) - but the important part is that the test is reproducible, and any future tweaks we make to snapshot code have less chance of breaking successful command sequences. Signed-off-by: NEric Blake <eblake@redhat.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 15 3月, 2019 1 次提交
-
-
由 Cole Robinson 提交于
We provide a custom configure option --enable-test-coverage and 'make cov' target to generate code coverage reports. However gnulib already provides a 'make coverage' which 'just works' and doesn't require a special configure option. This drops our custom implementation in favor of 'make coverage'. Reports are now output to cov/index.html Reviewed-by: NMartin Kletzander <mkletzan@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 14 3月, 2019 6 次提交
-
-
由 Andrea Bolognani 提交于
Apparently this was necessary in the past because old versions of autoconf/automake didn't make them available, but these days all of the platforms we target include recent enough autotools - as evidenced by the fact that, for example, we already use abs_top_srcdir in tools/ despite the fact that tools/Makefile.am is missing the same boilerplate. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Andrea Bolognani 提交于
We already have code that defines all abs_* variables at the top of tests/Makefile.am, so there is no point in redefining them a second time (using a slightly different shell incantation to boot). Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Andrea Bolognani 提交于
According to the official documentation for autoconf[1], the correct names for these variables are abs_top_{src,build}dir rather than abs_top{src,build}dir; in fact, we're already using the correct names in various places, so let's just make everything nice and consistent. [1] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Preset-Output-Variables.htmlSigned-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Andrea Bolognani 提交于
It's no longer used anywhere. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Andrea Bolognani 提交于
LIBVIRT_DRIVER_DIR is defined as (what is for all intents and purposes equivalent to) "$(abs_top_builddir)/src/.libs"; however, as of commit bc6e2063, virDriverLoadModule() will search that directory automatically, which means passing it through the environment is no longer necessary. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Andrea Bolognani 提交于
It's no longer used as of commit a9694a8e. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 13 3月, 2019 1 次提交
-
-
由 Andrea Bolognani 提交于
We're not using any of the functionality offered by the module at the moment, but we will in just a second. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
- 12 3月, 2019 3 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1564270 Now that everything is prepared for qemu driver we can enable parser feature to allow users define such domains. At the same time, introduce bunch of tests to test the feature. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Michal Privoznik 提交于
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Michal Privoznik 提交于
Test firmware description parsing so far. The test files come from three locations: 1) ovmf-sb-keys.json and ovmf-sb.json come from OVMF package from RHEL-7 (with slight name change to reflect their features in filename too), 2) bios.json and aavmf.json come from example JSON documents from firmware.json from qemu's git (3a0adfc9bf), 3) ovmf.json is then copied from ovmf-sb.json and stripped of SECURE_BOOT and REQUIRES_SMM flags, OVMF path change, description update and machine type expanded for both pc and q35 machine types. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Acked-by: NLaszlo Ersek <lersek@redhat.com>
-
- 11 3月, 2019 1 次提交
-
-
由 Shotaro Gotanda 提交于
So far we are providing the suppressions file with a relative path to valgrind. This apparently doesn't work on some distros like Ubuntu and its derivates. Providing the absolute path fixes the problem. Signed-off-by: NShotaro Gotanda <g.sho1500@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 07 3月, 2019 2 次提交
-
-
由 John Ferlan 提交于
Add a new test for the storage pool capabilities. There will be one test mocked with every backend available (full) and one where only the file system pool is available. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 John Ferlan 提交于
Define a schema for the storage pool capabilities along with a test to show the general format. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 12 2月, 2019 2 次提交
-
-
由 Cole Robinson 提交于
This allows us to mock functions in the libxl driver, like is already possible for the qemu driver Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
由 Cole Robinson 提交于
Every other mock library is named ending in mock.c, move virmocklibxl.c to follow that pattern Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 08 2月, 2019 1 次提交
-
-
由 Peter Krempa 提交于
A lot of code with no real impact and popularity. Remove all the helpers now that the only test case is gone. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
- 30 1月, 2019 1 次提交
-
-
由 John Ferlan 提交于
Commit f2f84b4d added storagepoolxml2argvtest processing; however, it didn't follow alter the else to !WITH_STORAGE and add the source itself to the EXTRA_DIST like the other WITH_STORAGE options for virstorageutiltest and storagevolxml2argvtest. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
-