[Piuparts-commits] rev 640 - in trunk: . debian

Holger Levsen holger at alioth.debian.org
Sun Feb 14 17:45:43 UTC 2010


Author: holger
Date: 2010-02-14 17:45:40 +0000 (Sun, 14 Feb 2010)
New Revision: 640

Modified:
   trunk/README.txt
   trunk/debian/changelog
   trunk/piuparts-master.py
   trunk/piuparts-slave.py
Log:
    - add support for only doing upgrade tests (without the basic test in the
      upgrade target distro).



Modified: trunk/README.txt
===================================================================
--- trunk/README.txt	2010-02-11 14:42:24 UTC (rev 639)
+++ trunk/README.txt	2010-02-14 17:45:40 UTC (rev 640)
@@ -382,13 +382,13 @@
   
 * "piuparts-cmd" is the command the slave uses to start piuparts. It should include 'sudo' if necessary so that piuparts runs with sufficient priviledges to do its testing (and that means root priviledges).
   
-* "distro" is the distribution the slave should tell piuparts to use for basic install/purge testing.
+* "distro" is the distribution the slave should tell piuparts to use for basic install/purge testing. This can be left empty if only upgrade tests should be run.
   
-* "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.
+* "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). Currently, "lenny squeeze sid" is a good choice.  Make this empty if you do not want to run upgrade tests.
+* "upgrade-test-distros" is the space delimited list of distributions the slave should use for testing upgrades between distributions (i.e., Debian versions). Currently, "lenny squeeze sid" is a good choice.  Leave this unset if you do not want to run upgrade tests.
 
-* "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.
+* "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.
 
 * "max-reserved" is the maximum number of packages the slave will reserve at once. It should be large enough that the host that runs master is not unduly stressed by frequent ssh logins and running master (both of which take quite a bit of CPU cycles), yet at the same time it should not be so large that one slave grabs so many packages all other slaves just sit idle. The number obviously depends on the speed of the slave. A good value seems to be enough to let the slave test packages for about an hour before reporting results and reserving more. For a contemporary AMD64 machine with a reasonably fast disk subsystem the value 50 seems to work fine.
 

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2010-02-11 14:42:24 UTC (rev 639)
+++ trunk/debian/changelog	2010-02-14 17:45:40 UTC (rev 640)
@@ -17,7 +17,10 @@
     (=waiting-to-be-tested is calculated correctly). This bug was present
     before this change.
 TODO: make packagesDB.py read config
-  * piuparts-slave.py: fix crash when going into sleep when idle. 
+  * piuparts-slave.py: 
+    - fix crash when going into sleep when idle. 
+    - add support for only doing upgrade tests (without the basic test in the
+      upgrade target distro). 
   * Add ${misc:Depends} to Depends in debian/control. 
   * Makefile: support python 2.5 and 2.6 instead of 2.4 and 2.5, adjust
     debian/control accordingly.

Modified: trunk/piuparts-master.py
===================================================================
--- trunk/piuparts-master.py	2010-02-11 14:42:24 UTC (rev 639)
+++ trunk/piuparts-master.py	2010-02-14 17:45:40 UTC (rev 640)
@@ -55,8 +55,8 @@
             {
                 "log-file": None,
                 "packages-url": None,
-            },
-            ["packages-url"])
+                "master-directory": ".",
+            }, "")
 
 
 class CommandSyntaxError(Exception):
@@ -181,11 +181,18 @@
 def main():
     # piuparts-master is always called by the slave with a section as argument
     if len(sys.argv) == 2:
+        global_config = Config(section="global")
+        global_config.read(CONFIG_FILE)
+        master_directory = global_config["master-directory"]
+
         section = sys.argv[1]
         config = Config(section=section)
         config.read(CONFIG_FILE)
     
         setup_logging(logging.DEBUG, config["log-file"])
+
+        if not os.path.exists(os.path.join(master_directory, section)):
+          os.makedirs(os.path.join(master_directory, section))
     
         logging.info("Fetching %s" % config["packages-url"])
         packages_file = piupartslib.open_packages_url(config["packages-url"])
@@ -193,7 +200,9 @@
         packages_file.close()
         while m.do_transaction():
             pass
+    else:
+        print 'piuparts-master needs to be called with a valid sectionname as argument, exiting...'
+        sys.exit(1)
 
-
 if __name__ == "__main__":
     main()

Modified: trunk/piuparts-slave.py
===================================================================
--- trunk/piuparts-slave.py	2010-02-11 14:42:24 UTC (rev 639)
+++ trunk/piuparts-slave.py	2010-02-14 17:45:40 UTC (rev 640)
@@ -339,24 +339,28 @@
     output.write("\n")
     package.dump(output)
     output.write("\n")
+   
+    # omit distro test if chroot-tgz is not specified.
+    if config["chroot-tgz"]: 
+      command = "%(piuparts-cmd)s -ad %(distro)s -b %(chroot-tgz)s " % \
+                  config
+      if config["keep-sources-list"] in ["yes", "true"]:
+          command += "--keep-sources-list "
     
-    command = "%(piuparts-cmd)s -ad %(distro)s -b %(chroot-tgz)s " % \
-                config
-    if config["keep-sources-list"] in ["yes", "true"]:
-        command += "--keep-sources-list "
-    
-    if config["mirror"]:
-        command += "--mirror %s " % config["mirror"]
-    command += package["Package"]
+      if config["mirror"]:
+          command += "--mirror %s " % config["mirror"]
+      command += package["Package"]
 
-    logging.debug("Executing: %s" % command)
-    output.write("Executing: %s\n" % command)
-    f = os.popen("{ %s; } 2>&1" % command, "r")
-    for line in f:
-        output.write(line)
-    status = f.close()
-    if status is None:
-        status = 0
+      logging.debug("Executing: %s" % command)
+      output.write("Executing: %s\n" % command)
+      f = os.popen("{ %s; } 2>&1" % command, "r")
+      for line in f:
+          output.write(line)
+      status = f.close()
+      if status is None:
+          status = 0
+    else:
+          status = 0
 
     if status == 0 and upgrade_testable(config, package, packages_files):
         distros = config["upgrade-test-distros"].split()




More information about the Piuparts-commits mailing list