1. 27 3月, 2017 1 次提交
    • M
      tests: Add virnumamock · 9368095b
      Martin Kletzander 提交于
      All mocked functions are related to numactl/virNuma and rely only on
      virsysfs, so the paths they touch can be nicely controlled.  And
      because it is so nicely self-contained NUMA mock, it is named
      numamock (instead of naming it after the test that will use it first).
      
      We need top level API mock because some APIs might call libnuma
      directly, e.g. virNumaIsAvailable(), virNumaGetMaxNode().
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      9368095b
  2. 26 3月, 2017 1 次提交
    • R
      domaincapstest: add bhyve caps test · 74cfb5bb
      Roman Bogorodskiy 提交于
       * Extract filling bhyve capabilities from virBhyveDomainCapsBuild()
         into a new function virBhyveDomainCapsFill() to make testing
         easier by not having to mock firmware directory listing and
         hypervisor capabilities probing
       * Also, just presence of the firmware files is not sufficient
         to enable os.loader.supported, hypervisor should support UEFI
         boot too
       * Add tests to domaincapstest for the main caps possible flows:
          - when UEFI bootrom is supported
          - when video (fbus) is supported
          - neither of above is supported
      74cfb5bb
  3. 14 3月, 2017 1 次提交
    • J
      qemu: Report better host-model CPUs in domain caps · e958fb5b
      Jiri Denemark 提交于
      One of the main reasons for introducing host-model CPU definition in a
      domain capabilities XML was the inability to express disabled features
      in a host capabilities XML. That is, when a host CPU is, e.g., Haswell
      without x2apic support, host capabilities XML will have to report it as
      Westmere + a bunch of additional features., but we really want to use
      Haswell - x2apic when creating a host-model CPU.
      
      Unfortunately, I somehow forgot to do the last step and the code would
      just copy the CPU definition found in the host capabilities XML. This
      changed recently for new QEMU versions which allow us to query host CPU,
      but any slightly older QEMU will not benefit from any change I did. This
      patch makes sure the right CPU model is filled in the domain
      capabilities even with old QEMU.
      
      The issue was reported in
      https://bugzilla.redhat.com/show_bug.cgi?id=1426456Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      e958fb5b
  4. 22 2月, 2017 1 次提交
    • P
      storage: Turn storage backends into dynamic modules · 0a6d3e51
      Peter Krempa 提交于
      If driver modules are enabled turn storage driver backends into
      dynamically loadable objects. This will allow greater modularity for
      binary distributions, where heavyweight dependencies as rbd and gluster
      can be avoided by selecting only a subset of drivers if the rest is not
      necessary.
      
      The storage modules are installed into 'LIBDIR/libvirt/storage-backend/'
      and users can override the location by using
      'LIBVIRT_STORAGE_BACKEND_DIR' environment variable.
      
      rpm based distros will at this point install all the backends when
      libvirt-daemon-driver-storage package is installed.
      0a6d3e51
  5. 10 2月, 2017 3 次提交
  6. 20 1月, 2017 1 次提交
    • M
      qemu: set default vhost-user ifname · 57b5e27d
      Michal Privoznik 提交于
      Based on work of Mehdi Abaakouk <sileht@sileht.net>.
      
      When parsing vhost-user interface XML and no ifname is found we
      can try to fill it in in post parse callback. The way this works
      is we try to make up interface name from given socket path and
      then ask openvswitch whether it knows the interface.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      57b5e27d
  7. 19 1月, 2017 1 次提交
    • J
      tests: fix compilation of shunloadtest · b018ada3
      Jim Fehlig 提交于
      While local builds succeed fine, a build worker building in a
      chroot environment is encountering the following error with
      libvirt 3.0.0 release candidates
      
      [  162s] shunloadtest.o: In function `main':
      [  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:110: undefined reference to `dlopen'
      [  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:114: undefined reference to `dlsym'
      [  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:133: undefined reference to `dlclose'
      [  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:111: undefined reference to `dlerror'
      [  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:115: undefined reference to `dlerror'
      [  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:116: undefined reference to `dlclose'
      
      Fix by appending DLOPEN_LIBS to shunloadtest_LDADD.
      b018ada3
  8. 18 1月, 2017 1 次提交
  9. 02 1月, 2017 3 次提交
  10. 06 12月, 2016 2 次提交
    • M
      nss: Introduce libvirt-guest module · 22f7ceb6
      Michal Privoznik 提交于
      So far the NSS module looks up only hostnames as provided by
      guests themselves. However, there are some cases where this is
      not enough: e.g. when there's a fresh new guest being installed
      (with some generic hostname) say from a live ISO image; or some
      (older) systems don't advertise their hostname in DHCP
      transactions at all.
      In cases like that it would be helpful if we translate domain
      name as seen by libvirt too so that users can:
      
        # virsh start $dom && ssh $dom
      
      In order to achieve that new libvirt-guest module is introduced,
      while older libvirt module maintains its current behaviour (that
      is translating guest provided names into IP addresses).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      22f7ceb6
    • M
      util: Introduce virMACMap module · 86980bc7
      Michal Privoznik 提交于
      This module will be used to track:
      
        <domain, mac address list>
      
      pairs. It will be important to know these mappings without
      libvirt connection (that is from a JSON file), because NSS
      module will use those to provide better host name translation.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      86980bc7
  11. 24 11月, 2016 1 次提交
  12. 14 9月, 2016 1 次提交
  13. 16 8月, 2016 1 次提交
    • R
      tests: fix domaincapstest linking for libxl · da5dfd0e
      Roman Bogorodskiy 提交于
      Commit 11567cf6 added some libxl tests into domaincapstest and
      added libvirt_driver_libxl_impl.la to domaincapstest_LDADD.
      
      This causes link fail on systems without GNU regex implementation:
      
      gmake[2]: Entering directory '/usr/home/novel/code/libvirt/tests'
        CCLD     domaincapstest
        ../src/.libs/libvirt_driver_libxl_impl.a(libvirt_driver_libxl_impl_la-libxl_capabilities.o):
        In function `libxlMakeCapabilities':
        libxl/libxl_capabilities.c:(.text+0x6b2): undefined reference to
        `rpl_regcomp'
        libxl/libxl_capabilities.c:(.text+0x6d0): undefined reference to
        `rpl_regerror'
        libxl/libxl_capabilities.c:(.text+0x803): undefined reference to
        `rpl_regexec'
        libxl/libxl_capabilities.c:(.text+0xa58): undefined reference to
        `rpl_regfree'
        clang-3.8: error: linker command failed with exit code 1 (use -v to
        see invocation)
      
      This happens because on these system it tries to use gnulib's builtin
      regex implementation, but doesn't link to gnulib.
      
      Fix by adding $(GNULIB_LIBS) along with libvirt_driver_libxl_impl.la to
      domaincapstest_LDADD.
      da5dfd0e
  14. 12 7月, 2016 3 次提交
  15. 11 7月, 2016 1 次提交
  16. 01 7月, 2016 1 次提交
  17. 21 6月, 2016 4 次提交
    • J
      Drop virrandomtest · 031b477b
      Ján Tomko 提交于
      This test only checks if mocking of virRandomBytes works correctly.
      
      Drop it to avoid infinite recursion by testing the test suite.
      031b477b
    • J
      Remove virsh-synopsis · 79d3fc85
      Ján Tomko 提交于
      This tests checks that the first word after SYNOPSIS
      in virsh help ${command} output is ${command}.
      
      This was only good to check that the command option structures
      are valid, which is now served by 'virsh self-test'.
      79d3fc85
    • J
      Introduce virsh self-test · 920ab8bd
      Ján Tomko 提交于
      A new hidden command for virsh that will iterate over
      all command groups and commands and print help for every single one.
      
      This involves running vshCmddefOptParse so we can get an error if
      one of the command's option structure is invalid.
      920ab8bd
    • J
      Remove virsh-all · 9f95593d
      Ján Tomko 提交于
      Since e8ac4a79 this test wastes some CPU cycles by blindly trying to
      run almost every virsh command, blindly throwing away the output
      and the return value and returning success if 'virsh help' successfully
      returned at least one command.
      
      Drop it completely.
      9f95593d
  18. 14 6月, 2016 1 次提交
  19. 10 6月, 2016 1 次提交
  20. 09 6月, 2016 1 次提交
    • J
      tests: Add CPU detection tests · 3704b900
      Jiri Denemark 提交于
      So far we only test CPUID -> CPU def conversion on artificial CPUID data
      computed from another CPU def. This patch adds the infrastructure to
      test this conversion on real data gathered from a host CPU and two
      helper scripts for adding new test data:
      
      - cpu-gather.sh runs cpuid tool and qemu-system-x86_64 to get CPUID data
        from the host CPU; this is what users can be asked to run if they run
        into an issue with host CPU detection in libvirt
      
      - cpu-parse.sh takes the data generated by cpu-gather.sh and creates
        data files for CPU detection tests
      
      The CPUID data queried from QEMU will eventually switch to the format
      used by query-host-cpu QMP command once QEMU implements it. Until then
      we just spawn QEMU with -cpu host and query the guest CPU in QOM. They
      should both provide the same CPUID results, but query-host-cpu does not
      require any guest CPU to be created by QEMU.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      3704b900
  21. 08 6月, 2016 2 次提交
  22. 20 5月, 2016 3 次提交
    • M
      tests: Link virtestmock with probes · 997be5c2
      Michal Privoznik 提交于
      I've encountered this error while trying out this feature on some
      systems:
      
        $ VIR_TEST_FILE_ACCESS=1 ./virhashtest \
       libvirt.git/tests/.libs/lt-virhashtest: \
      symbol lookup error: libvirt.git/tests/.libs/virtestmock.so: \
      undefined symbol: libvirt_event_poll_purge_timeout_semaphore
      
      Problem is, linking just libvirt_utils to virmock.la is not
      enough. We might need to link libvirt_probes.lo too.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      997be5c2
    • J
      tests: Add mock for virRandomBytes · 6a3f4121
      John Ferlan 提交于
      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.
      6a3f4121
    • M
      tests: Add forgotten backslash · ee7e99fe
      Michal Privoznik 提交于
      While introducing virtestmock.la, I've forgotten to add '\' at
      the end of one line leaving our Makefile.am mangled. Fortunately,
      the only thing that comes after is '$(NULL)' so nothing is
      terribly broken.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      ee7e99fe
  23. 14 5月, 2016 3 次提交
    • M
      tests: Introduce check-file-access.pl · 4b3a46ca
      Michal Privoznik 提交于
      This script will check output generated by virtestmock against a
      white list. All non matching records found are printed out. So
      far, the white list is rather sparse at the moment.
      This test should be ran only after all other tests finished, and
      should cleanup the temporary file before their execution. Because
      I'm unable to reflect these requirements in Makefile.am
      correctly, I've introduced new target 'check-access' under which
      this test is available.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4b3a46ca
    • M
      virtestmock: Print invalid file accesses into a file · 6326865e
      Michal Privoznik 提交于
      All the accesses to files outside our build or source directories
      are now identified and appended into a file for later processing.
      The location of the file that contains all the records can be
      controlled via VIR_TEST_FILE_ACCESS env variable and defaults to
      abs_builddir "/test_file_access.txt".
      
      The script that will process the access file is to be added in
      next commit.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      6326865e
    • M
      tests: Introduce global mock library · 47d2dc83
      Michal Privoznik 提交于
      The intent is that this library is going to be called every time
      to check if we are not touching anything outside srcdir or
      builddir.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      47d2dc83
  24. 10 5月, 2016 1 次提交
  25. 05 5月, 2016 1 次提交
    • J
      tests: Add qemucapsprobe helper · f943a28c
      Jiri Denemark 提交于
      Adding new *.replies files for qemucapabilitiestest or updating the
      files when libvirt adds an additional QMP command into the probing
      process is quite painful. The goal of the new qemucapsprobe command is
      to make this process as easy as
      
          tests/qemucapsprobe /path/to/qemu/binary >caps.replies
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      f943a28c