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

Proposed by Cory Johns
Status: Merged
Merged at revision: 3
Proposed branch: lp:~bigdata-dev/charms/trusty/apache-flume-twitter/trunk
Merge into: lp:charms/trusty/apache-flume-twitter
Diff against target: 167 lines (+31/-71) (has conflicts)
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/-62)
tests/tests.yaml (+3/-0)
Conflict adding files to tests.  Moved to root.
Path conflict: tests / <deleted>
To merge this branch: bzr merge lp:~bigdata-dev/charms/trusty/apache-flume-twitter/trunk
Reviewer Review Type Date Requested Status
Kevin W Monroe Approve
Review via email: mp+273432@code.launchpad.net

Description of the change

Remove trivial test in favor of bundle tests.

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

Re-added trivial test

20. By Cory Johns

Switch to S3 for flume binaries

21. 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:05:56 +0000
3+++ README.md 2015-10-06 18:13:03 +0000
4@@ -86,7 +86,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-08-05 17:42:41 +0000
16+++ hooks/callbacks.py 2015-10-06 18:13:03 +0000
17@@ -62,7 +62,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_twitter.installed')
23
24 def install(self, force=False):
25 if not force and self.is_installed():
26@@ -75,7 +75,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_twitter.installed', True)
32
33 def setup_flume_config(self):
34 '''
35
36=== modified file 'resources.yaml'
37--- resources.yaml 2015-08-25 06:05:56 +0000
38+++ resources.yaml 2015-10-06 18:13:03 +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 file 'resources/python/jujuresources-0.2.11.tar.gz'
49Binary files resources/python/jujuresources-0.2.11.tar.gz 1970-01-01 00:00:00 +0000 and resources/python/jujuresources-0.2.11.tar.gz 2015-10-06 18:13:03 +0000 differ
50=== removed file 'resources/python/jujuresources-0.2.9.tar.gz'
51Binary files resources/python/jujuresources-0.2.9.tar.gz 2015-07-24 04:16:05 +0000 and resources/python/jujuresources-0.2.9.tar.gz 1970-01-01 00:00:00 +0000 differ
52=== added directory 'tests'
53=== removed directory 'tests'
54=== removed file 'tests/00-setup'
55--- tests/00-setup 2015-06-10 21:41:12 +0000
56+++ tests/00-setup 1970-01-01 00:00:00 +0000
57@@ -1,5 +0,0 @@
58-#!/bin/bash
59-
60-sudo add-apt-repository ppa:juju/stable -y
61-sudo apt-get update
62-sudo apt-get install python3 amulet -y
63
64=== added file 'tests/01-basic-deployment.py'
65--- tests/01-basic-deployment.py 1970-01-01 00:00:00 +0000
66+++ tests/01-basic-deployment.py 2015-10-06 18:13:03 +0000
67@@ -0,0 +1,24 @@
68+#!/usr/bin/env python3
69+
70+import unittest
71+import amulet
72+
73+
74+class TestDeploy(unittest.TestCase):
75+ """
76+ Trivial deployment test for Apache Flume / Twitter.
77+
78+ This charm cannot do anything useful by itself, so integration testing
79+ is done in the bundle.
80+ """
81+
82+ def test_deploy(self):
83+ self.d = amulet.Deployment(series='trusty')
84+ self.d.add('flume-twitter', 'apache-flume-twitter')
85+ self.d.setup(timeout=900)
86+ self.d.sentry.wait(timeout=1800)
87+ self.unit = self.d.sentry['flume-twitter'][0]
88+
89+
90+if __name__ == '__main__':
91+ unittest.main()
92
93=== removed directory 'tests/remote'
94=== removed file 'tests/remote/test_dist_config.py'
95--- tests/remote/test_dist_config.py 2015-08-21 21:51:04 +0000
96+++ tests/remote/test_dist_config.py 1970-01-01 00:00:00 +0000
97@@ -1,62 +0,0 @@
98-#!/usr/bin/env python
99-
100-import grp
101-import pwd
102-import unittest
103-
104-from charmhelpers.contrib import bigdata
105-
106-
107-class TestDistConfig(unittest.TestCase):
108- """
109- Test that the ``dist.yaml`` settings were applied properly, such as users, groups, and dirs.
110-
111- This is done as a remote test on the deployed unit rather than a regular
112- test under ``tests/`` because filling in the ``dist.yaml`` requires Juju
113- context (e.g., config).
114- """
115- @classmethod
116- def setUpClass(cls):
117- cls.hadoop = bigdata.handlers.apache.HadoopBase()
118-
119- def test_groups(self):
120- for name in self.hadoop.groups:
121- try:
122- grp.getgrnam(name)
123- except KeyError:
124- self.fail('Group {} is missing'.format(name))
125-
126- def test_users(self):
127- for username, details in self.hadoop.users.items():
128- try:
129- user = pwd.getpwnam(username)
130- except KeyError:
131- self.fail('User {} is missing'.format(username))
132- for groupname in details['groups']:
133- try:
134- group = grp.getgrnam(groupname)
135- except KeyError:
136- self.fail('Group {} referenced by user {} does not exist'.format(
137- groupname, username))
138- if group.gr_gid != user.pw_gid:
139- self.assertIn(username, group.gr_mem, 'User {} not in group {}'.format(
140- username, groupname))
141-
142- def test_dirs(self):
143- for name, details in self.hadoop.managed_dirs.items():
144- dirpath = details['path']
145- self.assertTrue(dirpath.isdir(), 'Dir {} is missing'.format(name))
146- stat = dirpath.stat()
147- owner = pwd.getpwuid(stat.st_uid).pw_name
148- group = grp.getgrgid(stat.st_gid).gr_name
149- perms = stat.st_mode & ~0o40000
150- self.assertEqual(owner, details.get('owner', 'root'),
151- 'Dir {} ({}) has wrong owner: {}'.format(name, dirpath, owner))
152- self.assertEqual(group, details.get('group', 'root'),
153- 'Dir {} ({}) has wrong group: {}'.format(name, dirpath, group))
154- self.assertEqual(perms, details.get('perms', 0o744),
155- 'Dir {} ({}) has wrong perms: 0o{:o}'.format(name, dirpath, perms))
156-
157-
158-if __name__ == '__main__':
159- unittest.main()
160
161=== added file 'tests/tests.yaml'
162--- tests/tests.yaml 1970-01-01 00:00:00 +0000
163+++ tests/tests.yaml 2015-10-06 18:13:03 +0000
164@@ -0,0 +1,3 @@
165+reset: false
166+packages:
167+ - amulet

Subscribers

People subscribed via source and target branches