[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 2a550c64635bf85aff342060b3d0268274415747

Andreas Beckmann debian at abeckmann.de
Sun Nov 27 22:21:50 UTC 2011


The following commit has been merged in the develop branch:
commit f10bb73f06f760f3097c31619eb3f276a6f45be2
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Fri Nov 11 12:11:02 2011 +0100

    add pre_test_ hooks
    
    Add a pre_test_* hook at the beginning of each test that is run
    after taking the metadata snapshot.
    Cleanup can be performed in post_remove_ or post_purge_.
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/README.txt b/README.txt
index 66e8327..b63b8a9 100644
--- a/README.txt
+++ b/README.txt
@@ -171,6 +171,10 @@ PIUPARTS_DISTRIBUTION.
 The following prefixes for scripts are recognized:
 
 'post_setup_' - after the *setup* of the chroot is finished.
+Before metadata of the chroot is recorded for later comparison.
+
+'pre_test_' - at the beginning of each test. After metadata of
+the chroot was recorded for later comparison.
 
 'pre_install_' - before *installing* your package. Depending on
 the test, this may be run multiple times. The PIUPARTS_TEST and
@@ -185,7 +189,8 @@ to distinguish the cases.
 
 'post_remove_' - after *removing* your package.
 
-'post_purge_' - after *purging* your package.
+'post_purge_' - after *purging* your package. Right before
+comparing the chroot with the initially recorded metadata.
 
 'pre_distupgrade_' - before *upgrading* the chroot to the *next
 distribution*. The next distribution is available in the variable
diff --git a/piuparts.py b/piuparts.py
index 3125cb6..061512a 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -1870,6 +1870,7 @@ def install_purge_test(chroot, root_info, selections, package_files, packages):
        chroot, with packages in states given by 'selections'."""
 
     os.environ["PIUPARTS_TEST"] = "install"
+    chroot.run_scripts("pre_test")
 
     # Install packages into the chroot.
     os.environ["PIUPARTS_PHASE"] = "install"
@@ -1943,6 +1944,7 @@ def install_upgrade_test(chroot, root_info, selections, package_files, packages)
     Return True if successful, False if not."""
 
     os.environ["PIUPARTS_TEST"] = "upgrade"
+    chroot.run_scripts("pre_test")
 
     # First install via apt-get.
     os.environ["PIUPARTS_PHASE"] = "install"
@@ -2054,6 +2056,8 @@ def install_and_upgrade_between_distros(package_files, packages):
 
     chroot.check_for_no_processes()
 
+    chroot.run_scripts("pre_test")
+
     os.environ["PIUPARTS_PHASE"] = "install"
 
     chroot.install_packages_by_name(packages)

-- 
piuparts git repository



More information about the Piuparts-commits mailing list