1. 14 2月, 2014 2 次提交
  2. 13 2月, 2014 1 次提交
    • C
      LXC driver: started implementing connectDomainXMLFromNative · 7195c807
      Cédric Bosdonnat 提交于
      This function aims at converting LXC configuration into a libvirt
      domain XML description to help users migrate from LXC to libvirt.
      
      Here is an example of how the lxc configuration works:
      virsh -c lxc:/// domxml-from-native lxc-tools /var/lib/lxc/migrate_test/config
      
      It is possible that some parts couldn't be properly mapped into a
      domain XML fragment, so users should carefully review the result
      before creating the domain.
      
      fstab files in lxc.mount lines will need to be merged into the
      configuration file as lxc.mount.entry.
      
      As we can't know the amount of memory of the host, we have to set a
      default value for max_balloon that users will probably want to adjust.
      7195c807
  3. 11 2月, 2014 1 次提交
  4. 06 2月, 2014 1 次提交
    • M
      qemuxml2argvtest: Test localtime clock basis · e505db0f
      Michal Privoznik 提交于
      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: NMichal Privoznik <mprivozn@redhat.com>
      e505db0f
  5. 04 2月, 2014 2 次提交
    • J
      tests: Add test for new virkmod functions · 02bf6568
      John Ferlan 提交于
      Adding tests for new virKMod{Config|Load|Unload}() API's.
      
      A test for virKModIsBlacklisted() would require some setup which cannot
      be assumed.
      02bf6568
    • M
      virnetdevbandwidthtest: Link with libxml2 · defec0de
      Michal Privoznik 提交于
      I've received a notice over IRC that on some systems, the
      virnetdevbandwidthtest is not linked with libxml:
      
        /usr/bin/ld: virnetdevbandwidthtest.o: undefined reference to symbol 'xmlStrEqual@@LIBXML2_2.4.30'
        /usr/lib/x86_64-linux-gnu/libxml2.so.2: error adding symbols: DSO missing from command line
      
      Trivial way avoiding this is to add LIBXML_LIBS to
      virnetdevbandwidthtest_LDADD.
      defec0de
  6. 30 1月, 2014 1 次提交
  7. 27 1月, 2014 1 次提交
  8. 10 12月, 2013 1 次提交
  9. 28 11月, 2013 2 次提交
    • D
      Pull lxcContainerGetSubtree out into shared virfile module · d45b833d
      Daniel P. Berrange 提交于
      Move the code for lxcContainerGetSubtree into the virfile
      module creating 2 new functions
      
        int virFileGetMountSubtree(const char *mtabpath,
                                   const char *prefix,
                                   char ***mountsret,
                                   size_t *nmountsret);
        int virFileGetMountReverseSubtree(const char *mtabpath,
                                          const char *prefix,
                                          char ***mountsret,
                                          size_t *nmountsret);
      
      Add a new virfiletest.c test case to validate the new code.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d45b833d
    • E
      tests: guarantee abs_srcdir in all C tests · 0aa873d7
      Eric Blake 提交于
      While trying to debug a failure of virpcitest during 'make distcheck',
      I noticed that with a VPATH build, 'cd tests; ./virpcitest' fails for
      an entirely different reason.  To reproduce the distcheck failure, I
      had to run 'cd tests; abs_srcdir=/path/to/src ./virpcitest'.  But we
      document in HACKING that all of our tests are supposed to be runnable
      without requiring extra environment variables.
      
      The solution: hardcode the location of srcdir into the just-built
      binaries, rather than requiring make to prepopulate environment
      variables.  With this, './virpcitest' passes even in a VPATH build
      (provided that $(srcdir) is writable; a followup patch will fix the
      conditions required by 'make distcheck').  [Note: the makefile must
      still pass on directory variables to the test environment of shell
      scripts, since those aren't compiled.  So while this solves the case
      of a compiled test, it still requires environment variables to pass
      a VPATH build of any shell script test case that relies on srcdir.]
      
      * tests/Makefile.am (AM_CFLAGS): Define abs_srcdir in all compiled
      tests.
      * tests/testutils.h (abs_srcdir): Quit declaring.
      * tests/testutils.c (virtTestMain): Rely on define rather than
      environment variable.
      * tests/virpcimock.c (pci_device_new_from_stub): Rely on define.
      * tests/cputest.c (mymain): Adjust abs_top_srcdir default.
      * tests/qemuxml2argvtest.c (mymain): Likewise.
      * tests/qemuxmlnstest.c (mymain): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      0aa873d7
  10. 08 11月, 2013 1 次提交
  11. 07 11月, 2013 1 次提交
  12. 05 11月, 2013 1 次提交
    • M
      virpcitest: Test virPCIDeviceDetach · 25527ae2
      Michal Privoznik 提交于
      This commit introduces yet another test under virpcitest:
      virPCIDeviceDetach. However, in order to be able to do this, the
      virpcimock needs to be extended to model the kernel behavior on PCI
      device binding and unbinding (create 'driver' symlinks under the device
      tree, check for device ID in driver's ID table, etc.)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      25527ae2
  13. 04 11月, 2013 1 次提交
  14. 22 10月, 2013 1 次提交
    • M
      tests: Use lv_abs_top_builddir instead of bare abs_top_builddir · 9eb68903
      Michal Privoznik 提交于
      As stated in the comment above introduction of the lv_abs_top_builddir
      variable, older automake doesn't provide abs_top_builddir variable.
      Hence, we are creating our own one with lv_ prefix. However, when
      exporting env variables to the tests, the variables are not evaluated
      but only substituted. Hence:
      
        LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs"
      
      is set to "/src/.libs" with old automake (even though we *think* we've
      set the $abs_top_builddir variable just a few line above).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      9eb68903
  15. 15 10月, 2013 1 次提交
  16. 14 10月, 2013 1 次提交
    • D
      Fix flaw in detecting log format · 5787f0b9
      Daniel P. Berrange 提交于
      The log message regex has been
      
      [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}\+[0-9]{4}: [0-9]+: debug|info|warning|error :
      
      The precedence of '|' is high though, so this is equivalent to matching
      
         [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}\+[0-9]{4}: [0-9]+: debug
      
      Or
      
         info
      
      Or
      
         warning
      
      Or
      
         error :
      
      Which is clearly not what it should have done. This caused the code to
      skip over things which are not log messages. The solution is to simply
      add brackets.
      
      A test case is also added to validate correctness.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      5787f0b9
  17. 05 10月, 2013 1 次提交
    • E
      build: fix build --without-remote · bdc55cc7
      Eric Blake 提交于
      I tried to test ./configure --without-lxc --without-remote.
      First, the build failed with some odd errors, such as an
      inability to build xen, or link failures for virNetTLSInit.
      But when you think about it, once there is no remote code,
      all of libvirtd is useless, any stateful driver that depends
      on libvirtd is also not worth compiling, and any libraries
      used only by RPC code are not needed.  So I patched
      configure.ac to make for some saner defaults when an
      explicit disable is attempted.  Similarly, since we have
      migrated virnetdevbridge into generic code, the workaround
      for Linux kernel stupidity must not depend on stateful
      drivers being in use.
      
      Then there's 'make check' that needs segregation.
      
      Wow - quite a bit of cleanup to make --without-remote useful :)
      
      * configure.ac: Let --without-remote toggle defaults on stateful
      drivers and other libraries.  Pick up Linux kernel workarounds
      even when qemu and lxc are not being compiled.
      * tests/Makefile.am (test_programs): Factor out programs that
      require remote.
      * src/libvirt_private.syms (rpc/virnet*.h): Move...
      * src/libvirt_remote.syms: ...into new file.
      * src/Makefile.am (SYM_FILES): Ship new syms file.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      bdc55cc7
  18. 01 10月, 2013 1 次提交
    • M
      tests: Introduce qemucapabilitiestest · 63857eb4
      Michal Privoznik 提交于
      This test is there to ensure that our capabilities detection code isn't
      broken somehow.
      
      How to gather test data:
      
      Firstly, the data is split into two separate files. The former (with
      suffix .replies) contains all the qemu replies. This is very fragile as
      introducing a new device can mean yet another monitor command and hence
      edit of this file in the future. But there's no better way of doing
      this. To get this data simply turn on debug logs and copy all the
      QEMU_MONITOR_IO_PROCESS lines. But be careful to not copy incomplete
      ones (yeah, we report some incomplete lines too). Long story short, at
      the libvirtd startup, a dummy qemu is spawn to get all the capabilities.
      
      The latter (with suffix .caps) contains capabilities XML. Just start a
      domain and copy the corresponding part from its state XML file.
      Including <qemuCaps> tag.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      63857eb4
  19. 28 9月, 2013 1 次提交
  20. 27 9月, 2013 1 次提交
  21. 24 9月, 2013 1 次提交
  22. 20 9月, 2013 1 次提交
  23. 17 9月, 2013 1 次提交
  24. 10 9月, 2013 1 次提交
    • E
      build: use library rather than cross-directory compilation · 012c25e8
      Eric Blake 提交于
      If we use subdir-objects with automake, any reference to a
      cross-directory .c file will result in automake creating
      rules that track dependency in the cross directory.  But this
      presents a problem during 'make distclean' - if the cross
      directory is cleaned up first, then the daemon directory will
      be left with dangling references to .Po dependency files that
      no longer exist.
      
      Meanwhile, referring to the cross-directory .c file means
      that we are compiling the file twice - once in src, and once
      in daemon.  Better is to compile just once in src into a
      convenience library, and then use that library from daemon.
      
      The tests directory had a similar situation of a cross-directory
      .c file; to solve that, we actually need a convenience library.
      
      * daemon/Makefile.am (DAEMON_SOURCES): Drop .c files...
      (libvirtd_LDADD): ...and instead use library.
      (libvirtd_conf_la_SOURCES): Declare a new convenience library.
      (libvirtd_LDFLAGS): Drop duplicate flag.
      * tests/Makefile.am (libvirtdconftest_SOURCES): Drop .c file...
      (libvirtdconftest_LDADD): ..and instead use library.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      012c25e8
  25. 05 9月, 2013 1 次提交
    • E
      build: only run fdstreamtest when libvirtd is built · adf335f0
      Eric Blake 提交于
      An rpm build with client_only set to 1 (for example, RHEL 5 on
      s390, or by modifying libvirt.spec.in) failed with
      
      TEST: fdstreamtest
       1) Stream read blocking                                              ... OK
       2) Stream read non-blocking                                          ... Unexpected EOF block 0 want 128
      FAILED
       3) Stream write blocking                                             ... OK
       4) Stream write non-blocking                                         ... Failed to finish stream: internal error: libvirt:  error : cannot execute binary /home/eblake/rpmbuild/BUILD/libvirt-1.1.1/tests/../src/libvirt_iohelper: No such file or directory
      
      Since the test depends on something that was only built for
      WITH_LIBVIRTD (see src/Makefile.am), we must do the same for
      the test.
      
      * tests/Makefile.am (test_programs): Make fdstreamtest conditional.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      adf335f0
  26. 04 9月, 2013 1 次提交
    • E
      build: enforce makefile conditional style · ec81852f
      Eric Blake 提交于
      Automake has builtin support to prevent botched conditional nesting,
      but only if you use:
      if FOO
      else !FOO
      endif !FOO
      
      An example error message when using the wrong name:
      
      daemon/Makefile.am:378: error: else reminder (LIBVIRT_INIT_SCRIPT_SYSTEMD_TRUE) incompatible with current conditional: LIBVIRT_INIT_SCRIPT_SYSTEMD_FALSE
      daemon/Makefile.am:381: error: endif reminder (LIBVIRT_INIT_SCRIPT_SYSTEMD_TRUE) incompatible with current conditional: LIBVIRT_INIT_SCRIPT_SYSTEMD_FALSE
      
      As our makefiles tend to have quite a bit of nested conditionals,
      it's better to take advantage of the benefits of the build system
      double-checking that our conditionals are well-nested, but that
      requires a syntax check to enforce our usage style.
      
      Alas, unlike C preprocessor and spec files, we can't use indentation
      to make it easier to see how deeply nesting goes.
      
      * cfg.mk (sc_makefile_conditionals): New rule.
      * daemon/Makefile.am: Enforce the style.
      * gnulib/tests/Makefile.am: Likewise.
      * python/Makefile.am: Likewise.
      * src/Makefile.am: Likewise.
      * tests/Makefile.am: Likewise.
      * tools/Makefile.am: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ec81852f
  27. 28 8月, 2013 1 次提交
  28. 22 8月, 2013 2 次提交
  29. 21 8月, 2013 1 次提交
    • C
      tests: fix building without xattr support · d7c4e003
      Claudio Bley 提交于
      Only compile securityselinuxhelper.c if xattr support was detected to
      avoid this error:
      
      securityselinuxhelper.c:34:24: fatal error: attr/xattr.h: No such file
      or directory compilation terminated.
      
      Since all SELinux tests depend upon the securityselinuxhelper library,
      these test programs are now only build when xattr support is
      available.
      d7c4e003
  30. 13 8月, 2013 3 次提交
    • G
      Directly link against needed libraries · f7904571
      Guido Günther 提交于
      The Linux build revealed another missing direct link target, this time
      against selinux libs:
      
          http://honk.sigxcpu.org:8001/view/libvirt/job/libvirt-build-debian-sid-amd64/9/console
      f7904571
    • G
      Directly link against needed libraries · 6ba0b7d2
      Guido Günther 提交于
      otherwise having a strict --no-copy-dt-needed-entries fails in several
      places like:
      
          CCLD     virdbustest
          /usr/bin/ld: virdbustest-virdbustest.o: undefined reference to symbol 'dbus_message_unref'
          /lib/x86_64-linux-gnu/libdbus-1.so.3: error adding symbols: DSO missing from command line
          collect2: error: ld returned 1 exit status
      6ba0b7d2
    • E
      build: add configure option to disable gnulib tests · 70363ea9
      Eric Blake 提交于
      The gnulib testsuite is relatively stable - the only times it is
      likely to have a test change from pass to fail is on a gnulib
      submodule update or a major system change (such as moving from
      Fedora 18 to 19, or other large change to libc).  While it is an
      important test for end users on arbitrary machines (to make sure
      that the portability glue works for their machine), it mostly
      wastes time for development testing (as most developers aren't
      making any of the major changes that would cause gnulib tests
      to alter behavior).  Thus, it pays to make the tests optional
      at configure time, defaulting to off for development, on for
      tarballs, with autobuilders requesting it to be on.  It also
      helps to allow a make-time override, via VIR_TEST_EXPENSIVE=[01]
      (much the way automake sets up V=[01] for overriding the configure
      time default of how verbose to be).
      
      Automake has some pretty hard-coded magic with regards to the
      TESTS variable; I had quite a job figuring out how to keep
      'make distcheck' passing regardless of the configure option
      setting in use, while still disabling the tests at runtime
      when I did not configure them on and did not use the override
      variable.  Thankfully, we require GNU make, which lets me
      hide some information from Automake's magic handling of TESTS.
      
      * bootstrap.conf (bootstrap_epilogue): Munge gnulib test variable.
      * configure.ac (--enable-expensive-tests): Add new enable switch.
      (VIR_TEST_EXPENSIVE_DEFAULT, WITH_EXPENSIVE_TESTS): Set new
      witnesses.
      * gnulib/tests/Makefile.am (TESTS): Make tests conditional on
      configure settings and the VIR_TEST_EXPENSIVE variable.
      * tests/Makefile.am (TESTS_ENVIRONMENT): Expose VIR_TEST_EXPENSIVE
      to all tests.
      * autobuild.sh: Enable all tests during autobuilds.
      * libvirt.spec.in (%configure): Likewise.
      * mingw-libvirt.spec.in (%mingw_configure): Likewise.
      * docs/hacking.html.in: Document the option.
      * HACKING: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      70363ea9
  31. 08 8月, 2013 1 次提交
  32. 02 8月, 2013 1 次提交
    • J
      build: fix qemuagenttest build with -O0 in fedora 19. · a320730a
      Jincheng Miao 提交于
      When building libvirt with -O0 flag in fedora 19, it will fail to
      generate qemuagenttest, a link error occurs like:
      
      ./.libs/libqemumonitortestutils.a(qemumonitortestutils.o): In function `qemuMonitorTestFree':
      libvirt/tests/qemumonitortestutils.c:346: undefined reference to `qemuMonitorClose'
      ./.libs/libqemumonitortestutils.a(qemumonitortestutils.o): In function `qemuMonitorTestNew':
      libvirt/tests/qemumonitortestutils.c:870: undefined reference to `qemuMonitorOpen'
      collect2: error: ld returned 1 exit status
      
      Fix it by listing libraries in the correct order to avoid lazy linkage.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      a320730a
  33. 31 7月, 2013 1 次提交
  34. 22 7月, 2013 1 次提交