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

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

Description of the change

Remove trivial test in favor of bundle tests.

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

Re-added trivial test

107. By Cory Johns

Update mailing list

108. By Cory Johns

Switch to S3 for hadoop binaries

Revision history for this message
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:24:59 +0000
3+++ README.md 2015-10-06 18:24:58 +0000
4@@ -113,7 +113,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:24:59 +0000
16+++ resources.yaml 2015-10-06 18:24:58 +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:22:01 +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:24:58 +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 HDFS 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('hdfs-master', 'apache-hadoop-hdfs-master')
67+ self.d.setup(timeout=900)
68+ self.d.sentry.wait(timeout=1800)
69+ self.unit = self.d.sentry['hdfs-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 16:17:59 +0000
77+++ tests/01-basic-deployment.py 1970-01-01 00:00:00 +0000
78@@ -1,41 +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 HDFS Master.
88-
89- This charm cannot do anything useful by itself, so integration testing
90- is done in the bundle. However, we can at least confirm that the NameNode
91- starts successfully.
92- """
93-
94- @classmethod
95- def setUpClass(cls):
96- cls.d = amulet.Deployment(series='trusty')
97- cls.d.add('apache-hadoop-hdfs-master')
98- cls.d.setup(timeout=900)
99- cls.d.sentry.wait(timeout=1800)
100- cls.unit = cls.d.sentry.unit['apache-hadoop-hdfs-master/0']
101-
102- def test_deploy(self):
103- output, retcode = self.unit.run("pgrep -a java")
104- assert 'NameNode' in output, "NameNode is not started"
105- assert 'ResourceManager' not in output, "ResourceManager should not be started"
106- assert 'JobHistoryServer' not in output, "JobHistoryServer should not be started"
107- assert 'NodeManager' not in output, "NodeManager should not be started"
108- assert 'SecondaryNameNode' not in output, "SecondaryNameNode should not be started"
109- assert 'DataNode' not in output, "DataServer should not be started"
110-
111- def test_dist_config(self):
112- # test_dist_config.py is run on the deployed unit because it
113- # requires the Juju context to properly validate dist.yaml
114- output, retcode = self.unit.run("tests/remote/test_dist_config.py")
115- self.assertEqual(retcode, 0, 'Remote dist config test failed:\n{}'.format(output))
116-
117-
118-if __name__ == '__main__':
119- unittest.main()
120
121=== removed directory 'tests/remote'
122=== removed file 'tests/remote/test_dist_config.py'
123--- tests/remote/test_dist_config.py 2015-08-21 21:51:23 +0000
124+++ tests/remote/test_dist_config.py 1970-01-01 00:00:00 +0000
125@@ -1,72 +0,0 @@
126-#!/usr/bin/env python
127-
128-import grp
129-import os
130-import pwd
131-import unittest
132-
133-from charmhelpers.contrib import bigdata
134-
135-
136-class TestDistConfig(unittest.TestCase):
137- """
138- Test that the ``dist.yaml`` settings were applied properly, such as users, groups, and dirs.
139-
140- This is done as a remote test on the deployed unit rather than a regular
141- test under ``tests/`` because filling in the ``dist.yaml`` requires Juju
142- context (e.g., config).
143- """
144- @classmethod
145- def setUpClass(cls):
146- config = None
147- config_dir = os.environ['JUJU_CHARM_DIR']
148- config_file = 'dist.yaml'
149- if os.path.isfile(os.path.join(config_dir, config_file)):
150- config = os.path.join(config_dir, config_file)
151- if not config:
152- raise IOError('Could not find {} in {}'.format(config_file, config_dir))
153- reqs = ['vendor', 'hadoop_version', 'packages', 'groups', 'users',
154- 'dirs', 'ports']
155- cls.dist_config = bigdata.utils.DistConfig(config, reqs)
156-
157- def test_groups(self):
158- for name in self.dist_config.groups:
159- try:
160- grp.getgrnam(name)
161- except KeyError:
162- self.fail('Group {} is missing'.format(name))
163-
164- def test_users(self):
165- for username, details in self.dist_config.users.items():
166- try:
167- user = pwd.getpwnam(username)
168- except KeyError:
169- self.fail('User {} is missing'.format(username))
170- for groupname in details['groups']:
171- try:
172- group = grp.getgrnam(groupname)
173- except KeyError:
174- self.fail('Group {} referenced by user {} does not exist'.format(
175- groupname, username))
176- if group.gr_gid != user.pw_gid:
177- self.assertIn(username, group.gr_mem, 'User {} not in group {}'.format(
178- username, groupname))
179-
180- def test_dirs(self):
181- for name, details in self.dist_config.dirs.items():
182- dirpath = self.dist_config.path(name)
183- self.assertTrue(dirpath.isdir(), 'Dir {} is missing'.format(name))
184- stat = dirpath.stat()
185- owner = pwd.getpwuid(stat.st_uid).pw_name
186- group = grp.getgrgid(stat.st_gid).gr_name
187- perms = stat.st_mode & ~0o40000
188- self.assertEqual(owner, details.get('owner', 'root'),
189- 'Dir {} ({}) has wrong owner: {}'.format(name, dirpath, owner))
190- self.assertEqual(group, details.get('group', 'root'),
191- 'Dir {} ({}) has wrong group: {}'.format(name, dirpath, group))
192- self.assertEqual(perms, details.get('perms', 0o755),
193- 'Dir {} ({}) has wrong perms: 0o{:o}'.format(name, dirpath, perms))
194-
195-
196-if __name__ == '__main__':
197- unittest.main()
198
199=== added file 'tests/tests.yaml'
200--- tests/tests.yaml 1970-01-01 00:00:00 +0000
201+++ tests/tests.yaml 2015-10-06 18:24:58 +0000
202@@ -0,0 +1,3 @@
203+reset: false
204+packages:
205+ - amulet

Subscribers

People subscribed via source and target branches