1. 13 6月, 2019 3 次提交
    • A
      tests: Include LDADDS in qemu_LDADDS · 73cfc362
      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>
      73cfc362
    • A
      tests: Tweak vircapstest_LDADD · 6b8048b4
      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>
      6b8048b4
    • A
      tests: Tweak cputest_LDADDS · 74d8909f
      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>
      74d8909f
  2. 04 6月, 2019 1 次提交
  3. 30 5月, 2019 1 次提交
    • J
      build: fix linking libqemutestdriver with LTO enabled · 76b420d0
      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>
      76b420d0
  4. 10 4月, 2019 1 次提交
    • M
      domain capabilities: Expose firmware auto selection feature · 5b9819ee
      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>
      5b9819ee
  5. 03 4月, 2019 2 次提交
    • D
    • D
      tests: fix mocking of stat() / lstat() functions · ff376c62
      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>
      ff376c62
  6. 25 3月, 2019 1 次提交
    • E
      snapshot: Add tests of virsh -c test:///default snapshot* · 280a2b41
      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>
      280a2b41
  7. 15 3月, 2019 1 次提交
  8. 14 3月, 2019 6 次提交
  9. 13 3月, 2019 1 次提交
  10. 12 3月, 2019 3 次提交
  11. 11 3月, 2019 1 次提交
  12. 07 3月, 2019 2 次提交
  13. 12 2月, 2019 2 次提交
  14. 08 2月, 2019 1 次提交
  15. 30 1月, 2019 3 次提交
  16. 08 1月, 2019 2 次提交
  17. 19 12月, 2018 1 次提交
  18. 14 12月, 2018 1 次提交
  19. 13 12月, 2018 1 次提交
  20. 10 10月, 2018 1 次提交
    • M
      virfiletst: Test virFileIsSharedFS · a7b4eb7d
      Michal Privoznik 提交于
      Introduce some basic test cases for virFileIsSharedFS(). More
      will be added later. In order to achieve desired result, mocks
      for setmntent() and statfs() need to be invented because the
      first thing that virFileIsSharedFS() does is calling the latter.
      If it finds a FUSE mount it'll call the former.
      
      The mock might look a bit complicated, but in fact it's quite
      simple. The test sets LIBVIRT_MTAB env variable to hold the
      absolute path to a file containing mount table. Then, statfs()
      returns matching FS it finds, and setmntent() is there just to
      replace /proc/mounts with the file the test wants to load.
      
      Adding this test also exposed a bug we have - because we assume
      the given path points to a file we cut off what we assume is a
      file name to obtain directory path and only then we call
      statfs(). This is buggy because the passed path could be already
      a mount point.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
      a7b4eb7d
  21. 17 9月, 2018 1 次提交
  22. 24 8月, 2018 1 次提交
    • S
      vsh: Added tests · 95785c1c
      Simon Kobyda 提交于
      For now, there are 9 test cases
      - testVshTableNew: Creating table with empty header
      - testVshTableHeader: Printing table with/without header
      - testVshTableRowAppend: Appending row with various number of cells.
        Only row with same number of cells as in header is accepted.
      - testUnicode: Printing table with unicode characters.
        Checking correct alignment.
      - testUnicodeArabic: test opposite (right to left) writing
      - testUnicodeZeroWidthChar
      - testUnicodeCombiningChar
      - testUnicodeNonPrintableChar,
      - testNTables: Create and print varios types of tables - one column,
        one row table, table without content, standart table...
      Signed-off-by: NSimon Kobyda <skobyda@redhat.com>
      95785c1c
  23. 13 8月, 2018 1 次提交
  24. 18 7月, 2018 1 次提交
  25. 10 7月, 2018 1 次提交