comparison test/test_builder.py @ 122:6e34fc4ebe39

New arguments for the PBuilder.build method: - bindmounts to specify extra directories to be bind-mounted in the chroot (corresponds to pbuilder's --bindmounts option) - extra_packages to specify extra packages to be installed in the chroot (corresponds to pbuilder's --extrapackages option) Also adds corresponding test cases.
author Bernhard Herzog <bh@intevation.de>
date Thu, 22 May 2008 09:58:57 +0000
parents 890bb70920d6
children 68d829cac3ff
comparison
equal deleted inserted replaced
121:890bb70920d6 122:6e34fc4ebe39
57 57
58 builder = PBuilder("my_pbuilderrc", self.root_command) 58 builder = PBuilder("my_pbuilderrc", self.root_command)
59 builder.build("my_dsc_file", binary_dir_name, "the_logfile") 59 builder.build("my_dsc_file", binary_dir_name, "the_logfile")
60 self.check_command_line(['/usr/sbin/pbuilder', 'build', 60 self.check_command_line(['/usr/sbin/pbuilder', 'build',
61 '--configfile', 'my_pbuilderrc', 61 '--configfile', 'my_pbuilderrc',
62 '--logfile', 'the_logfile',
63 '--buildresult', binary_dir_name,
64 'my_dsc_file'])
65 self.failUnless(os.path.isdir(binary_dir_name))
66
67 def test_build_with_bindmounts(self):
68 """Tests the PBuilder.build method with the bindmounts parameter"""
69 binary_dir_name = self.temp_file_name("binary")
70 if os.path.exists(binary_dir_name):
71 os.rmdir(binary_dir_name)
72 # sanity check: the binary directory must not exist yet.
73 self.failIf(os.path.exists(binary_dir_name))
74
75 builder = PBuilder("my_pbuilderrc", self.root_command)
76 builder.build("my_dsc_file", binary_dir_name, "the_logfile",
77 bindmounts=["/home/builder/tracks",
78 "/home/builder/pbuilder"])
79 self.check_command_line(['/usr/sbin/pbuilder', 'build',
80 '--configfile', 'my_pbuilderrc',
81 '--bindmounts', "/home/builder/tracks",
82 '--bindmounts', "/home/builder/pbuilder",
83 '--logfile', 'the_logfile',
84 '--buildresult', binary_dir_name,
85 'my_dsc_file'])
86 self.failUnless(os.path.isdir(binary_dir_name))
87
88 def test_build_with_extra_packages(self):
89 """Tests the PBuilder.build method with the extra_packages parameter"""
90 binary_dir_name = self.temp_file_name("binary")
91 if os.path.exists(binary_dir_name):
92 os.rmdir(binary_dir_name)
93 # sanity check: the binary directory must not exist yet.
94 self.failIf(os.path.exists(binary_dir_name))
95
96 builder = PBuilder("my_pbuilderrc", self.root_command)
97 builder.build("my_dsc_file", binary_dir_name, "the_logfile",
98 extra_packages=["subversion", "texinfo"])
99 self.check_command_line(['/usr/sbin/pbuilder', 'build',
100 '--configfile', 'my_pbuilderrc',
101 '--extrapackages', "subversion",
102 '--extrapackages', "texinfo",
62 '--logfile', 'the_logfile', 103 '--logfile', 'the_logfile',
63 '--buildresult', binary_dir_name, 104 '--buildresult', binary_dir_name,
64 'my_dsc_file']) 105 'my_dsc_file'])
65 self.failUnless(os.path.isdir(binary_dir_name)) 106 self.failUnless(os.path.isdir(binary_dir_name))
66 107
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)