Merge lp:~frankban/lpsetup/omit-haveged into lp:lpsetup

Proposed by Francesco Banconi
Status: Merged
Approved by: Francesco Banconi
Approved revision: 71
Merged at revision: 66
Proposed branch: lp:~frankban/lpsetup/omit-haveged
Merge into: lp:lpsetup
Diff against target: 118 lines (+26/-17)
5 files modified
lpsetup/handlers.py (+1/-0)
lpsetup/subcommands/initlxc.py (+18/-12)
lpsetup/subcommands/install_lxc.py (+3/-2)
lpsetup/tests/subcommands/test_initlxc.py (+3/-3)
lpsetup/tests/test_handlers.py (+1/-0)
To merge this branch: bzr merge lp:~frankban/lpsetup/omit-haveged
Reviewer Review Type Date Requested Status
Francesco Banconi (community) Approve
Brad Crittenden (community) code Approve
Review via email: mp+117401@code.launchpad.net

Commit message

Added --omit-haveged and --omit-subunit flags. Subunit is now installed by default.

Description of the change

== Changes ==

- added an option to skip subunit installatin (subunit is now installed by default)
- added an option to skip haveged installation
- handle_testing now includes haveged
- updated smoke tests with the new options (--omit-subunit, --omit-haveged)

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) wrote :

Looks fine Francesco. Thanks.

review: Approve (code)
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :

The attempt to merge lp:~frankban/lpsetup/omit-haveged into lp:lpsetup failed. Below is the output from the failed tests.

./lpsetup/subcommands/initlxc.py
     304: W391 blank line at end of file

lp:~frankban/lpsetup/omit-haveged updated
71. By Francesco Banconi

Lint.

Revision history for this message
Francesco Banconi (frankban) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lpsetup/handlers.py'
--- lpsetup/handlers.py 2012-07-27 08:25:02 +0000
+++ lpsetup/handlers.py 2012-07-31 12:37:20 +0000
@@ -279,6 +279,7 @@
279 """279 """
280 if getattr(namespace, 'testing', False):280 if getattr(namespace, 'testing', False):
281 namespace.create_scripts = True281 namespace.create_scripts = True
282 namespace.install_haveged = True
282 namespace.install_subunit = True283 namespace.install_subunit = True
283 namespace.interactive = False284 namespace.interactive = False
284 namespace.no_checkout = True285 namespace.no_checkout = True
285286
=== modified file 'lpsetup/subcommands/initlxc.py'
--- lpsetup/subcommands/initlxc.py 2012-07-30 13:37:25 +0000
+++ lpsetup/subcommands/initlxc.py 2012-07-31 12:37:20 +0000
@@ -57,16 +57,17 @@
57 )57 )
5858
5959
60def initialize(user):60def initialize(user, install_haveged):
61 """Initialize the LXC host."""61 """Initialize the LXC host."""
62 inithost.initialize_base(user)62 inithost.initialize_base(user)
63 # haveged is used to fill /dev/random, avoiding63 if install_haveged:
64 # entropy exhaustion during automated parallel tests.64 # haveged is used to fill /dev/random, avoiding
65 apt_get_install('haveged', caller=call)65 # entropy exhaustion during automated parallel tests.
66 apt_get_install('haveged', caller=call)
6667
67initialize.description = inithost.initialize_base.description + """Install \68initialize.description = inithost.initialize_base.description + """If \
68 haveged in order to fill /dev/random, avoiding entropy exhaustion \69 requested, install haveged in order to fill /dev/random, avoiding \
69 during automated parallel tests.70 entropy exhaustion during automated parallel tests.
70"""71"""
7172
7273
@@ -248,7 +249,7 @@
248 'lxc_name', 'ssh_key_path')249 'lxc_name', 'ssh_key_path')
249250
250 base_steps = (251 base_steps = (
251 (initialize, 'user'),252 (initialize, 'user', 'install_haveged'),
252 inithost.SubCommand.setup_home_step,253 inithost.SubCommand.setup_home_step,
253 create_lxc_step,254 create_lxc_step,
254 start_lxc_step,255 start_lxc_step,
@@ -286,10 +287,15 @@
286 '--stop-lxc', action='store_true',287 '--stop-lxc', action='store_true',
287 help='Shut down the LXC container at the end of the process.')288 help='Shut down the LXC container at the end of the process.')
288 parser.add_argument(289 parser.add_argument(
289 '--install-subunit', action='store_true',290 '--omit-subunit', action='store_false', dest='install_subunit',
290 help='Install subunit in the host machine. Activate this if you '291 help='Do not install subunit in the host machine. Subunit should '
291 'are using this command to create an automated parallel '292 'be usually installed if you are using this command to '
292 'testing environment e.g. for buildbot.')293 'create an automated parallel testing environment.')
294 parser.add_argument(
295 '--omit-haveged', action='store_false', dest='install_haveged',
296 help='Do not install haveged in the host machine. Haveged is '
297 'used to fill /dev/random, avoiding entropy exhaustion '
298 'during automated parallel tests.')
293 parser.add_argument(299 parser.add_argument(
294 '-B', '--lpsetup-branch', default=None,300 '-B', '--lpsetup-branch', default=None,
295 help='The Launchpad branch to use for lpsetup inside the '301 help='The Launchpad branch to use for lpsetup inside the '
296302
=== modified file 'lpsetup/subcommands/install_lxc.py'
--- lpsetup/subcommands/install_lxc.py 2012-07-30 10:05:19 +0000
+++ lpsetup/subcommands/install_lxc.py 2012-07-31 12:37:20 +0000
@@ -171,5 +171,6 @@
171 help='Create the scripts used by buildbot for parallel testing.')171 help='Create the scripts used by buildbot for parallel testing.')
172 parser.add_argument(172 parser.add_argument(
173 '--testing', action='store_true',173 '--testing', action='store_true',
174 help='Alias for --create-scripts --install-subunit --no-checkout '174 help='Alias for --create-scripts --no-checkout --stop_lxc '
175 '--stop_lxc --use-http --yes.')175 '--use-http --yes. This flag also forces subunit and '
176 'haveged installation in the host machine.')
176177
=== modified file 'lpsetup/tests/subcommands/test_initlxc.py'
--- lpsetup/tests/subcommands/test_initlxc.py 2012-07-24 15:34:58 +0000
+++ lpsetup/tests/subcommands/test_initlxc.py 2012-07-31 12:37:20 +0000
@@ -18,7 +18,7 @@
18 StepsBasedSubCommandTestMixin,18 StepsBasedSubCommandTestMixin,
19 )19 )
2020
21initialize_step = (initlxc.initialize, ['user'])21initialize_step = (initlxc.initialize, ['user', 'install_haveged'])
22create_lxc_step = (22create_lxc_step = (
23 initlxc.create_lxc,23 initlxc.create_lxc,
24 ['lxc_name', 'lxc_arch', 'lxc_os', 'user', 'install_subunit'])24 ['lxc_name', 'lxc_arch', 'lxc_os', 'user', 'install_subunit'])
@@ -40,8 +40,8 @@
40 lxc_arch = random.choice(['i386', 'amd64'])40 lxc_arch = random.choice(['i386', 'amd64'])
41 lxc_os = random.choice(settings.LXC_GUEST_CHOICES)41 lxc_os = random.choice(settings.LXC_GUEST_CHOICES)
42 return (42 return (
43 lxc_name, '-A', lxc_arch, '-R', lxc_os,43 lxc_name, '-A', lxc_arch, '-R', lxc_os, '--stop-lxc',
44 '--stop-lxc', '--install-subunit') + inithost_arguments44 '--omit-subunit', '--omit-haveged') + inithost_arguments
4545
4646
47class InitLxcTest(StepsBasedSubCommandTestMixin, unittest.TestCase):47class InitLxcTest(StepsBasedSubCommandTestMixin, unittest.TestCase):
4848
=== modified file 'lpsetup/tests/test_handlers.py'
--- lpsetup/tests/test_handlers.py 2012-07-27 08:25:02 +0000
+++ lpsetup/tests/test_handlers.py 2012-07-31 12:37:20 +0000
@@ -311,6 +311,7 @@
311311
312 ctx = {312 ctx = {
313 'create_scripts': True,313 'create_scripts': True,
314 'install_haveged': False,
314 'install_subunit': False,315 'install_subunit': False,
315 'no_checkout': True,316 'no_checkout': True,
316 'stop_lxc': False,317 'stop_lxc': False,

Subscribers

People subscribed via source and target branches

to all changes: