Merge lp:~bigdata-dev/charms/trusty/apache-flume-syslog/trunk into lp:charms/trusty/apache-flume-syslog

Proposed by Cory Johns
Status: Merged
Merged at revision: 4
Proposed branch: lp:~bigdata-dev/charms/trusty/apache-flume-syslog/trunk
Merge into: lp:charms/trusty/apache-flume-syslog
Diff against target: 173 lines (+31/-81)
7 files modified
README.md (+1/-1)
hooks/callbacks.py (+2/-2)
resources.yaml (+1/-1)
tests/00-setup (+0/-5)
tests/01-basic-deployment.py (+24/-0)
tests/remote/test_dist_config.py (+0/-72)
tests/tests.yaml (+3/-0)
To merge this branch: bzr merge lp:~bigdata-dev/charms/trusty/apache-flume-syslog/trunk
Reviewer Review Type Date Requested Status
Kevin W Monroe Approve
Review via email: mp+273428@code.launchpad.net

Description of the change

Remove trivial test in favor of bundle tests.

To post a comment you must log in.
18. By Cory Johns

Re-added trivial test

19. By Cory Johns

Switch to S3 for flume binaries

20. By Cory Johns

Update mailing list

Revision history for this message
Kevin W Monroe (kwmonroe) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.md'
2--- README.md 2015-08-25 06:00:05 +0000
3+++ README.md 2015-10-06 18:18:59 +0000
4@@ -88,7 +88,7 @@
5
6 ## Contact Information
7
8-- <bigdata-dev@lists.launchpad.net>
9+- <bigdata@lists.ubuntu.com>
10
11
12 ## Help
13
14=== modified file 'hooks/callbacks.py'
15--- hooks/callbacks.py 2015-09-10 04:24:51 +0000
16+++ hooks/callbacks.py 2015-10-06 18:18:59 +0000
17@@ -53,7 +53,7 @@
18 self.verify_resources = utils.verify_resources(*self.resources.values())
19
20 def is_installed(self):
21- return unitdata.kv().get('flume.installed')
22+ return unitdata.kv().get('flume_syslog.installed')
23
24 def install(self, force=False):
25 if not force and self.is_installed():
26@@ -66,7 +66,7 @@
27 self.dist_config.add_packages()
28 self.setup_flume_config()
29 self.configure_flume()
30- unitdata.kv().set('flume.installed', True)
31+ unitdata.kv().set('flume_syslog.installed', True)
32
33 def setup_flume_config(self):
34 '''
35
36=== modified file 'resources.yaml'
37--- resources.yaml 2015-08-25 06:00:05 +0000
38+++ resources.yaml 2015-10-06 18:18:59 +0000
39@@ -7,6 +7,6 @@
40 pypi: jujubigdata>=4.0.0,<5.0.0
41 optional_resources:
42 flume-x86_64:
43- url: https://git.launchpad.net/bigdata-data/plain/apache/x86_64/apache-flume-1.6.0-bin.tar.gz?id=c34a21c939f5fce9ab89b95d65fe2df50e7bbab0
44+ url: https://s3.amazonaws.com/jujubigdata/apache/x86_64/apache-flume-1.6.0-bin-defd21a.tar.gz
45 hash: defd21ad8d2b6f28cc0a16b96f652099
46 hash_type: md5
47
48=== added directory 'tests'
49=== removed directory 'tests'
50=== removed file 'tests/00-setup'
51--- tests/00-setup 2015-06-18 22:40:46 +0000
52+++ tests/00-setup 1970-01-01 00:00:00 +0000
53@@ -1,5 +0,0 @@
54-#!/bin/bash
55-
56-sudo add-apt-repository ppa:juju/stable -y
57-sudo apt-get update
58-sudo apt-get install python3 amulet -y
59
60=== added file 'tests/01-basic-deployment.py'
61--- tests/01-basic-deployment.py 1970-01-01 00:00:00 +0000
62+++ tests/01-basic-deployment.py 2015-10-06 18:18:59 +0000
63@@ -0,0 +1,24 @@
64+#!/usr/bin/env python3
65+
66+import unittest
67+import amulet
68+
69+
70+class TestDeploy(unittest.TestCase):
71+ """
72+ Trivial deployment test for Apache Flume / Syslog.
73+
74+ This charm cannot do anything useful by itself, so integration testing
75+ is done in the bundle.
76+ """
77+
78+ def test_deploy(self):
79+ self.d = amulet.Deployment(series='trusty')
80+ self.d.add('flume-syslog', 'apache-flume-syslog')
81+ self.d.setup(timeout=900)
82+ self.d.sentry.wait(timeout=1800)
83+ self.unit = self.d.sentry['flume-syslog'][0]
84+
85+
86+if __name__ == '__main__':
87+ unittest.main()
88
89=== removed directory 'tests/remote'
90=== removed file 'tests/remote/test_dist_config.py'
91--- tests/remote/test_dist_config.py 2015-08-25 06:00:05 +0000
92+++ tests/remote/test_dist_config.py 1970-01-01 00:00:00 +0000
93@@ -1,72 +0,0 @@
94-#!/usr/bin/env python
95-
96-import grp
97-import os
98-import pwd
99-import unittest
100-
101-from charmhelpers.contrib import bigdata
102-
103-
104-class TestDistConfig(unittest.TestCase):
105- """
106- Test that the ``dist.yaml`` settings were applied properly, such as users, groups, and dirs.
107-
108- This is done as a remote test on the deployed unit rather than a regular
109- test under ``tests/`` because filling in the ``dist.yaml`` requires Juju
110- context (e.g., config).
111- """
112- @classmethod
113- def setUpClass(cls):
114- config = None
115- config_dir = os.environ['JUJU_CHARM_DIR']
116- config_file = 'dist.yaml'
117- if os.path.isfile(os.path.join(config_dir, config_file)):
118- config = os.path.join(config_dir, config_file)
119- if not config:
120- raise IOError('Could not find {} in {}'.format(config_file, config_dir))
121- reqs = ['vendor', 'hadoop_version', 'packages', 'groups', 'users',
122- 'dirs']
123- cls.dist_config = bigdata.utils.DistConfig(config, reqs)
124-
125- def test_groups(self):
126- for name in self.dist_config.groups:
127- try:
128- grp.getgrnam(name)
129- except KeyError:
130- self.fail('Group {} is missing'.format(name))
131-
132- def test_users(self):
133- for username, details in self.dist_config.users.items():
134- try:
135- user = pwd.getpwnam(username)
136- except KeyError:
137- self.fail('User {} is missing'.format(username))
138- for groupname in details['groups']:
139- try:
140- group = grp.getgrnam(groupname)
141- except KeyError:
142- self.fail('Group {} referenced by user {} does not exist'.format(
143- groupname, username))
144- if group.gr_gid != user.pw_gid:
145- self.assertIn(username, group.gr_mem, 'User {} not in group {}'.format(
146- username, groupname))
147-
148- def test_dirs(self):
149- for name, details in self.dist_config.dirs.items():
150- dirpath = self.dist_config.path(name)
151- self.assertTrue(dirpath.isdir(), 'Dir {} is missing'.format(name))
152- stat = dirpath.stat()
153- owner = pwd.getpwuid(stat.st_uid).pw_name
154- group = grp.getgrgid(stat.st_gid).gr_name
155- perms = stat.st_mode & ~0o40000
156- self.assertEqual(owner, details.get('owner', 'root'),
157- 'Dir {} ({}) has wrong owner: {}'.format(name, dirpath, owner))
158- self.assertEqual(group, details.get('group', 'root'),
159- 'Dir {} ({}) has wrong group: {}'.format(name, dirpath, group))
160- self.assertEqual(perms, details.get('perms', 0o755),
161- 'Dir {} ({}) has wrong perms: 0o{:o}'.format(name, dirpath, perms))
162-
163-
164-if __name__ == '__main__':
165- unittest.main()
166
167=== added file 'tests/tests.yaml'
168--- tests/tests.yaml 1970-01-01 00:00:00 +0000
169+++ tests/tests.yaml 2015-10-06 18:18:59 +0000
170@@ -0,0 +1,3 @@
171+reset: false
172+packages:
173+ - amulet

Subscribers

People subscribed via source and target branches