1. 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
  2. 14 6月, 2016 1 次提交
  3. 10 6月, 2016 1 次提交
  4. 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
  5. 08 6月, 2016 2 次提交
  6. 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
  7. 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
  8. 10 5月, 2016 1 次提交
  9. 05 5月, 2016 2 次提交
    • 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
    • J
      tests: Create a shared library with qemu driver · dd214b5f
      Jiri Denemark 提交于
      Currently all qemu driver tests are statically linked to qemu driver
      library, which makes it impossible to mock any API from the library.
      This patch creates a shared qemu driver library which can be used
      instead of the static one.
      
      NB we can't use libvirt_driver_qemu.so directly since it is linked with
      -module and it is supposed to be dlopened.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      dd214b5f
  10. 03 5月, 2016 1 次提交
    • E
      rpc: virnetserverclient: Introduce new attribute conn_time to client · a32135b3
      Erik Skultety 提交于
      Besides ID, libvirt should provide several parameters to help the user
      distinguish two clients from each other. One of them is the connection
      timestamp. This patch also adds a testcase for proper JSON formatting of the
      new attribute too (proper formatting of older clients that did not support
      this attribute yet is included in the existing tests) - in order to
      testGenerateJSON to work, a mock of time_t time(time_t *timer) needed to be
      created.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      a32135b3
  11. 24 4月, 2016 1 次提交
    • C
      tests: remove 'reconnect' and 'statstest' · fa90464f
      Cole Robinson 提交于
      These old tests expect to run against a real xen connection via
      xend running on the host. Our intentions for the test suite are
      that it doesn't require interacting with any specific host resources,
      so these don't really belong here.
      fa90464f
  12. 22 4月, 2016 3 次提交
  13. 14 4月, 2016 1 次提交
  14. 20 3月, 2016 1 次提交
  15. 19 3月, 2016 3 次提交
    • M
      tests: Introduce nsslinktest · 5bcd96f5
      Michal Privoznik 提交于
      The only purpose of this test is to catch possible linking
      problems with libnss_libvirt.so.2.
      One of the problems I faced was that the NSS plugin was unloaded
      immediately after it got loaded and the name resolution process
      continued with next configured option. Without any error. It was
      very hard to debug why until I created this simple test and found
      out immediately that there were some symbols missing. The reason
      why problem was not caught in nsstest is that in the test we want
      to use all the fancy stuff and therefore link it with libvirt.la.
      So even if there's a symbol missing in the NSS plugin it will be
      found in the libvirt.la.
      But even after I resolved the issue we still need this test
      because files the NSS plugin is built from are still live (mostly
      those under utils/ dir). So as they change new symbol might be
      required which would render the NSS plugin unusable.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5bcd96f5
    • M
      nss: Introduce a test · 38e32d4a
      Michal Privoznik 提交于
      A small test to see how is the nss module working.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      38e32d4a
    • M
      nss: Implement _nss_libvirt_gethostbyname3_r · 7dbcb26f
      Michal Privoznik 提交于
      The implementation is pretty straightforward. Moreover, because
      of the nature of things, gethostbyname_r and gethostbyname2_r can
      be implemented at the same time too.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      7dbcb26f
  16. 18 3月, 2016 1 次提交
    • M
      tests: Set PATH in each test · 363b401f
      Michal Privoznik 提交于
      Currently we spawn couple of binaries in our test suite.
      Moreover, we provide some spoofed versions of system binaries
      hoping that those will be executed instead of the system ones.
      For instance, for testing SSH socket we have written our own ssh
      binary for producing predictable results. We certainly don't want
      to execute the system ssh binary.
      However, in order to prefer our binaries over system ones, we
      need to set PATH environment variable. But this is done only at
      the Makefile level. So if anybody runs a test by hand that
      expects our spoofed binary, the test ends up executing real
      system binaries. This is not good. In fact, it's terribly wrong.
      The fix lies in a small trick - putting our build directory at
      the beginning of the PATH environment variable in each test.
      Hopefully, since every test has this VIRT_TEST_MAIN* wrapper, we
      can fix this at a single place.
      Moreover, while this removes setting PATH for our tests written
      in bash, it's safe as we are not calling anything ours that would
      require PATH change there.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      363b401f
  17. 12 2月, 2016 3 次提交
  18. 11 2月, 2016 3 次提交
    • A
      tests: Link mock libraries against gnulib and gnulib only · 1ed0bdd8
      Andrea Bolognani 提交于
      Mock libraries should not be linked against libvirt, but some of
      them did - fix that.
      
      On the other hand, not linking against gnulib can cause build
      failures on mingw, so define a new $(MOCKLIBS_LIBS) variable and
      use it everywhere.
      1ed0bdd8
    • A
      Revert "tests: Don't link mock libraries against libvirt and gnulib" · 51c70705
      Andrea Bolognani 提交于
      This reverts commit 6aa90452.
      
      Turns out that not linking against libvirt and gnulib is okay for
      regular Linux (and FreeBSD) builds, but makes mingw very unhappy.
      
        .../virnetserverclientmock_la-virnetserverclientmock.o:
          In function `virNetSocketGetSELinuxContext':
          .../virnetserverclientmock.c:61: undefined reference to `rpl_strdup'
        .../libvirportallocatormock_la-virportallocatortest.o:
          In function `init_syms':
          .../virportallocatortest.c:61: undefined reference to `virFileClose'
      51c70705
    • A
      tests: Don't link mock libraries against libvirt and gnulib · 6aa90452
      Andrea Bolognani 提交于
      Mock libraries are used with LD_PRELOAD from test binaries that
      are already linked against those libraries, so they will be able
      to resolve the symbols anyway.
      6aa90452
  19. 06 2月, 2016 1 次提交
    • C
      tests: qemuargv2xml: separate from qemuxml2argv data · e117bf64
      Cole Robinson 提交于
      Most of the qemuargv2xml tests are parsing old style qemu command
      lines (with -disk, -serial, etc), and it gets its input from
      qemuxml2argv output.
      
      But since we've raise the minimum supported qemu version to 0.12.0,
      which supports -device, once that changes propagates through libvirt
      the vast majority of qemuxml2argv output is _not_ going to be using
      old style qemu options.
      
      In preparation for this, switch qemuargv2xml to use its own copies
      of input and output, so it's not tied to qemuxml2argv results.
      
      This is just a straight copy of the current tests.
      e117bf64
  20. 09 1月, 2016 1 次提交
  21. 09 12月, 2015 1 次提交
  22. 27 11月, 2015 1 次提交
    • M
      virtlogd: Fix build without DBus · baa3b463
      Martin Kletzander 提交于
      The rule for virrotatingfiletest was defined in DBUS-only block even
      though the test does not use DBus at all.  Also DBUS_CFLAGS and
      DBUS_LIBS are removed from the rules.  The original error was:
      
      /usr/lib/gcc/x86_64-pc-linux-gnu/5.2.0/../../../../lib64/Scrt1.o: In
      function `_start':
      (.text+0x20): undefined reference to `main'
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      baa3b463
  23. 26 11月, 2015 1 次提交
    • D
      util: add APIs for reading/writing from/to rotating files · 910e65d9
      Daniel P. Berrange 提交于
      Add virRotatingFileReader and virRotatingFileWriter objects
      which allow reading & writing from/to files with automation
      rotation to N backup files when a size limit is reached. This
      is useful for guest logging when a guaranteed finite size
      limit is required. Use of external tools like logrotate is
      inadequate since it leaves the possibility for guest to DOS
      the host in between invokations of logrotate.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      910e65d9