Merge lp:~gary/lpsetup/paralleltweaks into lp:lpsetup

Proposed by Gary Poster on 2012-06-27
Status: Merged
Approved by: Brad Crittenden on 2012-06-28
Approved revision: 35
Merged at revision: 38
Proposed branch: lp:~gary/lpsetup/paralleltweaks
Merge into: lp:lpsetup
Diff against target: 72 lines (+34/-8)
3 files modified
lpsetup/subcommands/lxcinstall.py (+19/-7)
lpsetup/templates/lp-setup-lxc-test (+1/-1)
lpsetup/templates/networking.conf (+14/-0)
To merge this branch: bzr merge lp:~gary/lpsetup/paralleltweaks
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code 2012-06-27 Approve on 2012-06-28
Gary Poster (community) Approve on 2012-06-27
Review via email: mp+112438@code.launchpad.net

Commit Message

add the tweaks necessary for bug 1013921 and bug 1014916

Description of the Change

This branch adds the tweaks necessary for bug 1013921 and bug 1014916.

 * For 1013921, make lp-setup-lxc-test include -vvv when calling bin/test so that testr gets test timings and can better balance tests.
 * For 1014916, only when the container OS is Lucid (not necessary for Precise), do the following:
   * Change /var/lib/lxc/lptests/rootfs/etc/init/networking.conf to not wait for udev (that is, use start on (local-filesystems))
   * in the host remove the container's /etc/init/udevtrigger.conf (rm /var/lib/lxc/lptests/rootfs/etc/init/udevtrigger.conf

See the relevant bugs for the reasoning, if desired.

Given our lack of integration tests, I manually tested this on ec2 and it seems to be fine.

Thank you

To post a comment you must log in.
Gary Poster (gary) wrote :

Ah right: I also changed the application of the fix for bug 974584 to only happen for lucid, as described by the preexisting comment.

review: Approve
Gary Poster (gary) wrote :

Oops, didn't mean to approve.

Brad Crittenden (bac) wrote :

This branch looks good. Thanks for the fixes Gary.

review: Approve (code)
Launchpad QA Bot (lpqabot) wrote :
Download full text (6.8 KiB)

The attempt to merge lp:~gary/lpsetup/paralleltweaks into lp:lpsetup failed. Below is the output from the failed tests.

nose.plugins.cover: ERROR: Coverage not available: unable to import coverage module
EEEEE...................EE
======================================================================
ERROR: Failure: ImportError (No module named shelltoolbox)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/tarmac/repos/lpsetup/trunk/lpsetup/tests/subcommands/test_get.py", line 9, in <module>
    from lpsetup import handlers
  File "/home/tarmac/repos/lpsetup/trunk/lpsetup/handlers.py", line 21, in <module>
    from shelltoolbox import (
ImportError: No module named shelltoolbox

======================================================================
ERROR: Failure: ImportError (No module named shelltoolbox)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/tarmac/repos/lpsetup/trunk/lpsetup/tests/subcommands/test_inithost.py", line 9, in <module>
    from lpsetup import handlers
  File "/home/tarmac/repos/lpsetup/trunk/lpsetup/handlers.py", line 21, in <module>
    from shelltoolbox import (
ImportError: No module named shelltoolbox

======================================================================
ERROR: Failure: ImportError (No module named shelltoolbox)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/tarmac/repos/lpsetup/trunk/lpsetup/tests/subcommands/test_install.py", line 9, in <module>
    from lpsetup import handlers
  File "/home/tarmac/repos/lpsetup/trunk/lpsetup/handlers.py", line 21, in <module>
    from shelltoolbox import (
ImportError: No module named shelltoolbox

======================================================================
ERROR: Failure: ImportError (No module named shelltoolbox)
-----------------------------------------------------...

Read more...

Launchpad QA Bot (lpqabot) wrote :
Download full text (3.4 KiB)

The attempt to merge lp:~gary/lpsetup/paralleltweaks into lp:lpsetup failed. Below is the output from the failed tests.

nose.plugins.cover: ERROR: Coverage not available: unable to import coverage module
......................................................................EEE..
======================================================================
ERROR: test_idempotent (lpsetup.tests.test_utils.ScrubberTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tarmac/repos/lpsetup/trunk/lpsetup/tests/test_utils.py", line 234, in test_idempotent
    self.lxc_pattern, get_running_containers())
  File "/home/tarmac/repos/lpsetup/trunk/lpsetup/utils.py", line 208, in __init__
    self.ignored_containers = list(ignored_containers)
  File "/home/tarmac/repos/lpsetup/trunk/lpsetup/utils.py", line 116, in get_running_containers
    containers = run('lxc-ls').split()
  File "/usr/lib/python2.7/dist-packages/shelltoolbox/__init__.py", line 418, in run
    close_fds=kwargs.pop('close_fds', True), **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

======================================================================
ERROR: test_scrub (lpsetup.tests.test_utils.ScrubberTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tarmac/repos/lpsetup/trunk/lpsetup/tests/test_utils.py", line 218, in test_scrub
    self.lxc_pattern, get_running_containers())
  File "/home/tarmac/repos/lpsetup/trunk/lpsetup/utils.py", line 208, in __init__
    self.ignored_containers = list(ignored_containers)
  File "/home/tarmac/repos/lpsetup/trunk/lpsetup/utils.py", line 116, in get_running_containers
    containers = run('lxc-ls').split()
  File "/usr/lib/python2.7/dist-packages/shelltoolbox/__init__.py", line 418, in run
    close_fds=kwargs.pop('close_fds', True), **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

======================================================================
ERROR: test_scrub_no_dir (lpsetup.tests.test_utils.ScrubberTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tarmac/repos/lpsetup/trunk/lpsetup/tests/test_utils.py", line 228, in test_scrub_no_dir
    self.lxc_pattern, get_running_containers())
  File "/home/tarmac/repos/lpsetup/trunk/lpsetup/utils.py", line 208, in __init__
    self.ignored_containers = list(ignored_containers)
  File "/home/tarmac/repos/lpsetup/trunk/lpsetup/utils.py", line 116, in get_running_containers
    containers = run('lxc-ls').split()
  File "/usr/lib/python2.7/dist-packages/shelltoolbox/__init__.py", line 418, in run
    close_fds=kwargs.pop('close_fds', True), **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 679, in __in...

Read more...

Brad Crittenden (bac) wrote :

Gary sorry I have taken your MP hostage as I work through these tarmac issues.

Gary Poster (gary) wrote :

:-) yay, it worked! Thank you

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lpsetup/subcommands/lxcinstall.py'
2--- lpsetup/subcommands/lxcinstall.py 2012-06-27 09:10:56 +0000
3+++ lpsetup/subcommands/lxcinstall.py 2012-06-27 21:21:20 +0000
4@@ -134,13 +134,14 @@
5 dst = get_container_path(lxc_name, '/root/.ssh/')
6 mkdirs(dst)
7 shutil.copy(user_authorized_keys, dst)
8- # XXX 2012-04-18 frankban bug=974584:
9- # Add a line to the container's fstab to be able to create semaphores
10- # in lxc. This workaround needs to be removed once the lxc bug is
11- # resolved for lucid containers too.
12- file_append(
13- '/var/lib/lxc/{0}/fstab'.format(lxc_name),
14- 'none dev/shm tmpfs defaults 0 0\n')
15+ if lxc_os == 'lucid':
16+ # XXX 2012-04-18 frankban bug=974584:
17+ # Add a line to the container's fstab to be able to create semaphores
18+ # in lxc. This workaround needs to be removed once the lxc bug is
19+ # resolved for lucid containers too.
20+ file_append(
21+ '/var/lib/lxc/{0}/fstab'.format(lxc_name),
22+ 'none dev/shm tmpfs defaults 0 0\n')
23
24
25 def start_lxc(lxc_name):
26@@ -179,6 +180,17 @@
27 ssh(lxc_name,
28 'ln -s /usr/lib/graphviz /rootfs/usr/lib/graphviz',
29 key=ssh_key_path)
30+ # XXX gary 2012-06-26 bug=1014916: this fixes a bug in Lucid LXC
31+ # containers.
32+ if lxc_os == 'lucid':
33+ # Change /var/lib/lxc/lptests/rootfs/etc/init/networking.conf to not
34+ # wait for udev (that is, use start on (local-filesystems)).
35+ udevtrigger = get_container_path(
36+ lxc_name, '/etc/init/udevtrigger.conf')
37+ call('mv', udevtrigger, udevtrigger + '.orig')
38+ networking = get_container_path(lxc_name, '/etc/init/networking.conf')
39+ call('mv', networking, networking + '.orig')
40+ render_to_file('networking.conf', {}, networking)
41
42
43 def setup_launchpad_lxc(
44
45=== modified file 'lpsetup/templates/lp-setup-lxc-test'
46--- lpsetup/templates/lp-setup-lxc-test 2012-06-12 15:25:13 +0000
47+++ lpsetup/templates/lp-setup-lxc-test 2012-06-27 21:21:20 +0000
48@@ -20,4 +20,4 @@
49 lxc-start-ephemeral -u {user} -S '{ssh_key_path}' -o {lxc_name} -- \
50 "env -u LANG xvfb-run --error-file=/var/tmp/xvfb-errors.log \
51 --server-args='-screen 0 1024x768x24' \
52- -a $PWD/bin/test --shuffle --subunit $@"
53+ -a $PWD/bin/test -vvv --shuffle --subunit $@"
54
55=== added file 'lpsetup/templates/networking.conf'
56--- lpsetup/templates/networking.conf 1970-01-01 00:00:00 +0000
57+++ lpsetup/templates/networking.conf 2012-06-27 21:21:20 +0000
58@@ -0,0 +1,14 @@
59+# networking - configure virtual network devices
60+#
61+# This task causes virtual network devices that do not have an associated
62+# kernel object to be started on boot.
63+
64+description "configure virtual network devices"
65+
66+start on (local-filesystems)
67+
68+task
69+
70+pre-start exec mkdir -p /var/run/network
71+
72+exec ifup -a

Subscribers

People subscribed via source and target branches

to all changes: