[libvirt/f15] make commandtest more robust

Laine Stump laine at fedoraproject.org
Wed Jul 6 15:11:20 UTC 2011


commit 05aa1933ee86001e3d4111920682087ab40e64ef
Author: Laine Stump <laine at laine.org>
Date:   Wed Jul 6 10:54:36 2011 -0400

    make commandtest more robust

 libvirt-0.8.8-make-commandtest-more-robust.patch |   32 ++++++++++++++++++++++
 libvirt.spec                                     |    3 ++
 2 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/libvirt-0.8.8-make-commandtest-more-robust.patch b/libvirt-0.8.8-make-commandtest-more-robust.patch
new file mode 100644
index 0000000..63a546f
--- /dev/null
+++ b/libvirt-0.8.8-make-commandtest-more-robust.patch
@@ -0,0 +1,32 @@
+From 12509c09a55bd2ab171f9fa029fb94f297adc0a0 Mon Sep 17 00:00:00 2001
+From: Daniel P. Berrange <berrange at redhat.com>
+Date: Thu, 24 Feb 2011 12:12:27 +0000
+Subject: [PATCH] Make commandtest more robust wrt its execution environment
+
+When executed from cron, commandtest would fail to correctly
+identify daemon processes. Set session ID and process group
+IDs at startup to ensure we have a consistent environment to
+run in.
+
+* tests/commandtest.c: Call setsid() and setpgid()
+---
+ tests/commandtest.c |    3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/tests/commandtest.c b/tests/commandtest.c
+index 7157c51..dc2f8a1 100644
+--- a/tests/commandtest.c
++++ b/tests/commandtest.c
+@@ -730,6 +730,9 @@ mymain(int argc, char **argv)
+     if (chdir("/tmp") < 0)
+         return(EXIT_FAILURE);
+ 
++    setpgid(0, 0);
++    setsid();
++
+     /* Kill off any inherited fds that might interfere with our
+      * testing.  */
+     fd = 3;
+-- 
+1.7.3.4
+
diff --git a/libvirt.spec b/libvirt.spec
index 2239557..6d31319 100644
--- a/libvirt.spec
+++ b/libvirt.spec
@@ -219,6 +219,7 @@ Patch7: %{name}-%{version}-virt-pki-validate-behave-when-CERTTOOL-is-missing.pat
 Patch8: %{name}-%{version}-build-add-dependency-on-gnutls-utils.patch
 Patch9: %{name}-%{version}-rpm-add-missing-dependencies.patch
 Patch10: %{name}-%{version}-remote-protect-against-integer-overflow.patch
+Patch11: %{name}-%{version}-make-commandtest-more-robust.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 URL: http://libvirt.org/
 BuildRequires: python-devel
@@ -501,6 +502,7 @@ of recent versions of Linux (and other OSes).
 %patch8 -p1
 %patch9 -p1
 %patch10 -p1
+%patch11 -p1
 
 %build
 %if ! %{with_xen}
@@ -1030,6 +1032,7 @@ fi
   Bug 717204
 - Add several build and runtime dependencies to specfile
   Bug 680270
+- Make commandtest more robust.
 
 * Tue Apr  5 2011 Laine Stump <laine at redhat.com> 0.8.8-4
 - Fix for CVE-2011-1486, error reporting in libvirtd is not thread safe,


More information about the scm-commits mailing list