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
1=== modified file 'lpsetup/handlers.py'
2--- lpsetup/handlers.py 2012-07-27 08:25:02 +0000
3+++ lpsetup/handlers.py 2012-07-31 12:37:20 +0000
4@@ -279,6 +279,7 @@
5 """
6 if getattr(namespace, 'testing', False):
7 namespace.create_scripts = True
8+ namespace.install_haveged = True
9 namespace.install_subunit = True
10 namespace.interactive = False
11 namespace.no_checkout = True
12
13=== modified file 'lpsetup/subcommands/initlxc.py'
14--- lpsetup/subcommands/initlxc.py 2012-07-30 13:37:25 +0000
15+++ lpsetup/subcommands/initlxc.py 2012-07-31 12:37:20 +0000
16@@ -57,16 +57,17 @@
17 )
18
19
20-def initialize(user):
21+def initialize(user, install_haveged):
22 """Initialize the LXC host."""
23 inithost.initialize_base(user)
24- # haveged is used to fill /dev/random, avoiding
25- # entropy exhaustion during automated parallel tests.
26- apt_get_install('haveged', caller=call)
27+ if install_haveged:
28+ # haveged is used to fill /dev/random, avoiding
29+ # entropy exhaustion during automated parallel tests.
30+ apt_get_install('haveged', caller=call)
31
32-initialize.description = inithost.initialize_base.description + """Install \
33- haveged in order to fill /dev/random, avoiding entropy exhaustion \
34- during automated parallel tests.
35+initialize.description = inithost.initialize_base.description + """If \
36+ requested, install haveged in order to fill /dev/random, avoiding \
37+ entropy exhaustion during automated parallel tests.
38 """
39
40
41@@ -248,7 +249,7 @@
42 'lxc_name', 'ssh_key_path')
43
44 base_steps = (
45- (initialize, 'user'),
46+ (initialize, 'user', 'install_haveged'),
47 inithost.SubCommand.setup_home_step,
48 create_lxc_step,
49 start_lxc_step,
50@@ -286,10 +287,15 @@
51 '--stop-lxc', action='store_true',
52 help='Shut down the LXC container at the end of the process.')
53 parser.add_argument(
54- '--install-subunit', action='store_true',
55- help='Install subunit in the host machine. Activate this if you '
56- 'are using this command to create an automated parallel '
57- 'testing environment e.g. for buildbot.')
58+ '--omit-subunit', action='store_false', dest='install_subunit',
59+ help='Do not install subunit in the host machine. Subunit should '
60+ 'be usually installed if you are using this command to '
61+ 'create an automated parallel testing environment.')
62+ parser.add_argument(
63+ '--omit-haveged', action='store_false', dest='install_haveged',
64+ help='Do not install haveged in the host machine. Haveged is '
65+ 'used to fill /dev/random, avoiding entropy exhaustion '
66+ 'during automated parallel tests.')
67 parser.add_argument(
68 '-B', '--lpsetup-branch', default=None,
69 help='The Launchpad branch to use for lpsetup inside the '
70
71=== modified file 'lpsetup/subcommands/install_lxc.py'
72--- lpsetup/subcommands/install_lxc.py 2012-07-30 10:05:19 +0000
73+++ lpsetup/subcommands/install_lxc.py 2012-07-31 12:37:20 +0000
74@@ -171,5 +171,6 @@
75 help='Create the scripts used by buildbot for parallel testing.')
76 parser.add_argument(
77 '--testing', action='store_true',
78- help='Alias for --create-scripts --install-subunit --no-checkout '
79- '--stop_lxc --use-http --yes.')
80+ help='Alias for --create-scripts --no-checkout --stop_lxc '
81+ '--use-http --yes. This flag also forces subunit and '
82+ 'haveged installation in the host machine.')
83
84=== modified file 'lpsetup/tests/subcommands/test_initlxc.py'
85--- lpsetup/tests/subcommands/test_initlxc.py 2012-07-24 15:34:58 +0000
86+++ lpsetup/tests/subcommands/test_initlxc.py 2012-07-31 12:37:20 +0000
87@@ -18,7 +18,7 @@
88 StepsBasedSubCommandTestMixin,
89 )
90
91-initialize_step = (initlxc.initialize, ['user'])
92+initialize_step = (initlxc.initialize, ['user', 'install_haveged'])
93 create_lxc_step = (
94 initlxc.create_lxc,
95 ['lxc_name', 'lxc_arch', 'lxc_os', 'user', 'install_subunit'])
96@@ -40,8 +40,8 @@
97 lxc_arch = random.choice(['i386', 'amd64'])
98 lxc_os = random.choice(settings.LXC_GUEST_CHOICES)
99 return (
100- lxc_name, '-A', lxc_arch, '-R', lxc_os,
101- '--stop-lxc', '--install-subunit') + inithost_arguments
102+ lxc_name, '-A', lxc_arch, '-R', lxc_os, '--stop-lxc',
103+ '--omit-subunit', '--omit-haveged') + inithost_arguments
104
105
106 class InitLxcTest(StepsBasedSubCommandTestMixin, unittest.TestCase):
107
108=== modified file 'lpsetup/tests/test_handlers.py'
109--- lpsetup/tests/test_handlers.py 2012-07-27 08:25:02 +0000
110+++ lpsetup/tests/test_handlers.py 2012-07-31 12:37:20 +0000
111@@ -311,6 +311,7 @@
112
113 ctx = {
114 'create_scripts': True,
115+ 'install_haveged': False,
116 'install_subunit': False,
117 'no_checkout': True,
118 'stop_lxc': False,

Subscribers

People subscribed via source and target branches

to all changes: