Merge lp:~marcoceppi/charms/precise/stackmobile/tests into lp:charms/stackmobile

Proposed by Marco Ceppi
Status: Merged
Merged at revision: 12
Proposed branch: lp:~marcoceppi/charms/precise/stackmobile/tests
Merge into: lp:charms/stackmobile
Diff against target: 68 lines (+58/-0)
2 files modified
tests/00-setup (+5/-0)
tests/99-autogen (+53/-0)
To merge this branch: bzr merge lp:~marcoceppi/charms/precise/stackmobile/tests
Reviewer Review Type Date Requested Status
José Antonio Rey (community) Approve
Cory Johns (community) Needs Fixing
Review Queue (community) automated testing Needs Fixing
Review via email: mp+240912@code.launchpad.net

Commit message

Tests for charm

To post a comment you must log in.
Revision history for this message
Review Queue (review-queue) wrote :

This items has failed automated testing! Results available here http://reports.vapour.ws/charm-tests/charm-bundle-test-10618-results

review: Needs Fixing (automated testing)
Revision history for this message
Cory Johns (johnsca) wrote :

Download in install hook is failing due to SSL handshake error with github.com:

--2014-12-12 16:24:08-- https://cloud.github.com/downloads/nathan-osman/Stack-Mobile/stackmobile_1.0.1.tar.gz
Resolving cloud.github.com (cloud.github.com)... 54.192.16.10, 54.192.16.11, 54.192.17.132, ...
Connecting to cloud.github.com (cloud.github.com)|54.192.16.10|:443... connected.
OpenSSL: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
Unable to establish SSL connection.

Unsure how to fix this.

Revision history for this message
Cory Johns (johnsca) :
review: Needs Fixing
Revision history for this message
José Antonio Rey (jose) wrote :

Apparently the download site has moved, causing the install hook to fail. However, tests are good.

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'tests'
2=== added file 'tests/00-setup'
3--- tests/00-setup 1970-01-01 00:00:00 +0000
4+++ tests/00-setup 2014-11-06 16:57:14 +0000
5@@ -0,0 +1,5 @@
6+#!/bin/bash
7+
8+sudo add-apt-repository ppa:juju/stable -y
9+sudo apt-get update
10+sudo apt-get install amulet python3-requests -y
11
12=== added file 'tests/99-autogen'
13--- tests/99-autogen 1970-01-01 00:00:00 +0000
14+++ tests/99-autogen 2014-11-06 16:57:14 +0000
15@@ -0,0 +1,53 @@
16+#!/usr/bin/env python3
17+
18+import amulet
19+import requests
20+import unittest
21+
22+
23+class TestDeployment(unittest.TestCase):
24+ @classmethod
25+ def setUpClass(cls):
26+ cls.deployment = amulet.Deployment(series='precise')
27+
28+ cls.deployment.add('stackmobile')
29+ cls.deployment.add('apache2')
30+ cls.deployment.add('mysql')
31+ cls.deployment.relate('stackmobile:website', 'apache2:reverseproxy')
32+ cls.deployment.relate('stackmobile:db', 'mysql:db')
33+
34+ try:
35+ cls.deployment.setup(timeout=900)
36+ cls.deployment.sentry.wait()
37+ except amulet.helpers.TimeoutError:
38+ amulet.raise_status(amulet.SKIP, msg="Environment wasn't stood up in time")
39+ except:
40+ raise
41+
42+ def test_case(self):
43+ # Now you can use self.deployment.sentry.unit[UNIT] to address each of
44+ # the units and perform more in-depth steps. You can also reference
45+ # the first unit as self.unit.
46+ # There are three test statuses that can be triggered with
47+ # amulet.raise_status():
48+ # - amulet.PASS
49+ # - amulet.FAIL
50+ # - amulet.SKIP
51+ # Each unit has the following methods:
52+ # - .info - An array of the information of that unit from Juju
53+ # - .file(PATH) - Get the details of a file on that unit
54+ # - .file_contents(PATH) - Get plain text output of PATH file from that unit
55+ # - .directory(PATH) - Get details of directory
56+ # - .directory_contents(PATH) - List files and folders in PATH on that unit
57+ # - .relation(relation, service:rel) - Get relation data from return service
58+ # add tests here to confirm service is up and working properly
59+ # For example, to confirm that it has a functioning HTTP server:
60+ # page = requests.get('http://{}'.format(self.unit.info['public-address']))
61+ # page.raise_for_status()
62+ # More information on writing Amulet tests can be found at:
63+ # https://juju.ubuntu.com/docs/tools-amulet.html
64+ pass
65+
66+
67+if __name__ == '__main__':
68+ unittest.main()

Subscribers

People subscribed via source and target branches

to all changes: