[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v3 02/19] apt: lock osstest's usages of apt-get against each other



Currently we rely on all apt-get invocations being in a single
ts-xen-build-prep job which can't run on a shared host.

That is a bit inflexible so instead use our own lock. We wait
indefinitely and rely on osstest's existing command timeout
infrastructure to catch problems.

target_install_packages*() previous estimated the time taken to
install the packages based on the number of packages. This no longer
applies because the install might get stuck behind some other large
install. Use a 3000s (nearly an hour) timeout instead (I expect
failures here to be unusual so erred on the big side)

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
v3: Drop timeout parameter to target_run_apt
    Reindent target_run_apt more sensibly
---
 Osstest/Debian.pm      |  2 +-
 Osstest/TestSupport.pm | 12 +++++-------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 7081a29..d4bf62d 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -492,7 +492,7 @@ d-i apt-setup/another boolean false
 d-i apt-setup/non-free boolean false
 d-i apt-setup/contrib boolean false
 
-d-i pkgsel/include string openssh-server, ntp, ntpdate, ethtool, 
$extra_packages
+d-i pkgsel/include string openssh-server, ntp, ntpdate, ethtool, 
chiark-utils-bin, $extra_packages
 
 $xopts{ExtraPreseed}
 
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index b983bd4..17fb4ce 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -434,20 +434,18 @@ sub target_putfile_root ($$$$;$) {
     tputfileex('root', @_);
 }
 sub target_run_apt {
-    my ($ho, $timeout, @aptopts) = @_;
+    my ($ho, @aptopts) = @_;
     target_cmd_root($ho,
-   "DEBIAN_PRIORITY=critical UCF_FORCE_CONFFOLD=y apt-get @aptopts",
-                    $timeout);
+        "DEBIAN_PRIORITY=critical UCF_FORCE_CONFFOLD=y \
+            with-lock-ex -w /var/lock/osstest-apt apt-get @aptopts", 3000);
 }
 sub target_install_packages {
     my ($ho, @packages) = @_;
-    target_run_apt($ho, 300 + 100 * @packages,
-                  qw(-y install), @packages);
+    target_run_apt($ho, qw(-y install), @packages);
 }
 sub target_install_packages_norec {
     my ($ho, @packages) = @_;
-    target_run_apt($ho, 300 + 100 * @packages,
-                  qw(--no-install-recommends -y install), @packages);
+    target_run_apt($ho, qw(--no-install-recommends -y install), @packages);
 }
 
 sub target_somefile_getleaf ($$$) {
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.