Merge lp:~abentley/lp-dev-utils/cs-test into lp:lp-dev-utils

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 114
Proposed branch: lp:~abentley/lp-dev-utils/cs-test
Merge into: lp:lp-dev-utils
Diff against target: 34 lines (+30/-0)
1 file modified
cs-test (+30/-0)
To merge this branch: bzr merge lp:~abentley/lp-dev-utils/cs-test
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+133712@code.launchpad.net

Commit message

Add cs-test script that creates a test env on Canonistack.

Description of the change

This branch adds cs-test, a script for setting up a test environment on CanoniStack. It uses clould-init and lp-setup to do this. The idea is that it will eventually be able to replace ec2 land. For now, it's a bash script, but I could imagine turning it into Python.

Right now, it's good for running a subset of tests, but since it runs on Quantal, there are a few test failures. (It runs on Quantal because that's the easiest place to get python-shelltoolbox.)

It works by emitting a script that can be supplied to --user-data, and then running euca-run-instances appropriately.

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

This is really interesting Aaron. It is simpler than I would've expected.

Thanks for the chat on IRC.

It looks good for a first pass.

If you wanted to run on precise we could update existing PPAs that have python-shelltoolbox.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'cs-test'
2--- cs-test 1970-01-01 00:00:00 +0000
3+++ cs-test 2012-11-09 16:50:26 +0000
4@@ -0,0 +1,30 @@
5+#!/bin/sh
6+set -e
7+branch=$(bzr config public_branch|sed s/^bzr+ssh/http/)
8+email=$(bzr whoami --email)
9+full_name=$(bzr whoami | sed -E 's/ [<].*$]*//')
10+launchpad_username=$(bzr config launchpad_username)
11+cloud_init_script=$(mktemp)
12+cat >$cloud_init_script << EOT
13+#!/bin/sh
14+set -e
15+apt-get install -y lxc python-shelltoolbox python-pocket-lint python-nose python-germinate
16+mkdir -p /opt/launchpad
17+chown ubuntu /opt/launchpad
18+cd /opt/launchpad
19+wget http://bazaar.launchpad.net/~canonical-launchpad-branches/lpsetup/trunk/tarball -O lpsetup.tar.gz
20+wget http://bazaar.launchpad.net/~launchpad/lp-source-dependencies/trunk/tarball -O download-cache.tar.gz
21+mkdir lpsetup
22+tar --strip-components 3 -xzvf lpsetup.tar.gz -C lpsetup
23+cd lpsetup
24+python setup.py install
25+yes | lp-setup init-target -f '$full_name' -l $launchpad_username -E $email -u ubuntu
26+su ubuntu -c 'bzr checkout --lightweight $branch ../launchpad'
27+cd ../launchpad
28+su ubuntu -c 'utilities/update-sourcecode'
29+su ubuntu -c 'mkdir download-cache'
30+su ubuntu -c 'tar --strip-components 3 -xzvf ../download-cache.tar.gz -C download-cache'
31+su ubuntu -c 'make schema'
32+EOT
33+. $HOME/.canonistack/novarc
34+euca-run-instances ami-00000168 -t m1.small -k ${OS_USERNAME}_$OS_REGION_NAME --user-data-file $cloud_init_script

Subscribers

People subscribed via source and target branches