Merge lp:~ibm-demo/charms/trusty/ntpmaster/trunk into lp:charms/trusty/ntpmaster

Proposed by Matt Bruzek
Status: Merged
Merged at revision: 12
Proposed branch: lp:~ibm-demo/charms/trusty/ntpmaster/trunk
Merge into: lp:charms/trusty/ntpmaster
Diff against target: 88 lines (+71/-0)
3 files modified
tests/00-setup (+16/-0)
tests/10-bundles-test.py (+33/-0)
tests/bundles.yaml (+22/-0)
To merge this branch: bzr merge lp:~ibm-demo/charms/trusty/ntpmaster/trunk
Reviewer Review Type Date Requested Status
Review Queue (community) automated testing Needs Fixing
charmers Pending
Review via email: mp+240074@code.launchpad.net

Description of the change

Adding tests to the ntpmaster charm for automation and to meet the trusty requirements.

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

review: Needs Fixing (automated testing)
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-1433-results

review: Needs Fixing (automated testing)
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-10373-results

review: Needs Fixing (automated testing)
Revision history for this message
Matt Bruzek (mbruzek) wrote :

The failed automated tests appear to be timeout related. The tests run on other cloud environments just fine. The change was already merged by someone else. Thanks!

Revision history for this message
Adam Israel (aisrael) wrote :

Commenting to (hopefully) drop this out of the review queue

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-10-30 01:57:20 +0000
5@@ -0,0 +1,16 @@
6+#!/bin/bash
7+
8+# This script sets up the requirements for amulet tests.
9+
10+set -x
11+
12+# Check if amulet is installed before adding the stable repository and updating apt-get.
13+dpkg -s amulet
14+if [ $? -ne 0 ]; then
15+ sudo add-apt-repository -y ppa:juju/stable
16+ sudo apt-get update -qq
17+ sudo apt-get install -y amulet
18+fi
19+
20+# Install any additional python packages or other required software.
21+sudo apt-get install -y python3-requests
22\ No newline at end of file
23
24=== added file 'tests/10-bundles-test.py'
25--- tests/10-bundles-test.py 1970-01-01 00:00:00 +0000
26+++ tests/10-bundles-test.py 2014-10-30 01:57:20 +0000
27@@ -0,0 +1,33 @@
28+#!/usr/bin/env python3
29+
30+# This amulet test deploys the bundles.yaml file in this directory.
31+
32+import os
33+import unittest
34+import yaml
35+import amulet
36+
37+seconds_to_wait = 720
38+
39+
40+class BundleTest(unittest.TestCase):
41+ """ Create a class for testing the charm in the unit test framework. """
42+ @classmethod
43+ def setUpClass(cls):
44+ """ Set up an amulet deployment using the bundle. """
45+ d = amulet.Deployment()
46+ bundle_path = os.path.join(os.path.dirname(__file__), 'bundles.yaml')
47+ with open(bundle_path, 'r') as bundle_file:
48+ contents = yaml.safe_load(bundle_file)
49+ d.load(contents)
50+ d.setup(seconds_to_wait)
51+ d.sentry.wait(seconds_to_wait)
52+ cls.d = d
53+
54+ def test_deployed(self):
55+ """ Test to see if the bundle deployed successfully. """
56+ self.assertTrue(self.d.deployed)
57+
58+
59+if __name__ == '__main__':
60+ unittest.main()
61\ No newline at end of file
62
63=== added file 'tests/bundles.yaml'
64--- tests/bundles.yaml 1970-01-01 00:00:00 +0000
65+++ tests/bundles.yaml 2014-10-30 01:57:20 +0000
66@@ -0,0 +1,22 @@
67+ntpmaster-ubuntu-ntp:
68+ services:
69+ ntpmaster:
70+ charm: ntpmaster
71+ num_units: 1
72+ options:
73+ source: 0.north-america.pool.ntp.org
74+ ubuntu:
75+ charm: cs:trusty/ubuntu
76+ num_units: 1
77+ expose: true
78+ ntp:
79+ charm: cs:trusty/ntp
80+ num_units: 0
81+ options:
82+ source: ntp.ubuntu.com
83+ relations:
84+ - - "ubuntu:juju-info"
85+ - "ntp:juju-info"
86+ - - "ntp:master"
87+ - "ntpmaster:master"
88+ series: trusty

Subscribers

People subscribed via source and target branches

to all changes: