[libvirt] [PATCH 0/1] A couple of problems with the daemon-conf test

Here's a patch fixing two problems I found with the daemon-conf test that prevented the test from passing if the system libvirt was running on my system. The first change only affects the direct running of the daemon-conf script, i.e, if someone executes ./daemon-conf, which will always exit failure because the default config file contains a line that the test believes should not be there. The invocation by make-check supplies a different config file that's not subject to that problem. The second problem is that the corrupt config tests don't supply the pid-file argument to libvirt, so on my system it was attempting to use the same pidfile as the running system daemon and failing all the tests except the valid config test. Supplying the --pid-file argument when running the corrupt config tests as it is supplied for the valid config tests fixes the problem. Dave

The daemon-conf test would fail on my system if there was a system libvirtd running. In the course of troubleshooting that problem, I discovered that the daemon-conf script would always fail if run by itself because it found the line: \# that each "PARAMETER = VALUE" line in this file have the parameter which it mistook for a line containing a parameter. I have changed the test to avoid mistaking a line containing \"PARAMETER = VALUE\" for a parameter line. The corrupted config tests turned out to be failing because the test daemon was discovering the pid file from the running daemon and exiting before it processed the test config file. Specifying the pid file for the corrupt config tests in the same way as for the valid config test solved that problem. --- tests/daemon-conf | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/daemon-conf b/tests/daemon-conf index 1eb4be1..10c1628 100755 --- a/tests/daemon-conf +++ b/tests/daemon-conf @@ -19,7 +19,7 @@ grep '^#define WITH_QEMU 1' "$CONFIG_HEADER" > /dev/null || conf="$abs_top_srcdir/daemon/libvirtd.conf" # Ensure that each commented out PARAMETER = VALUE line has the expected form. -grep '[a-z_] *= *[^ ]' "$conf" | grep -vE '^#[a-z_]+ = ' \ +grep -v '\"PARAMETER = VALUE\"' "$conf" | grep '[a-z_] *= *[^ ]' | grep -vE '^#[a-z_]+ = ' \ && { echo "$0: found unexpected lines (above) in $conf" 1>&2; exit 1; } # Start with the sample libvirtd.conf file, uncommenting all real directives. @@ -45,7 +45,7 @@ while :; do esac # Run libvirtd, expecting it to fail. - $abs_top_builddir/daemon/libvirtd --config=$f 2> err && fail=1 + $abs_top_builddir/daemon/libvirtd --pid-file=pid-file --config=$f 2> err && fail=1 case $rhs in # '"'*) msg='should be a string';; -- 1.6.5.5

On Mon, Jan 25, 2010 at 02:46:38PM -0500, David Allan wrote:
The daemon-conf test would fail on my system if there was a system libvirtd running. In the course of troubleshooting that problem, I discovered that the daemon-conf script would always fail if run by itself because it found the line:
\# that each "PARAMETER = VALUE" line in this file have the parameter
which it mistook for a line containing a parameter. I have changed the test to avoid mistaking a line containing \"PARAMETER = VALUE\" for a parameter line.
The corrupted config tests turned out to be failing because the test daemon was discovering the pid file from the running daemon and exiting before it processed the test config file. Specifying the pid file for the corrupt config tests in the same way as for the valid config test solved that problem. --- tests/daemon-conf | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/daemon-conf b/tests/daemon-conf index 1eb4be1..10c1628 100755 --- a/tests/daemon-conf +++ b/tests/daemon-conf @@ -19,7 +19,7 @@ grep '^#define WITH_QEMU 1' "$CONFIG_HEADER" > /dev/null || conf="$abs_top_srcdir/daemon/libvirtd.conf"
# Ensure that each commented out PARAMETER = VALUE line has the expected form. -grep '[a-z_] *= *[^ ]' "$conf" | grep -vE '^#[a-z_]+ = ' \ +grep -v '\"PARAMETER = VALUE\"' "$conf" | grep '[a-z_] *= *[^ ]' | grep -vE '^#[a-z_]+ = ' \ && { echo "$0: found unexpected lines (above) in $conf" 1>&2; exit 1; }
# Start with the sample libvirtd.conf file, uncommenting all real directives. @@ -45,7 +45,7 @@ while :; do esac
# Run libvirtd, expecting it to fail. - $abs_top_builddir/daemon/libvirtd --config=$f 2> err && fail=1 + $abs_top_builddir/daemon/libvirtd --pid-file=pid-file --config=$f 2> err && fail=1
case $rhs in # '"'*) msg='should be a string';;
ACK 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 :|

On Mon, Jan 25, 2010 at 02:46:38PM -0500, David Allan wrote:
The daemon-conf test would fail on my system if there was a system libvirtd running. In the course of troubleshooting that problem, I discovered that the daemon-conf script would always fail if run by itself because it found the line:
\# that each "PARAMETER = VALUE" line in this file have the parameter
which it mistook for a line containing a parameter. I have changed the test to avoid mistaking a line containing \"PARAMETER = VALUE\" for a parameter line.
The corrupted config tests turned out to be failing because the test daemon was discovering the pid file from the running daemon and exiting before it processed the test config file. Specifying the pid file for the corrupt config tests in the same way as for the valid config test solved that problem. --- tests/daemon-conf | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/daemon-conf b/tests/daemon-conf index 1eb4be1..10c1628 100755 --- a/tests/daemon-conf +++ b/tests/daemon-conf @@ -19,7 +19,7 @@ grep '^#define WITH_QEMU 1' "$CONFIG_HEADER" > /dev/null || conf="$abs_top_srcdir/daemon/libvirtd.conf"
# Ensure that each commented out PARAMETER = VALUE line has the expected form. -grep '[a-z_] *= *[^ ]' "$conf" | grep -vE '^#[a-z_]+ = ' \ +grep -v '\"PARAMETER = VALUE\"' "$conf" | grep '[a-z_] *= *[^ ]' | grep -vE '^#[a-z_]+ = ' \ && { echo "$0: found unexpected lines (above) in $conf" 1>&2; exit 1; }
# Start with the sample libvirtd.conf file, uncommenting all real directives. @@ -45,7 +45,7 @@ while :; do esac
# Run libvirtd, expecting it to fail. - $abs_top_builddir/daemon/libvirtd --config=$f 2> err && fail=1 + $abs_top_builddir/daemon/libvirtd --pid-file=pid-file --config=$f 2> err && fail=1
case $rhs in # '"'*) msg='should be a string';;
Digging my folder, I found that old patch which hadn't been commited, done now :-) Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On 02/19/2010 12:38 PM, Daniel Veillard wrote:
On Mon, Jan 25, 2010 at 02:46:38PM -0500, David Allan wrote:
The daemon-conf test would fail on my system if there was a system libvirtd running. In the course of troubleshooting that problem, I discovered that the daemon-conf script would always fail if run by itself because it found the line:
\# that each "PARAMETER = VALUE" line in this file have the parameter
which it mistook for a line containing a parameter. I have changed the test to avoid mistaking a line containing \"PARAMETER = VALUE\" for a parameter line.
The corrupted config tests turned out to be failing because the test daemon was discovering the pid file from the running daemon and exiting before it processed the test config file. Specifying the pid file for the corrupt config tests in the same way as for the valid config test solved that problem. --- tests/daemon-conf | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/daemon-conf b/tests/daemon-conf index 1eb4be1..10c1628 100755 --- a/tests/daemon-conf +++ b/tests/daemon-conf @@ -19,7 +19,7 @@ grep '^#define WITH_QEMU 1' "$CONFIG_HEADER"> /dev/null || conf="$abs_top_srcdir/daemon/libvirtd.conf"
# Ensure that each commented out PARAMETER = VALUE line has the expected form. -grep '[a-z_] *= *[^ ]' "$conf" | grep -vE '^#[a-z_]+ = ' \ +grep -v '\"PARAMETER = VALUE\"' "$conf" | grep '[a-z_] *= *[^ ]' | grep -vE '^#[a-z_]+ = ' \ && { echo "$0: found unexpected lines (above) in $conf" 1>&2; exit 1; }
# Start with the sample libvirtd.conf file, uncommenting all real directives. @@ -45,7 +45,7 @@ while :; do esac
# Run libvirtd, expecting it to fail. - $abs_top_builddir/daemon/libvirtd --config=$f 2> err&& fail=1 + $abs_top_builddir/daemon/libvirtd --pid-file=pid-file --config=$f 2> err&& fail=1
case $rhs in # '"'*) msg='should be a string';;
Digging my folder, I found that old patch which hadn't been commited, done now :-)
Daniel
Thanks Daniel, I've been meaning to push it for weeks and it keeps slipping my mind. Dave
participants (4)
-
Daniel P. Berrange
-
Daniel Veillard
-
Dave Allan
-
David Allan