Commit Graph

53 Commits

Author SHA1 Message Date
Richard W.M. Jones
6c971faecf Update copyright dates for 2014. 2014-01-02 16:53:34 +00:00
Richard W.M. Jones
4180abcc1f tests: Use unique or temporary names for temporary files.
Review every test(!) to ensure that it:

 - Doesn't use a generic name (eg. "test1.img", "test.out") for any
   temporary file it needs.

 - Does instead use a unique name or a temporary name (eg. a name like
   "name-of-the-test.img", or a scratch disk).

 - Does not use 'rm -f' to clean up its temporary files (so we can
   detect errors if the wrong temporary file is created or removed).

This allows tests to be run in parallel, so they don't stomp on each
other's temporary files.
2013-07-23 10:16:00 +01:00
Richard W.M. Jones
14fabcd88e tests: Use new guestfs_add_drive_scratch API where possible in tests.
Replaces code such as:

  fd = open "test1.img"
  ftruncate fd, size
  close fd
  g.add_drive "test1.img"

with the shorter and simpler:

  g.add_drive_scratch size
2013-07-20 16:31:42 +01:00
Richard W.M. Jones
a8b26aaab9 haskell: Fix separated builds. 2013-04-25 12:22:31 +01:00
Richard W.M. Jones
0d18a8b407 Update copyright dates for 2013. 2013-02-02 13:56:19 +00:00
Matthew Booth
1dd9bf73b7 build: Fix haskell dependencies and parallel build
Without this change all the tests in the haskell bindings are rebuilt
every time. The primary motivation for this change is to fix this.

The fix for the above also allows parallel builds to be re-enabled.
2013-01-30 10:53:02 +00:00
Richard W.M. Jones
406e372469 haskell: Use 'import Guestfs as G' in test code.
The code is equivalent but shorter.
2012-12-29 13:35:07 +00:00
Richard W.M. Jones
3a72944597 haskell: Use .NOTPARALLEL in this directory. 2012-12-29 13:16:07 +00:00
Richard W.M. Jones
7718cb5afe haskell: Fix RStringList in generator. 2012-12-28 21:36:07 +00:00
Richard W.M. Jones
5ede0b21b0 haskell: Add tests of config functions. 2012-12-28 20:44:36 +00:00
Richard W.M. Jones
c9e0ff8831 haskell: Allow non-appliance tests to run when !ENABLE_APPLIANCE. 2012-12-28 20:19:20 +00:00
Richard W.M. Jones
604f9a79db haskell: Renumber tests according to Perl scheme. 2012-12-28 20:17:31 +00:00
Richard W.M. Jones
7486fc6f43 generator: Rename 'add_drive_opts' API to 'add_drive'.
By using the once_had_no_optargs flag, this change is backwards
compatible for callers (except Haskell, PHP and GObject as discussed
in earlier commit).
2012-07-14 12:42:24 +01:00
Richard W.M. Jones
27efd99ddb tests: Reformat TESTS_ENVIRONMENT so all use a standard format.
No functional change.
2012-06-28 13:49:32 +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
Jim Meyering
6edecdec59 maint: use $var notation rather than ${var} when possible
I noticed some uses of ${srcdir} in shell scripts.
That is almost always better written as $srcdir.
The patch below converts most such variable references.
Here are the few remaining candidates:

$ git grep -i -E '\$\{[a-zA-Z_0-9]+\}'|grep -v Makefile.in.in
configure.ac:        JAR_INSTALL_DIR=\${prefix}/share/java
configure.ac:        JNI_INSTALL_DIR=\${libdir}
debian/rules:   for TEST in ${DEBIAN_SKIP_TEST}; do \
debian/rules:#          mv $${mod} $$(dirname $${mod})/libguestfsmod.so; \
java/Makefile.am:libguestfs_jar_DATA = libguestfs-${VERSION}.jar
java/Makefile.am:libguestfs-${VERSION}.jar: $(libguestfs_jar_class_files)
perl/lib/Sys/Guestfs/Lib.pm:                      "-f", '${Package} ${Version} ${Architecture} ${Status}\n',
perl/typemap:            croak (\"${Package}::$func_name(): called on a closed handle\");
perl/typemap:        croak (\"${Package}::$func_name(): $var is not a blessed HV reference\");
tests/data/Makefile.am:   echo "$${i}abcdefghijklmnopqrstuvwxyz"; \

We could change all of those, too, except the ones in configure.ac
and Makefile.am, since they refer to Make variables.  Even those
should be changed, but to use the preferred Makefile notation:
$(prefix), $(libdir), $(VERSION).

>From a86770ecd45666232a94d76c8725c8f9b1c76e3a Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Mon, 23 Jan 2012 11:15:12 +0100
Subject: [PATCH libguestfs] maint: use $var notation rather than ${var} when
 possible

The only case to avoid in a shell script is when the byte after the
"}" is word-constituent, and concatenating it would thus change the
name of the variable.

These changes were induced by running this command:
  git grep -l -i -E '\$\{(srcdir|md)' \
    |xargs perl -pi -e 's/\$\{(srcdir|md)\}($|\w)/\$$1$2/gi'

The "g" was needed because there was one line with two instances.
The "i" is to handle ${SRCDIR}.  The ($|\w) ensures that concatenating
whatever follows the "}" won't change semantics.

* gobject/run-bindtests: Use "$srcdir", not "${srcdir}".
* haskell/run-bindtests: Likewise.
* java/run-bindtests: Likewise.
* ocaml/run-bindtests: Likewise.
* perl/run-bindtests: Likewise.
* python/run-bindtests: Likewise.
* ruby/run-bindtests: Likewise.
* tests/guests/guest-aux/make-debian-img.sh: Likewise, but $SRCDIR.
* tests/guests/guest-aux/make-ubuntu-img.sh: Likewise.
* tests/guests/guest-aux/make-windows-img.sh: Likewise.
* tests/md/test-mdadm.sh: Likewise, but $md.
2012-01-23 10:40:47 +00:00
Hilko Bengen
b6e0552ee5 Do not run appliance-related checks if not building appliance 2012-01-23 09:08:33 +00:00
Hilko Bengen
7004fafc69 Replace setting of environment variables with usage of local run script
(Includes fix by RWMJ)
2012-01-23 09:08:21 +00:00
Matthew Booth
02ccef7684 bindtests: Test optargs in test0
Note that this change disables compiling and running the haskell bindtests. The
haskell bindings do not implement optargs, and adding optargs to test0 causes
that method not to be bound in the haskell bindings. This prevents the haskell
bindtests from compiling. These should be re-enabled when optargs are
implemented.
2012-01-20 18:42:40 +00:00
Richard W.M. Jones
08840bab44 Tempus fugit.
Update all copyright dates to 2012.
2012-01-18 22:05:02 +00:00
Hilko Bengen
730fb50780 out of tree build: haskell 2011-11-16 12:39:02 +00:00
Matthew Booth
04ea1375c5 Update FSF address. 2011-11-08 14:43:07 +00:00
Hilko Bengen
e7ea6d06ab out-of-tree build: fixed bindtests and inspector 2011-10-21 16:42:06 +01:00
Richard W.M. Jones
f7d18c84dd build: Set TMPDIR for local testing.
This avoids conflicts with the globally installed libguestfs
appliance, or lets us build in multiple local directories at the same
time without conflicts.
2011-08-08 12:41:54 +01:00
Richard W.M. Jones
502a98948c haskell: Small fixes for ghc 7. 2011-03-18 11:19:31 +00:00
Richard W.M. Jones
2860b21ee1 haskell: Combine tests to reduce number of launches. 2010-11-30 14:10:40 +00:00
Matthew Booth
8b3e75a3c7 build: Fix parallel build of haskell bindings
ghc isn't clever enough not to stomp on itself when building dependencies. This
change makes the 1 dependency explicit.

It also adds a dependency on src/libguestfs.la.
2009-11-19 16:40:22 +00:00
Matthew Booth
c477e2fb78 build: Fix inter-directory dependencies
This change adds an explicit dependency on generator.ml for every file it
generates, except java files. Java is left for another time because it's
considerably trickier.

It also adds a build rule for src/libguestfs.la so it can be rebuilt as required
from other directories.

It does this by creating a top level make file, subdir-rules.mk, which can be
included from sub-directories. sub-directories need to define 'generator_built'
to include local files which are built by generator.ml, and they will be updated
automatically.

This fixes parallel make, and will automatically re-create generated files when
make is run from any directory.

It also fixes the problem which efad4f53 was targetting. Specifically,
src/guestfs_protocol.(c|h) had an erroneous dependency on stamp-generator, and
therefore generator.ml, despite not being directly created by it. This caused
them to be recreated every time generator.ml ran rather than only when
src/guestfs_protocol.x was updated, which cascaded into a daemon and therefore
appliance update.

This patch also changes the contents of the distribution tarball by including
files created by rpcgen.
2009-11-19 16:40:22 +00:00
Richard Jones
8869adf1e8 Remove guestfs_wait_ready (turn it into a no-op).
This commit changes guestfs_launch so that it both launches
the appliance and waits until it is ready (ie. the daemon communicates
back to us).

Since we removed the pretence that we could implement a low-level
asynchronous API, the need to call launch() followed by wait_ready()
has looked a bit silly.

Now guestfs_wait_ready() is basically a no-op.  It is left in the
API for backwards compatibility.  Any calls to guestfs_wait_ready()
can be removed from client code.
2009-09-21 12:01:51 +01:00
Jim Meyering
0c463dd0aa build: remove trailing blank lines; enable the syntax-check rule
* cfg.mk (disable_temporarily): Remove sc_prohibit_trailing_blank_lines.
* appliance/Makefile.am: Remove trailing blank line(s).
* appliance/debian/modules/y0_install-guestfsd: Likewise.
* appliance/make.sh.in: Likewise.
* appliance/packagelist.in: Likewise.
* appliance/update.sh.in: Likewise.
* haskell/run-bindtests: Likewise.
* ocaml/run-bindtests: Likewise.
* python/run-python-tests: Likewise.
* recipes/squashfs.example: Likewise.
* ruby/run-ruby-tests: Likewise.
2009-08-04 14:47:09 +02:00
Matthew Booth
349814e9d9 Make it possible to build in a separate directory
This patch allows you to do:
mkdir build
cd build
../configure ...
make

This will output all generated files to the build directory. Given that
autogen automatically runs configure, you can also do:

BUILDDIR=./build ./autogen.sh

which will do the right thing.

Also:

* Fix a dependency bug which means that guestfs_protocol.h
  isn't automatically rebuilt.
* Re-running autogen.sh with no arguments won't blow away your previous
  configure arguments.
2009-07-03 16:16:51 +01:00
Richard W.M. Jones
b3cb0b04eb Remove generated code from git.
Git users now require the OCaml compiler in order to regenerate
the generated code after a checkout.

Generated code will remain in the tarball, so users of the
source tarball will not need the OCaml compiler.
2009-07-02 11:51:16 +01:00
Richard W.M. Jones
0884d8bbae Generated code for mknod, mkfifo, mknod_b, mknod_c, umask. 2009-06-30 13:10:45 +01:00
Richard W.M. Jones
f68b3ac861 Generated code for 'set_memsize'/'get_memsize' calls. 2009-06-30 13:10:44 +01:00
Richard W.M. Jones
da8ddb2745 Generated code for the 'mkswap*' commands. 2009-06-29 20:25:20 +01:00
Richard W.M. Jones
5d6b6a3fbb Generated code for mount-loop command. 2009-06-29 16:05:22 +01:00
Richard W.M. Jones
e492608f2f Generated code for 'du' command. 2009-06-29 12:47:20 +01:00
Richard W.M. Jones
826020fe18 Generated code for head/tail commands. 2009-06-29 11:47:07 +01:00
Richard W.M. Jones
f450ce75b7 Generated code for 'wc_*' commands. 2009-06-29 10:09:13 +01:00
Richard W.M. Jones
d164ae9632 Haskell bindings: Implement bindtests. 2009-06-28 13:54:22 +02:00
Richard W.M. Jones
ef2b0cf761 Haskell bindings: Int and Int64 return types. 2009-06-28 13:34:11 +02:00
Richard W.M. Jones
05273da883 Haskell bindings: fix boolean arguments. 2009-06-28 13:27:33 +02:00
Richard W.M. Jones
ec34c2bfbf Haskell bindings: Fix integer arguments. 2009-06-28 13:17:23 +02:00
Richard W.M. Jones
bcb3fc0c33 Generated code for 'scrub-*' commands. 2009-06-23 15:53:44 +01:00
Richard Jones
d1a1ab972b Generated code for 'add_drive_ro' call. 2009-06-02 14:25:25 +01:00
Richard W.M. Jones
babc0846cc Add tests for bindings parameters, fix several broken bindings. 2009-05-28 20:15:51 +01:00
Richard W.M. Jones
a1e8cdf2a2 Move the appliance and build scripts into new appliance/ subdirectory. 2009-05-28 13:00:31 +01:00
Richard Jones
3e408f4934 Generated code for e2fsck-f command. 2009-05-21 16:18:16 +01:00
Richard Jones
ca49c50e06 Generated code for lvresize, resize2fs. 2009-05-18 20:22:53 +01:00
Richard W.M. Jones
5cd39c83e2 Add: pvresize, sfdisk-N, sfdisk-l, sfdisk-kernel-geomtry, sfdisk-disk-geometry commands. Pass --no-reread flag to sfdisk. 2009-05-15 14:52:34 +01:00