bigdata-dev team mailing list archive
-
bigdata-dev team
-
Mailing list archive
-
Message #00350
[Merge] lp:~bigdata-dev/charms/trusty/apache-flume-twitter/trunk into lp:charms/trusty/apache-flume-twitter
Cory Johns has proposed merging lp:~bigdata-dev/charms/trusty/apache-flume-twitter/trunk into lp:charms/trusty/apache-flume-twitter.
Requested reviews:
charmers (charmers)
For more details, see:
https://code.launchpad.net/~bigdata-dev/charms/trusty/apache-flume-twitter/trunk/+merge/273432
Remove trivial test in favor of bundle tests.
--
Your team Juju Big Data Development is subscribed to branch lp:~bigdata-dev/charms/trusty/apache-flume-twitter/trunk.
=== modified file 'hooks/callbacks.py'
--- hooks/callbacks.py 2015-08-05 17:42:41 +0000
+++ hooks/callbacks.py 2015-10-05 15:44:24 +0000
@@ -62,7 +62,7 @@
self.verify_resources = utils.verify_resources(*self.resources.values())
def is_installed(self):
- return unitdata.kv().get('flume.installed')
+ return unitdata.kv().get('flume_twitter.installed')
def install(self, force=False):
if not force and self.is_installed():
@@ -75,7 +75,7 @@
self.dist_config.add_packages()
self.setup_flume_config()
self.configure_flume()
- unitdata.kv().set('flume.installed', True)
+ unitdata.kv().set('flume_twitter.installed', True)
def setup_flume_config(self):
'''
=== added file 'resources/python/jujuresources-0.2.11.tar.gz'
Binary 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-05 15:44:24 +0000 differ
=== removed file 'resources/python/jujuresources-0.2.9.tar.gz'
Binary 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
=== removed directory 'tests'
=== removed file 'tests/00-setup'
--- tests/00-setup 2015-06-10 21:41:12 +0000
+++ tests/00-setup 1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-sudo add-apt-repository ppa:juju/stable -y
-sudo apt-get update
-sudo apt-get install python3 amulet -y
=== removed directory 'tests/remote'
=== removed file 'tests/remote/test_dist_config.py'
--- tests/remote/test_dist_config.py 2015-08-21 21:51:04 +0000
+++ tests/remote/test_dist_config.py 1970-01-01 00:00:00 +0000
@@ -1,62 +0,0 @@
-#!/usr/bin/env python
-
-import grp
-import pwd
-import unittest
-
-from charmhelpers.contrib import bigdata
-
-
-class TestDistConfig(unittest.TestCase):
- """
- Test that the ``dist.yaml`` settings were applied properly, such as users, groups, and dirs.
-
- This is done as a remote test on the deployed unit rather than a regular
- test under ``tests/`` because filling in the ``dist.yaml`` requires Juju
- context (e.g., config).
- """
- @classmethod
- def setUpClass(cls):
- cls.hadoop = bigdata.handlers.apache.HadoopBase()
-
- def test_groups(self):
- for name in self.hadoop.groups:
- try:
- grp.getgrnam(name)
- except KeyError:
- self.fail('Group {} is missing'.format(name))
-
- def test_users(self):
- for username, details in self.hadoop.users.items():
- try:
- user = pwd.getpwnam(username)
- except KeyError:
- self.fail('User {} is missing'.format(username))
- for groupname in details['groups']:
- try:
- group = grp.getgrnam(groupname)
- except KeyError:
- self.fail('Group {} referenced by user {} does not exist'.format(
- groupname, username))
- if group.gr_gid != user.pw_gid:
- self.assertIn(username, group.gr_mem, 'User {} not in group {}'.format(
- username, groupname))
-
- def test_dirs(self):
- for name, details in self.hadoop.managed_dirs.items():
- dirpath = details['path']
- self.assertTrue(dirpath.isdir(), 'Dir {} is missing'.format(name))
- stat = dirpath.stat()
- owner = pwd.getpwuid(stat.st_uid).pw_name
- group = grp.getgrgid(stat.st_gid).gr_name
- perms = stat.st_mode & ~0o40000
- self.assertEqual(owner, details.get('owner', 'root'),
- 'Dir {} ({}) has wrong owner: {}'.format(name, dirpath, owner))
- self.assertEqual(group, details.get('group', 'root'),
- 'Dir {} ({}) has wrong group: {}'.format(name, dirpath, group))
- self.assertEqual(perms, details.get('perms', 0o744),
- 'Dir {} ({}) has wrong perms: 0o{:o}'.format(name, dirpath, perms))
-
-
-if __name__ == '__main__':
- unittest.main()
Follow ups