[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.49-167-gc2d72c8
Andreas Beckmann
anbe at debian.org
Thu Mar 7 11:00:07 UTC 2013
The following commit has been merged in the develop branch:
commit a384a3f87113ce820dae271737ff575794f463e1
Author: Andreas Beckmann <anbe at debian.org>
Date: Sun Mar 3 20:27:16 2013 +0100
p-s: use upgrade-test-distros to select the test
use len(get_distros()) > 1 to enable the distupgrade test
drop support for running both install/purge and distupgrade test for a section
Signed-off-by: Andreas Beckmann <anbe at debian.org>
diff --git a/README.txt b/README.txt
index f60f51d..d7b65a8 100644
--- a/README.txt
+++ b/README.txt
@@ -588,20 +588,19 @@ section, too, and will serve as defaults for all other sections
* "chroot-tgz" is the name of the file the slave should use for
the tarball to keep the chroot for the basic install/purge
testing. If the tarball doesn't exist, the slave creates it.
- This can be left empty if only upgrade tests should be run.
* "upgrade-test-distros" is the space delimited list of
distributions the slave should use for testing upgrades
between distributions (i.e., Debian versions). Using "partial"
distributions as defined in distros.conf is possible. Currently,
- "squeeze wheezy sid" is a good choice. Leave this unset if you
- do not want to run upgrade tests.
+ "squeeze wheezy sid" is a good choice.
+ Setting this switches from doing install/purge tests to
+ dist-upgrade tests. Not set by default.
* "upgrade-test-chroot-tgz" is the name of the file the slave
should use for the tarball to keep the chroot for the first
distribution in upgrade-test-distros. If the file does not exist,
- the slave creates it. This can be left empty if only basic tests
- should be run.
+ the slave creates it.
* "max-reserved" is the maximum number of packages the slave will
reserve at once. It should be large enough that the host that
diff --git a/debian/changelog b/debian/changelog
index 6eb3497..cbe2014 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -63,6 +63,9 @@ piuparts (0.50) UNRELEASED; urgency=low
- Use piuparts.conf global proxy setting as http_proxy and pass it to
piuparts via --proxy.
- Use distros.conf to compute URLs.
+ - Use the upgrade-test-distros setting to select between install/purge
+ test (if unset) and dist-upgrade test (if there are at least 2 distros).
+ Drop support for running both tests for a section.
* piuparts-analyze.py:
- Add support for magic "$DISTRO/None" versions.
* piuparts-report.py:
diff --git a/piuparts-slave.py b/piuparts-slave.py
index 68ebb68..4c80f92 100644
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -658,6 +658,16 @@ def test_package(config, pname, pvers, packages_files):
output.write(time.strftime("Start: %Y-%m-%d %H:%M:%S %Z\n",
time.gmtime()))
+ distupgrade = len(config.get_distros()) > 1
+ ret = 0
+
+ if not distupgrade:
+ basetgz = config["chroot-tgz"]
+ else:
+ basetgz = config["upgrade-test-chroot-tgz"]
+ if not basetgz:
+ ret = -11111
+
base_command = config["piuparts-command"].split()
if config["piuparts-flags"]:
base_command.extend(config["piuparts-flags"].split())
@@ -669,9 +679,8 @@ def test_package(config, pname, pvers, packages_files):
base_command.extend(["--tmpdir", config["tmpdir"]])
subdir = "fail"
- ret = 0
- if ret == 0 and config["chroot-tgz"]:
+ if ret == 0 and not distupgrade:
distro = config.get_distro()
if not pname in packages_files[distro]:
output.write("Package %s not found in %s\n" % (pname, distro))
@@ -687,7 +696,7 @@ def test_package(config, pname, pvers, packages_files):
if ret != 0:
subdir = "untestable"
- if ret == 0 and config["chroot-tgz"]:
+ if ret == 0 and not distupgrade:
command = base_command[:]
command.extend(["-b", config["chroot-tgz"]])
command.extend(["-d", config.get_distro()])
@@ -696,19 +705,7 @@ def test_package(config, pname, pvers, packages_files):
command.append("--keep-sources-list")
command.extend(["--apt", "%s=%s" % (pname, pvers)])
- output.write("Executing: %s\n" % " ".join(command))
- ret,f = run_test_with_timeout(command, MAX_WAIT_TEST_RUN)
- if not f or f[-1] != '\n':
- f += '\n'
- output.write(f)
- lastline = f.split('\n')[-2]
- if ret < 0:
- output.write(" *** Process KILLED - exceed maximum run time ***\n")
- elif not "piuparts run ends" in lastline:
- ret += 1024
- output.write(" *** PIUPARTS OUTPUT INCOMPLETE ***\n");
-
- if ret == 0 and config["upgrade-test-chroot-tgz"]:
+ if ret == 0 and distupgrade:
distros = config.get_distros()
if distros:
# the package must exist somewhere
@@ -744,13 +741,14 @@ def test_package(config, pname, pvers, packages_files):
if ret != 0:
subdir = "untestable"
- if ret == 0 and config["upgrade-test-chroot-tgz"]:
+ if ret == 0 and distupgrade:
command = base_command[:]
command.extend(["-b", config["upgrade-test-chroot-tgz"]])
for distro in config.get_distros():
command.extend(["-d", distro])
command.extend(["--apt", "%s=%s" % (pname, pvers)])
+ if ret == 0:
output.write("Executing: %s\n" % " ".join(command))
ret,f = run_test_with_timeout(command, MAX_WAIT_TEST_RUN)
if not f or f[-1] != '\n':
--
piuparts git repository
More information about the Piuparts-commits
mailing list