[libvirt] [PATCH] make sure we call the freshly build libvirtd

...not the one in $PATH. I was wondering why this test kept failing... -- Guido --- tests/daemon-conf | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/daemon-conf b/tests/daemon-conf index db1f0d3..4a42d1e 100755 --- a/tests/daemon-conf +++ b/tests/daemon-conf @@ -1,6 +1,8 @@ #!/bin/sh # Get coverage of libvirtd's config-parsing code. +LIBVIRTD=$abs_top_builddir/qemud/libvirtd + # Boilerplate code to set up a test directory, cd into it, # and to ensure we remove it upon completion. this_test_() { echo "./$0" | sed 's,.*/,,'; } @@ -27,7 +29,7 @@ while :; do # Change an RHS that starts with '"' or '[' to "3". # Change an RHS that starts with 0 or 1 to the string '"foo"'. sed "$i"'s/ = [["].*/ = 3/;'"$i"'s/ = [01].*/ = "foo"/' tmp.conf > $f - libvirtd --config=$f 2> err && fail=1 + $LIBVIRTD --config=$f 2> err && fail=1 case $rhs in # '"'*) msg='should be a string';; '"'*) msg='invalid type: got long; expected string';; @@ -48,7 +50,7 @@ while :; do done # Run with the unmodified config file. -libvirtd --config=tmp.conf > log 2>&1 & pid=$! +$LIBVIRTD --config=tmp.conf > log 2>&1 & pid=$! sleep 2 kill $pid -- 1.5.6.3

Guido Guenther <agx@sigxcpu.org> wrote:
...not the one in $PATH. I was wondering why this test kept failing...
You shouldn't need that change, since "make check" already sets PATH so that $abs_top_builddir/qemud is early in PATH. And it does it in such a way that it should work even if the absolute path contains shell meta-characters. Are you trying to run the test manually via "./daemon-conf"? If you want to run just that one test, use this: make -C tests check TESTS=daemon-conf
diff --git a/tests/daemon-conf b/tests/daemon-conf ... +LIBVIRTD=$abs_top_builddir/qemud/libvirtd ...

On Fri, Aug 08, 2008 at 06:30:56PM +0200, Jim Meyering wrote:
Guido Guenther <agx@sigxcpu.org> wrote:
...not the one in $PATH. I was wondering why this test kept failing...
You shouldn't need that change, since "make check" already sets PATH so that $abs_top_builddir/qemud is early in PATH. And it does it in such a way that it should work even if the absolute path contains shell meta-characters. I ran:
cd tests/ make check and that particular check failed. I figure this isn't supported then? It works for all other tests and it works for daemon-conf with the patch I attached so it should probably be applied to make things a bit more newbie robust? -- Guido

Guido Günther <agx@sigxcpu.org> wrote:
On Fri, Aug 08, 2008 at 06:30:56PM +0200, Jim Meyering wrote:
Guido Guenther <agx@sigxcpu.org> wrote:
...not the one in $PATH. I was wondering why this test kept failing...
You shouldn't need that change, since "make check" already sets PATH so that $abs_top_builddir/qemud is early in PATH. And it does it in such a way that it should work even if the absolute path contains shell meta-characters. I ran:
cd tests/ make check
and that particular check failed. I figure this isn't supported then?
No, that should work fine. I've confirmed that it works for me, in a $srcdir build. Now trying a non-srcdir build... Yep, that works, too. Can you debug it? E.g., echo "$PATH" from within the script and figure out why it doesn't include $$abs_top_builddir/qemud. Are you using modern versions of automake, autoconf, etc.?
It works for all other tests and it works for daemon-conf with the patch I attached so it should probably be applied to make things a bit more newbie robust?

On Fri, Aug 08, 2008 at 06:57:19PM +0200, Jim Meyering wrote:
Can you debug it? E.g., echo "$PATH" from within the script and figure out why it doesn't include $$abs_top_builddir/qemud. It suddenly doesn't fail here anymore, no idea what happened. I'll report back once I'm able to break it again. -- Guido

On Fri, Aug 08, 2008 at 06:30:56PM +0200, Jim Meyering wrote:
Guido Guenther <agx@sigxcpu.org> wrote:
...not the one in $PATH. I was wondering why this test kept failing...
You shouldn't need that change, since "make check" already sets PATH so that $abs_top_builddir/qemud is early in PATH. And it does it in such a way that it should work even if the absolute path contains shell meta-characters.
Are you trying to run the test manually via "./daemon-conf"?
If you want to run just that one test, use this:
make -C tests check TESTS=daemon-conf
FYI, I have been slowly fixing individual tests so that you can run them directly. I'm fundamentally lazy, so want to be able to just run ./daemon-conf I think all the compiled tests support this now - just the shell based ones left. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (4)
-
Daniel P. Berrange
-
Guido Guenther
-
Guido Günther
-
Jim Meyering