Merge lp:~niedbalski/charms/precise/vxlan-gateway/add-tests into lp:~springfield-team/charms/precise/vxlan-gateway/trunk

Proposed by Jorge Niedbalski
Status: Needs review
Proposed branch: lp:~niedbalski/charms/precise/vxlan-gateway/add-tests
Merge into: lp:~springfield-team/charms/precise/vxlan-gateway/trunk
Diff against target: 111 lines (+79/-1)
5 files modified
Makefile (+13/-0)
README.md (+2/-1)
test_requirements.txt (+6/-0)
tests/00_setup.sh (+14/-0)
tests/10_deploy_test.py (+44/-0)
To merge this branch: bzr merge lp:~niedbalski/charms/precise/vxlan-gateway/add-tests
Reviewer Review Type Date Requested Status
The Springfield Project Pending
Review via email: mp+219364@code.launchpad.net

Description of the change

- Added a functional tests skeleton for testing the vxlan-gateway deployment
 - export N1KV_SOURCE="deb https://user:<email address hidden>/springfield-team/n1kv-staging/ubuntu precise main|key_id"
 - make test

To post a comment you must log in.

Unmerged revisions

20. By Jorge Niedbalski

- Added a functional tests skeleton for testing the vxlan-gateway deployment
 - export N1KV_SOURCE="deb https://user:<email address hidden>/springfield-team/n1kv-staging/ubuntu precise main|key_id"
 - make test

19. By Jorge Niedbalski

Modified typo on documentation reference.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'Makefile'
2--- Makefile 1970-01-01 00:00:00 +0000
3+++ Makefile 2014-05-13 13:15:59 +0000
4@@ -0,0 +1,13 @@
5+#!/usr/bin/make
6+PYTHON := /usr/bin/env python
7+
8+build: sync-charm-helpers lint
9+
10+lint:
11+ @flake8 --ignore=E125,F401 tests
12+
13+test:
14+ #@pip install -r test_requirements.txt
15+ @PYTHONPATH=$(PYTHON_PATH):hooks/ nosetests --nologcapture tests/
16+
17+
18
19=== modified file 'README.md'
20--- README.md 2014-05-12 15:43:32 +0000
21+++ README.md 2014-05-13 13:15:59 +0000
22@@ -29,7 +29,8 @@
23
24 # Configuration
25
26-Glance API needs to establish credential with Keystone first. Please look at the procedure at http://docs.openstack.org/user-guide/content/cli_openrc.htmlexport
27+Glance API needs to establish credential with Keystone first. Please look at the procedure at
28+ http://docs.openstack.org/user-guide/content/cli_openrc.html#export
29
30 # Contact Information
31
32
33=== added file 'test_requirements.txt'
34--- test_requirements.txt 1970-01-01 00:00:00 +0000
35+++ test_requirements.txt 2014-05-13 13:15:59 +0000
36@@ -0,0 +1,6 @@
37+PyYAML==3.11
38+amulet==1.5.0
39+argparse==1.2.1
40+charmworldlib==0.3.0
41+requests==2.2.1
42+wsgiref==0.1.2
43
44=== added directory 'tests'
45=== added file 'tests/00_setup.sh'
46--- tests/00_setup.sh 1970-01-01 00:00:00 +0000
47+++ tests/00_setup.sh 2014-05-13 13:15:59 +0000
48@@ -0,0 +1,14 @@
49+#!/bin/sh
50+
51+# The script installs amulet and other tools needed for the amulet tests.
52+
53+set -x
54+
55+# Get the status of the amulet package, this returns 0 of package is installed.
56+dpkg -s amulet
57+if [ $? -ne 0 ]; then
58+ # Install the Amulet testing harness.
59+ sudo add-apt-repository -y ppa:juju/stable
60+ sudo apt-get update
61+ sudo apt-get install -y amulet
62+fi
63
64=== added file 'tests/10_deploy_test.py'
65--- tests/10_deploy_test.py 1970-01-01 00:00:00 +0000
66+++ tests/10_deploy_test.py 2014-05-13 13:15:59 +0000
67@@ -0,0 +1,44 @@
68+#!/usr/bin/env python
69+# -*- coding: utf-8 -*-
70+
71+__author__ = 'Jorge Niedbalski R. <jorge.niedbalski@canonical.com>'
72+
73+
74+import amulet
75+import unittest
76+import os
77+
78+
79+N1KV_SOURCE = os.environ.get("N1KV_SOURCE", None)
80+
81+if not N1KV_SOURCE:
82+ raise Exception("Please define the N1KV_SOURCE"
83+ " environment variable")
84+
85+class VxLanGatewayTest(unittest.TestCase):
86+
87+ def setUp(self):
88+ pass
89+
90+ def test_deployment_single(self):
91+ """Test a vxlan-gateway deployment"""
92+ self.deployment = amulet.Deployment(series="precise", sentries=False)
93+ self.deployment.add("nova-cloud-controller")
94+ self.deployment.add("vxlan-gateway")
95+ self.deployment.configure("vxlan-gateway", {
96+ 'n1kv-source': N1KV_SOURCE
97+ })
98+ self.deployment._relate("nova-cloud-controller", "vxlan-gateway")
99+ seconds = 600
100+
101+ try:
102+ self.deployment.setup(timeout=seconds)
103+ except amulet.helpers.TimeoutError:
104+ message = 'The environment did not setup in %d seconds.' % seconds
105+ amulet.raise_status(amulet.SKIP, msg=message)
106+ except:
107+ raise
108+
109+
110+if __name__ == "__main__":
111+ unittest.main()

Subscribers

People subscribed via source and target branches