[libvirt] [PATCH] tests: fix daemon-conf testing failure

libvirtd.conf uses "libvirt" as the value of "unix_sock_group", however, group "libvirt" may not exist on system, in this case the case will always be failed, which will cause 'make check' , and 'make rpm' always be failed further more. As a solution, replace "libvirt" with "root" in "tmp.conf". * tests/daemon-conf --- tests/daemon-conf | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/tests/daemon-conf b/tests/daemon-conf index 6c91d96..225f84c 100755 --- a/tests/daemon-conf +++ b/tests/daemon-conf @@ -25,6 +25,9 @@ grep -v '\"PARAMETER = VALUE\"' "$conf" | grep '[a-z_] *= *[^ ]' | grep -vE '^ # Start with the sample libvirtd.conf file, uncommenting all real directives. sed -n 's/^#\([^ #]\)/\1/p' "$conf" > tmp.conf +sed -e 's/^\(unix_sock_group =\).*/\1 "root"/g' tmp.conf > k +mv k tmp.conf + # Iterate through that list of directives, corrupting one RHS at a # time and running libvirtd with the resulting config. Each libvirtd # invocation must fail. -- 1.7.2.3

On Tue, Nov 02, 2010 at 05:11:22PM +0800, Osier Yang wrote:
libvirtd.conf uses "libvirt" as the value of "unix_sock_group", however, group "libvirt" may not exist on system, in this case the case will always be failed, which will cause 'make check' , and 'make rpm' always be failed further more.
As a solution, replace "libvirt" with "root" in "tmp.conf".
* tests/daemon-conf --- tests/daemon-conf | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/tests/daemon-conf b/tests/daemon-conf index 6c91d96..225f84c 100755 --- a/tests/daemon-conf +++ b/tests/daemon-conf @@ -25,6 +25,9 @@ grep -v '\"PARAMETER = VALUE\"' "$conf" | grep '[a-z_] *= *[^ ]' | grep -vE '^ # Start with the sample libvirtd.conf file, uncommenting all real directives. sed -n 's/^#\([^ #]\)/\1/p' "$conf" > tmp.conf
+sed -e 's/^\(unix_sock_group =\).*/\1 "root"/g' tmp.conf > k +mv k tmp.conf + # Iterate through that list of directives, corrupting one RHS at a # time and running libvirtd with the resulting config. Each libvirtd # invocation must fail.
Does this still work when running as non-root, or would it be better to subsitute in $USER ? Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

于 2010年11月02日 18:44, Daniel P. Berrange 写道:
On Tue, Nov 02, 2010 at 05:11:22PM +0800, Osier Yang wrote:
libvirtd.conf uses "libvirt" as the value of "unix_sock_group", however, group "libvirt" may not exist on system, in this case the case will always be failed, which will cause 'make check' , and 'make rpm' always be failed further more.
As a solution, replace "libvirt" with "root" in "tmp.conf".
* tests/daemon-conf --- tests/daemon-conf | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/tests/daemon-conf b/tests/daemon-conf index 6c91d96..225f84c 100755 --- a/tests/daemon-conf +++ b/tests/daemon-conf @@ -25,6 +25,9 @@ grep -v '\"PARAMETER = VALUE\"' "$conf" | grep '[a-z_] *= *[^ ]' | grep -vE '^ # Start with the sample libvirtd.conf file, uncommenting all real directives. sed -n 's/^#\([^ #]\)/\1/p' "$conf"> tmp.conf
+sed -e 's/^\(unix_sock_group =\).*/\1 "root"/g' tmp.conf> k +mv k tmp.conf + # Iterate through that list of directives, corrupting one RHS at a # time and running libvirtd with the resulting config. Each libvirtd # invocation must fail.
Does this still work when running as non-root, or would it be better to subsitute in $USER ?
guess it will not, $USER is better. will update. thanks. :-) - Osier
Daniel

libvirtd.conf uses "libvirt" as the value of "unix_sock_group", however, group "libvirt" may not exist on system, in this case the case will always be failed. As a solution, replace "libvirt" with "root" in "tmp.conf". * tests/daemon-conf --- tests/daemon-conf | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/tests/daemon-conf b/tests/daemon-conf index 6c91d96..225f84c 100755 --- a/tests/daemon-conf +++ b/tests/daemon-conf @@ -25,6 +25,9 @@ grep -v '\"PARAMETER = VALUE\"' "$conf" | grep '[a-z_] *= *[^ ]' | grep -vE '^ # Start with the sample libvirtd.conf file, uncommenting all real directives. sed -n 's/^#\([^ #]\)/\1/p' "$conf" > tmp.conf +sed -e "s/^\(unix_sock_group =\).*/\1 \"$USER\"/g" tmp.conf > k +mv k tmp.conf + # Iterate through that list of directives, corrupting one RHS at a # time and running libvirtd with the resulting config. Each libvirtd # invocation must fail. -- 1.7.2.3

On Tue, Nov 02, 2010 at 10:54:12PM +0800, Osier Yang wrote:
libvirtd.conf uses "libvirt" as the value of "unix_sock_group", however, group "libvirt" may not exist on system, in this case the case will always be failed.
As a solution, replace "libvirt" with "root" in "tmp.conf".
* tests/daemon-conf --- tests/daemon-conf | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/tests/daemon-conf b/tests/daemon-conf index 6c91d96..225f84c 100755 --- a/tests/daemon-conf +++ b/tests/daemon-conf @@ -25,6 +25,9 @@ grep -v '\"PARAMETER = VALUE\"' "$conf" | grep '[a-z_] *= *[^ ]' | grep -vE '^ # Start with the sample libvirtd.conf file, uncommenting all real directives. sed -n 's/^#\([^ #]\)/\1/p' "$conf" > tmp.conf
+sed -e "s/^\(unix_sock_group =\).*/\1 \"$USER\"/g" tmp.conf > k +mv k tmp.conf + # Iterate through that list of directives, corrupting one RHS at a # time and running libvirtd with the resulting config. Each libvirtd # invocation must fail.
Okay ACK, pushed thanks :-) 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/
participants (4)
-
Daniel P. Berrange
-
Daniel Veillard
-
Osier
-
Osier Yang