Merge lp:~bigdata-dev/charms/trusty/apache-hadoop-yarn-master/trunk into lp:charms/trusty/apache-hadoop-yarn-master

Proposed by Cory Johns on 2015-10-05
Status: Merged
Merged at revision: 91
Proposed branch: lp:~bigdata-dev/charms/trusty/apache-hadoop-yarn-master/trunk
Merge into: lp:charms/trusty/apache-hadoop-yarn-master
Diff against target: 204 lines (+6/-123)
6 files modified
README.md (+1/-1)
resources.yaml (+2/-2)
tests/00-setup (+0/-8)
tests/01-basic-deployment.py (+0/-40)
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-hadoop-yarn-master/trunk
Reviewer Review Type Date Requested Status
Kevin W Monroe 2015-10-05 Approve on 2015-10-07
Review via email: mp+273439@code.launchpad.net

Description of the change

Remove trivial test in favor of bundle tests.

To post a comment you must log in.
107. By Cory Johns on 2015-10-06

Re-add trivial deploy test

108. By Cory Johns on 2015-10-06

Switch to S3 for hadoop-base binaries

109. By Cory Johns on 2015-10-06

Fixed arg order in test

110. By Cory Johns on 2015-10-06

Update mailing list

Kevin W Monroe (kwmonroe) wrote :

LGTM, +1

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-09-15 18:43:19 +0000
3+++ README.md 2015-10-06 18:05:37 +0000
4@@ -84,7 +84,7 @@
5
6 ## Contact Information
7
8-- <bigdata-dev@lists.launchpad.net>
9+- <bigdata@lists.ubuntu.com>
10
11
12 ## Hadoop
13
14=== modified file 'resources.yaml'
15--- resources.yaml 2015-09-15 18:43:19 +0000
16+++ resources.yaml 2015-10-06 18:05:37 +0000
17@@ -19,10 +19,10 @@
18 hash: 03ad135835bfe413f85fe176259237a8
19 hash_type: md5
20 hadoop-ppc64le:
21- url: https://git.launchpad.net/bigdata-data/plain/apache/ppc64le/hadoop-2.4.1-ppc64le.tar.gz?id=c34a21c939f5fce9ab89b95d65fe2df50e7bbab0
22+ url: https://s3.amazonaws.com/jujubigdata/apache/ppc64le/hadoop-2.4.1-ppc64le-09942b1.tar.gz
23 hash: 09942b168a3db0d183b281477d3dae9deb7b7bc4b5783ba5cda3965b62e71bd5
24 hash_type: sha256
25 hadoop-x86_64:
26- url: https://git.launchpad.net/bigdata-data/plain/apache/x86_64/hadoop-2.4.1.tar.gz?id=c34a21c939f5fce9ab89b95d65fe2df50e7bbab0
27+ url: https://s3.amazonaws.com/jujubigdata/apache/x86_64/hadoop-2.4.1-a790d39.tar.gz
28 hash: a790d39baba3a597bd226042496764e0520c2336eedb28a1a3d5c48572d3b672
29 hash_type: sha256
30
31=== added directory 'tests'
32=== removed directory 'tests'
33=== removed file 'tests/00-setup'
34--- tests/00-setup 2015-02-17 03:25:19 +0000
35+++ tests/00-setup 1970-01-01 00:00:00 +0000
36@@ -1,8 +0,0 @@
37-#!/bin/bash
38-
39-if ! dpkg -s amulet &> /dev/null; then
40- echo Installing Amulet...
41- sudo add-apt-repository -y ppa:juju/stable
42- sudo apt-get update
43- sudo apt-get -y install amulet
44-fi
45
46=== added file 'tests/01-basic-deployment.py'
47--- tests/01-basic-deployment.py 1970-01-01 00:00:00 +0000
48+++ tests/01-basic-deployment.py 2015-10-06 18:05:37 +0000
49@@ -0,0 +1,24 @@
50+#!/usr/bin/env python3
51+
52+import unittest
53+import amulet
54+
55+
56+class TestDeploy(unittest.TestCase):
57+ """
58+ Trivial deployment test for Apache Hadoop YARN Master.
59+
60+ This charm cannot do anything useful by itself, so integration testing
61+ is done in the bundle.
62+ """
63+
64+ def test_deploy(self):
65+ self.d = amulet.Deployment(series='trusty')
66+ self.d.add('yarn-master', 'apache-hadoop-yarn-master')
67+ self.d.setup(timeout=900)
68+ self.d.sentry.wait(timeout=1800)
69+ self.unit = self.d.sentry['yarn-master'][0]
70+
71+
72+if __name__ == '__main__':
73+ unittest.main()
74
75=== removed file 'tests/01-basic-deployment.py'
76--- tests/01-basic-deployment.py 2015-09-15 17:26:28 +0000
77+++ tests/01-basic-deployment.py 1970-01-01 00:00:00 +0000
78@@ -1,40 +0,0 @@
79-#!/usr/bin/env python3
80-
81-import unittest
82-import amulet
83-
84-
85-class TestDeploy(unittest.TestCase):
86- """
87- Basic deployment test for Apache Hadoop YARN Master.
88-
89- This charm cannot do anything useful by itself, so integration testing
90- is done in the bundle.
91- """
92-
93- @classmethod
94- def setUpClass(cls):
95- cls.d = amulet.Deployment(series='trusty')
96- cls.d.add('apache-hadoop-yarn-master')
97- cls.d.setup(timeout=900)
98- cls.d.sentry.wait(timeout=1800)
99- cls.unit = cls.d.sentry.unit['apache-hadoop-yarn-master/0']
100-
101- def test_deploy(self):
102- output, retcode = self.unit.run("pgrep -a java")
103- assert 'ResourceManager' not in output, "ResourceManager should not be started"
104- assert 'JobHistoryServer' not in output, "JobHistoryServer should not be started"
105- assert 'NodeManager' not in output, "NodeManager should not be started"
106- assert 'NameNode' not in output, "NameNode should not be started"
107- assert 'SecondaryNameNode' not in output, "SecondaryNameNode should not be started"
108- assert 'DataNode' not in output, "DataServer should not be started"
109-
110- def test_dist_config(self):
111- # test_dist_config.py is run on the deployed unit because it
112- # requires the Juju context to properly validate dist.yaml
113- output, retcode = self.unit.run("tests/remote/test_dist_config.py")
114- self.assertEqual(retcode, 0, 'Remote dist config test failed:\n{}'.format(output))
115-
116-
117-if __name__ == '__main__':
118- unittest.main()
119
120=== removed directory 'tests/remote'
121=== removed file 'tests/remote/test_dist_config.py'
122--- tests/remote/test_dist_config.py 2015-08-21 21:51:39 +0000
123+++ tests/remote/test_dist_config.py 1970-01-01 00:00:00 +0000
124@@ -1,72 +0,0 @@
125-#!/usr/bin/env python
126-
127-import grp
128-import os
129-import pwd
130-import unittest
131-
132-from charmhelpers.contrib import bigdata
133-
134-
135-class TestDistConfig(unittest.TestCase):
136- """
137- Test that the ``dist.yaml`` settings were applied properly, such as users, groups, and dirs.
138-
139- This is done as a remote test on the deployed unit rather than a regular
140- test under ``tests/`` because filling in the ``dist.yaml`` requires Juju
141- context (e.g., config).
142- """
143- @classmethod
144- def setUpClass(cls):
145- config = None
146- config_dir = os.environ['JUJU_CHARM_DIR']
147- config_file = 'dist.yaml'
148- if os.path.isfile(os.path.join(config_dir, config_file)):
149- config = os.path.join(config_dir, config_file)
150- if not config:
151- raise IOError('Could not find {} in {}'.format(config_file, config_dir))
152- reqs = ['vendor', 'hadoop_version', 'packages', 'groups', 'users',
153- 'dirs', 'ports']
154- cls.dist_config = bigdata.utils.DistConfig(config, reqs)
155-
156- def test_groups(self):
157- for name in self.dist_config.groups:
158- try:
159- grp.getgrnam(name)
160- except KeyError:
161- self.fail('Group {} is missing'.format(name))
162-
163- def test_users(self):
164- for username, details in self.dist_config.users.items():
165- try:
166- user = pwd.getpwnam(username)
167- except KeyError:
168- self.fail('User {} is missing'.format(username))
169- for groupname in details['groups']:
170- try:
171- group = grp.getgrnam(groupname)
172- except KeyError:
173- self.fail('Group {} referenced by user {} does not exist'.format(
174- groupname, username))
175- if group.gr_gid != user.pw_gid:
176- self.assertIn(username, group.gr_mem, 'User {} not in group {}'.format(
177- username, groupname))
178-
179- def test_dirs(self):
180- for name, details in self.dist_config.dirs.items():
181- dirpath = self.dist_config.path(name)
182- self.assertTrue(dirpath.isdir(), 'Dir {} is missing'.format(name))
183- stat = dirpath.stat()
184- owner = pwd.getpwuid(stat.st_uid).pw_name
185- group = grp.getgrgid(stat.st_gid).gr_name
186- perms = stat.st_mode & ~0o40000
187- self.assertEqual(owner, details.get('owner', 'root'),
188- 'Dir {} ({}) has wrong owner: {}'.format(name, dirpath, owner))
189- self.assertEqual(group, details.get('group', 'root'),
190- 'Dir {} ({}) has wrong group: {}'.format(name, dirpath, group))
191- self.assertEqual(perms, details.get('perms', 0o755),
192- 'Dir {} ({}) has wrong perms: 0o{:o}'.format(name, dirpath, perms))
193-
194-
195-if __name__ == '__main__':
196- unittest.main()
197
198=== added file 'tests/tests.yaml'
199--- tests/tests.yaml 1970-01-01 00:00:00 +0000
200+++ tests/tests.yaml 2015-10-06 18:05:37 +0000
201@@ -0,0 +1,3 @@
202+reset: false
203+packages:
204+ - amulet

Subscribers

People subscribed via source and target branches