1. 30 8月, 2013 1 次提交
  2. 28 8月, 2013 2 次提交
  3. 27 8月, 2013 5 次提交
  4. 26 8月, 2013 12 次提交
  5. 24 8月, 2013 1 次提交
  6. 23 8月, 2013 1 次提交
  7. 22 8月, 2013 3 次提交
  8. 21 8月, 2013 4 次提交
    • 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
    • D
      Test handling of non-existent x509 certs · 4b8d387e
      Daniel P. Berrange 提交于
      In commit f905cc99 a use of
      uninitialized data was fixed based on a coverity report. It
      turns out it was possible to trigger this issue by pointing
      libvirt at non-existent certificate files, typically causing
      a crash.
      
      This adds a test case for that scenario. With the above
      commit reverted, this new test case will crash with a SEGV.
      With the fix applied, it passes, reporting a normal libvirt
      error to the caller.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      4b8d387e
    • E
      selinux: enhance test to cover nfs label failure · 95577af4
      Eric Blake 提交于
      Daniel Berrange (correctly) pointed out that we should do a better
      job of testing selinux labeling fallbacks on NFS disks that lack
      labeling support.
      
      * tests/securityselinuxhelper.c (includes): Makefile already
      guaranteed xattr support.  Add additional headers.
      (init_syms): New function, borrowing from vircgroupmock.c.
      (setfilecon_raw, getfilecon_raw): Fake NFS failure.
      (statfs): Fake an NFS mount point.
      (security_getenforce, security_get_boolean_active): Don't let host
      environment affect test.
      * tests/securityselinuxlabeldata/nfs.data: New file.
      * tests/securityselinuxlabeldata/nfs.xml: New file.
      * tests/securityselinuxlabeltest.c (testSELinuxCreateDisks)
      (testSELinuxDeleteDisks): Setup and cleanup for fake NFS mount.
      (testSELinuxCheckLabels): Test handling of SELinux NFS denial.
      Fix memory leak.
      (testSELinuxLabeling): Avoid infinite loop on dirty tree.
      (mymain): Add new test.
      95577af4
    • E
      selinux: distinguish failure to label from request to avoid label · 0f082e69
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=924153
      
      Commit 904e05a2 (v0.9.9) added a per-<disk> seclabel element with
      an attribute relabel='no' in order to try and minimize the
      impact of shutdown delays when an NFS server disappears.  The idea
      was that if a disk is on NFS and can't be labeled in the first
      place, there is no need to attempt the (no-op) relabel on domain
      shutdown.  Unfortunately, the way this was implemented was by
      modifying the domain XML so that the optimization would survive
      libvirtd restart, but in a way that is indistinguishable from an
      explicit user setting.  Furthermore, once the setting is turned
      on, libvirt avoids attempts at labeling, even for operations like
      snapshot or blockcopy where the chain is being extended or pivoted
      onto non-NFS, where SELinux labeling is once again possible.  As
      a result, it was impossible to do a blockcopy to pivot from an
      NFS image file onto a local file.
      
      The solution is to separate the semantics of a chain that must
      not be labeled (which the user can set even on persistent domains)
      vs. the optimization of not attempting a relabel on cleanup (a
      live-only annotation), and using only the user's explicit notation
      rather than the optimization as the decision on whether to skip
      a label attempt in the first place.  When upgrading an older
      libvirtd to a newer, an NFS volume will still attempt the relabel;
      but as the avoidance of a relabel was only an optimization, this
      shouldn't cause any problems.
      
      In the ideal future, libvirt will eventually have XML describing
      EVERY file in the backing chain, with each file having a separate
      <seclabel> element.  At that point, libvirt will be able to track
      more closely which files need a relabel attempt at shutdown.  But
      until we reach that point, the single <seclabel> for the entire
      <disk> chain is treated as a hint - when a chain has only one
      file, then we know it is accurate; but if the chain has more than
      one file, we have to attempt relabel in spite of the attribute,
      in case part of the chain is local and SELinux mattered for that
      portion of the chain.
      
      * src/conf/domain_conf.h (_virSecurityDeviceLabelDef): Add new
      member.
      * src/conf/domain_conf.c (virSecurityDeviceLabelDefParseXML):
      Parse it, for live images only.
      (virSecurityDeviceLabelDefFormat): Output it.
      (virDomainDiskDefParseXML, virDomainChrSourceDefParseXML)
      (virDomainDiskSourceDefFormat, virDomainChrDefFormat)
      (virDomainDiskDefFormat): Pass flags on through.
      * src/security/security_selinux.c
      (virSecuritySELinuxRestoreSecurityImageLabelInt): Honor labelskip
      when possible.
      (virSecuritySELinuxSetSecurityFileLabel): Set labelskip, not
      norelabel, if labeling fails.
      (virSecuritySELinuxSetFileconHelper): Fix indentation.
      * docs/formatdomain.html.in (seclabel): Document new xml.
      * docs/schemas/domaincommon.rng (devSeclabel): Allow it in RNG.
      * tests/qemuxml2argvdata/qemuxml2argv-seclabel-*-labelskip.xml:
      * tests/qemuxml2argvdata/qemuxml2argv-seclabel-*-labelskip.args:
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-*-labelskip.xml:
      New test files.
      * tests/qemuxml2argvtest.c (mymain): Run the new tests.
      * tests/qemuxml2xmltest.c (mymain): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      0f082e69
  9. 19 8月, 2013 1 次提交
  10. 17 8月, 2013 1 次提交
  11. 16 8月, 2013 2 次提交
  12. 14 8月, 2013 1 次提交
    • L
      network: permit upstream forwarding of unqualified DNS names · 4f595ba6
      Laine Stump 提交于
      This resolves the issue that prompted the filing of
      
        https://bugzilla.redhat.com/show_bug.cgi?id=928638
      
      (although the request there is for something much larger and more
      general than this patch).
      
      commit f3868259 disabled the
      forwarding to upstream DNS servers of unresolved DNS requests for
      names that had no domain, but were just simple host names (no "."
      character anywhere in the name). While this behavior is frowned upon
      by DNS root servers (that's why it was changed in libvirt), it is
      convenient in some cases, and since dnsmasq can be configured to allow
      it, it must not be strictly forbidden.
      
      This patch restores the old behavior, but since it is usually
      undesirable, restoring it requires specification of a new option in
      the network config. Adding the attribute "forwardPlainNames='yes'" to
      the <dns> elemnt does the trick - when that attribute is added to a
      network config, any simple hostnames that can't be resolved by the
      network's dnsmasq instance will be forwarded to the DNS servers listed
      in the host's /etc/resolv.conf for an attempt at resolution (just as
      any FQDN would be forwarded).
      
      When that attribute *isn't* specified, unresolved simple names will
      *not* be forwarded to the upstream DNS server - this is the default
      behavior.
      4f595ba6
  13. 13 8月, 2013 6 次提交
    • 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
    • M
      tests: Fix parallel runs of TLS test suites · 3be7a304
      Martin Kletzander 提交于
      I noticed this yesterday and fixed it in a different way, but ended up
      with one more problem.  It was probably the way I fixed it combined
      with one more filename changed.
      
      Anyway, why I'm saying this is that one more filename should be renamed
      in order to avoid a race (which I was unable to reproduce, though).
      
      I checked this is the last file those two tests have in common by going
      through the code and the re-checked by this "script":
      
      strace -o session.trace -e open ./virnettlssessiontest
      strace -o context.trace -e open ./virnettlscontexttest
      sort \
       <(sed -n '/^open/s/open("\([^"]*\)",.*$/\1/p' context.trace | sort -u)\
       <(sed -n '/^open/s/open("\([^"]*\)",.*$/\1/p' session.trace | sort -u)\
       | uniq -d| grep '.pem$'
      
      So it should be enough to make these tests independent of each other.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3be7a304
    • 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
    • P
      tests: Skip virsh-all test as expensive · ba510abf
      Peter Krempa 提交于
      Don't run the blind test of all virsh commands always. It usualy just
      wastes time.
      ba510abf
    • P
      qemuagenttest: Test timeout of agent commands · 3ff6ae5b
      Peter Krempa 提交于
      If VIR_TEST_EXPENSIVE is enabled, test timeout of agent commands. This
      test takes 6 seconds to finish.
      3ff6ae5b
    • E
      tests: add helper to determine when to skip expensive tests · 38d4bf49
      Eric Blake 提交于
      The logic set up in previous patch for exposing VIR_TEST_EXPENSIVE
      to individual tests is as follows:
      
      make check VIR_TEST_EXPENSIVE=0   => getenv("VIR_TEST_EXPENSIVE") sees "0"
      make check VIR_TEST_EXPENSIVE=1   => getenv("VIR_TEST_EXPENSIVE") sees "1"
      make check                        => getenv("VIR_TEST_EXPENSIVE") sees
      either "0" or "1", based on configure options
      cd tests; ./FOOtest               => getenv("VIR_TEST_EXPENSIVE") sees
      whatever is in your environment (usually NULL, but possibly garbage)
      
      Merely checking if VIR_TEST_EXPENSIVE is set in the environment
      does the wrong thing; likewise, it is unsafe to assume the
      variable will always contain a valid number.
      
      As such, it helps to have helper functions, instead of making each
      expensive test repeat the probe of the environment.
      
      * tests/testutils.h (virTestGetExpensive): New prototype.
      * tests/testutils.c (virTestGetExpensive): Implement it.
      * tests/test-lib.sh (very_expensive_): Rename...
      (test_expensive): ...and tweak to use VIR_TEST_EXPENSIVE.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      38d4bf49