diff test/test_builder.py @ 119:92116333ef77

Add PBuilder.run_script method and associated tests. The run_script method allows arbitrary scripts to be run in the pbuilder chroot environment
author Bernhard Herzog <bh@intevation.de>
date Wed, 21 May 2008 13:20:36 +0000
parents 9d59ed0e3116
children 890bb70920d6
line wrap: on
line diff
--- a/test/test_builder.py	Tue May 20 18:47:16 2008 +0000
+++ b/test/test_builder.py	Wed May 21 13:20:36 2008 +0000
@@ -60,3 +60,23 @@
                                  '--buildresult', binary_dir_name,
                                  'my_dsc_file'])
         self.failUnless(os.path.isdir(binary_dir_name))
+
+    def test_run_script(self):
+        builder = PBuilder("my_pbuilderrc", self.root_command)
+        builder.run_script("my_script", logfile="the_logfile")
+        self.check_command_line(['/usr/sbin/pbuilder', 'execute',
+                                 '--configfile', 'my_pbuilderrc',
+                                 '--logfile', 'the_logfile',
+                                 'my_script'])
+
+    def test_run_script_with_bindmounts(self):
+        builder = PBuilder("my_pbuilderrc", self.root_command)
+        builder.run_script("my_script", logfile="the_logfile",
+                           bindmounts=("/home/builder/foo",
+                                       "/home/builder/treepkg"))
+        self.check_command_line(['/usr/sbin/pbuilder', 'execute',
+                                 '--configfile', 'my_pbuilderrc',
+                                 '--logfile', 'the_logfile',
+                                 '--bindmounts', '/home/builder/foo',
+                                 '--bindmounts', '/home/builder/treepkg',
+                                 'my_script'])
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)