← Back to team overview

yellow team mailing list archive

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

 

Francesco Banconi has proposed merging lp:~frankban/lpsetup/omit-haveged into lp:lpsetup.

Requested reviews:
  Yellow Squad (yellow)

For more details, see:
https://code.launchpad.net/~frankban/lpsetup/omit-haveged/+merge/117401

== 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)


-- 
https://code.launchpad.net/~frankban/lpsetup/omit-haveged/+merge/117401
Your team Yellow Squad is requested to review the proposed merge of lp:~frankban/lpsetup/omit-haveged into lp:lpsetup.
=== modified file 'lpsetup/handlers.py'
--- lpsetup/handlers.py	2012-07-27 08:25:02 +0000
+++ lpsetup/handlers.py	2012-07-31 10:07:20 +0000
@@ -279,6 +279,7 @@
     """
     if getattr(namespace, 'testing', False):
         namespace.create_scripts = True
+        namespace.install_haveged = True
         namespace.install_subunit = True
         namespace.interactive = False
         namespace.no_checkout = True

=== modified file 'lpsetup/subcommands/initlxc.py'
--- lpsetup/subcommands/initlxc.py	2012-07-30 13:37:25 +0000
+++ lpsetup/subcommands/initlxc.py	2012-07-31 10:07:20 +0000
@@ -57,16 +57,17 @@
     )
 
 
-def initialize(user):
+def initialize(user, install_haveged):
     """Initialize the LXC host."""
     inithost.initialize_base(user)
-    # haveged is used to fill /dev/random, avoiding
-    # entropy exhaustion during automated parallel tests.
-    apt_get_install('haveged', caller=call)
+    if install_haveged:
+        # haveged is used to fill /dev/random, avoiding
+        # entropy exhaustion during automated parallel tests.
+        apt_get_install('haveged', caller=call)
 
-initialize.description = inithost.initialize_base.description + """Install \
-    haveged in order to fill /dev/random, avoiding entropy exhaustion \
-    during automated parallel tests.
+initialize.description = inithost.initialize_base.description + """If \
+    requested, install haveged in order to fill /dev/random, avoiding \
+    entropy exhaustion during automated parallel tests.
 """
 
 
@@ -248,7 +249,7 @@
         'lxc_name', 'ssh_key_path')
 
     base_steps = (
-        (initialize, 'user'),
+        (initialize, 'user', 'install_haveged'),
         inithost.SubCommand.setup_home_step,
         create_lxc_step,
         start_lxc_step,
@@ -286,12 +287,18 @@
             '--stop-lxc', action='store_true',
             help='Shut down the LXC container at the end of the process.')
         parser.add_argument(
-            '--install-subunit', action='store_true',
-            help='Install subunit in the host machine. Activate this if you '
-                 'are using this command to create an automated parallel '
-                 'testing environment e.g. for buildbot.')
+            '--omit-subunit', action='store_false', dest='install_subunit',
+            help='Do not install subunit in the host machine. Subunit should '
+                 'be usually installed if you are using this command to '
+                 'create an automated parallel testing environment.')
+        parser.add_argument(
+            '--omit-haveged', action='store_false', dest='install_haveged',
+            help='Do not install haveged in the host machine. Haveged is '
+                 'used to fill /dev/random, avoiding entropy exhaustion '
+                 'during automated parallel tests.')
         parser.add_argument(
             '-B', '--lpsetup-branch', default=None,
             help='The Launchpad branch to use for lpsetup inside the '
                  'container.  Useful for testing lpsetup changes.  '
                  'Leave unset to install from a Debian package.')
+

=== 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 10:07:20 +0000
@@ -171,5 +171,6 @@
             help='Create the scripts used by buildbot for parallel testing.')
         parser.add_argument(
             '--testing', action='store_true',
-            help='Alias for --create-scripts --install-subunit --no-checkout '
-                 '--stop_lxc --use-http --yes.')
+            help='Alias for --create-scripts --no-checkout --stop_lxc '
+                 '--use-http --yes. This flag also forces subunit and '
+                 'haveged installation in the host machine.')

=== 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 10:07:20 +0000
@@ -18,7 +18,7 @@
     StepsBasedSubCommandTestMixin,
     )
 
-initialize_step = (initlxc.initialize, ['user'])
+initialize_step = (initlxc.initialize, ['user', 'install_haveged'])
 create_lxc_step = (
     initlxc.create_lxc,
     ['lxc_name', 'lxc_arch', 'lxc_os', 'user', 'install_subunit'])
@@ -40,8 +40,8 @@
     lxc_arch = random.choice(['i386', 'amd64'])
     lxc_os = random.choice(settings.LXC_GUEST_CHOICES)
     return (
-        lxc_name, '-A', lxc_arch, '-R', lxc_os,
-        '--stop-lxc', '--install-subunit') + inithost_arguments
+        lxc_name, '-A', lxc_arch, '-R', lxc_os, '--stop-lxc',
+        '--omit-subunit', '--omit-haveged') + inithost_arguments
 
 
 class InitLxcTest(StepsBasedSubCommandTestMixin, unittest.TestCase):

=== 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 10:07:20 +0000
@@ -311,6 +311,7 @@
 
     ctx = {
         'create_scripts': True,
+        'install_haveged': False,
         'install_subunit': False,
         'no_checkout': True,
         'stop_lxc': False,