Commit Graph

17 Commits

Author SHA1 Message Date
Richard W.M. Jones
6d32773e81 tests: Run the tests in parallel.
Before this change the tests ran in about 12m34 and afterwards in
about 6m20, although the real change is more dramatic if you only run
tests from the tests/ subdirectory (as language tests still run serially).

This breaks valgrinding for now, which I intend to fix properly later.
2021-03-18 16:28:55 +00:00
Richard W.M. Jones
76c0a67d30 build: Add common CLEANFILES and DISTCLEANFILES to common-rules.mk.
By adding common CLEANFILES and DISTCLEANFILES variables to
common-rules.mk, we can remove these from most other Makefiles, and
also clean files more consistently.

Note that bin_PROGRAMS are already cleaned by 'make clean', so I
removed cases where these were unnecessarily added to CLEANFILES.
2016-08-25 16:54:34 +01:00
Pino Toscano
d98c9c0e0b Fix shebang in perl scripts
Instead of hardcoding the location of perl (assuming it is installed in
/usr), use /usr/bin/env to run it, and thus picking it from $PATH.
This makes it possible to run these scripts also on installations with
perl in a different prefix than /usr.

Also, given that we want enable warnings on scripts, turn the -w
previously in shebang to explicit "use warnings;" in scripts which
didn't have it before.
2015-10-05 15:43:35 +02:00
Richard W.M. Jones
8554dbbc03 Remove multiple hacks that only apply to RHEL 5.
We don't support RHEL 5 upstream (see the 'oldlinux' branch for a
version that works with RHEL 5).  Therefore remove a bunch of hacks
that were only needed on RHEL 5.
2015-10-05 14:32:28 +01:00
Richard W.M. Jones
49bdaabc7d build: Add common-rules.mk, common rules for all Makefiles.
This file is mainly a central place to:

 - include localenv if it exists, and

 - define the RHEL 5 backwards compatibility macros, instead of
   spreading them over every other file.
2013-06-04 12:41:11 +01:00
Richard W.M. Jones
073da79e5b tests/xml: Get XML data file from source directory. 2013-04-25 14:21:55 +01:00
Richard W.M. Jones
2287b988ee perl: Remove use of Sys::Guestfs::Lib::open_guest function.
This obsolete function does all sorts of libvirt/XML things, which can
now be replaced by using ordinary API calls; especially $g->add_domain.
2013-04-02 13:30:19 +01:00
Richard W.M. Jones
d9efcfb556 RHEL 5: tests/xml: Define O_CLOEXEC in LD_PRELOAD library. 2013-03-11 11:04:38 +00:00
Richard W.M. Jones
cb13ffe190 syntax: Remove definitions of O_CLOEXEC, except in examples (thanks Jim Meyering).
The gnulib <fcntl.h> replacement header will now define this symbol if
it's not defined already.
2012-09-17 10:07:31 +01:00
Richard W.M. Jones
2cac8d490e syntax: Remove trailing whitespace.
Found by 'make syntax-check'.
2012-09-15 13:36:02 +01:00
Richard W.M. Jones
2e4089f300 build: Rename most C files that contain underscore with dash.
This is just code motion.

Some files cannot be renamed.  Notably rpcgen input and output files
must not contain dash characters, else rpcgen breaks.
2012-07-19 16:11:47 +01:00
Richard W.M. Jones
927ef14c58 run: Set MALLOC_PERTURB_ to a random value.
MALLOC_PERTURB_ is a glibc feature which causes malloc to wipe memory
before and after it is used, allowing both use-after-free and
uninitialized reads to be detected with relatively little performance
penalty:

  http://udrepper.livejournal.com/11429.html?nojs=1

Modify the ./run script so that it always sets this.

We were already using MALLOC_PERTURB_ in most tests.  Since ./run is
now setting this, we can remove it from individual Makefiles.  Most
TESTS_ENVIRONMENT will now simply look like this:

  TESTS_ENVIRONMENT = $(top_builddir)/run --test
2012-06-28 13:19:39 +01:00
Richard W.M. Jones
05d4e07918 tests: Add ./run --test option.
This option, when added via
  TESTS_ENVIRONMENT = [...] $(top_builddir)/run --test
allows us to run the tests and only print the full output (including
debugging etc) when the test fails.
2012-06-26 23:34:30 +01:00
Richard W.M. Jones
461455ca7c tests/xml: Fix compilation of test on RHEL 5 with old libvirt.
Old <libvirt.h> had a conflicting definition of virDomainGetXMLDesc:

fake_libvirt_xml.c:36: error: conflicting types for 'virDomainGetXMLDesc'
/usr/include/libvirt/libvirt.h:715: error: previous declaration of 'virDomainGetXMLDesc' was here

The difference is not material ('int' vs. 'unsigned int').

Avoid the error by not including <libvirt.h>.
2012-06-22 13:18:58 +01:00
Richard W.M. Jones
9e7644346d tests: Add workaround for missing O_CLOEXEC. 2012-06-22 13:18:52 +01:00
Richard W.M. Jones
50aa9533e4 build: Define builddir and abs_srcdir when they are missing.
RHEL 5-era autoconf did not define these, so define them manually
when they are missing.

Define builddir as '.'  The scripts require this.  It won't work
in the srcdir != builddir case, but we don't care about that for
RHEL 5.

This commit also moves the builddir / abs_srcdir variable setting
above the include of subdir-rules.mk, in case that include uses
these variables.

Useful script:

  for f in $(find -name Makefile.am | xargs fgrep '$(abs_srcdir)' -l) ; do
    if ! grep -q '^abs_srcdir' $f; then
      echo missing in $f
    fi
  done
2012-06-18 15:32:47 +01:00
Richard W.M. Jones
00202b9c29 tests: Regression test for RHBZ#701814.
This commit adds a tests/xml directory, and an LD_PRELOAD module which
can fake arbitrary libvirt XML from an external file (and is therefore
a much more flexible test than using the libvirt test:// driver
alone).

Also added is one regression test for:
https://bugzilla.redhat.com/show_bug.cgi?id=701814

Loading the given libvirt XML using Sys::Guestfs::Lib::open_guest
used to fail with the error:

  format parameter is empty or contains disallowed characters at /home/rjones/d/libguestfs/perl/blib/lib/Sys/Guestfs/Lib.pm line 256.

Thanks to Tom Horsley for supplying the test data.
2012-05-03 12:30:05 +01:00