Merge lp:~mbruzek/charms/precise/openam/tests into lp:charms/openam

Proposed by Matt Bruzek
Status: Merged
Merged at revision: 2
Proposed branch: lp:~mbruzek/charms/precise/openam/tests
Merge into: lp:charms/openam
Diff against target: 76 lines (+66/-0)
2 files modified
tests/00-setup (+5/-0)
tests/99-autogen (+61/-0)
To merge this branch: bzr merge lp:~mbruzek/charms/precise/openam/tests
Reviewer Review Type Date Requested Status
José Antonio Rey (community) Approve
Review Queue (community) automated testing Needs Fixing
Review via email: mp+241002@code.launchpad.net

Commit message

Adding tests for this charm

To post a comment you must log in.
3. By Matt Bruzek

Added the relation name to opendj in the test

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-10632-results

review: Needs Fixing (automated testing)
Revision history for this message
José Antonio Rey (jose) wrote :

These tests are good, but they are failing because of an error in the charm itself. Pushing.

+1

review: Approve

Preview Diff

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

Subscribers

People subscribed via source and target branches

to all changes: