summaryrefslogtreecommitdiff
path: root/tests/unittests/test_distros/test_user_data_normalize.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittests/test_distros/test_user_data_normalize.py')
-rw-r--r--tests/unittests/test_distros/test_user_data_normalize.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/unittests/test_distros/test_user_data_normalize.py b/tests/unittests/test_distros/test_user_data_normalize.py
index 8f0d8896..5d9d4311 100644
--- a/tests/unittests/test_distros/test_user_data_normalize.py
+++ b/tests/unittests/test_distros/test_user_data_normalize.py
@@ -30,6 +30,28 @@ class TestUGNormalize(MockerTestCase):
def _norm(self, cfg, distro):
return distros.normalize_users_groups(cfg, distro)
+ def test_group_dict(self):
+ distro = self._make_distro('ubuntu')
+ g = {'groups': [
+ {
+ 'ubuntu': ['foo', 'bar'],
+ 'bob': 'users',
+ },
+ 'cloud-users',
+ {
+ 'bob': 'users2',
+ },
+ ]
+ }
+ (_users, groups) = self._norm(g, distro)
+ self.assertIn('ubuntu', groups)
+ ub_members = groups['ubuntu']
+ self.assertEquals(sorted(['foo', 'bar']), sorted(ub_members))
+ self.assertIn('bob', groups)
+ b_members = groups['bob']
+ self.assertEquals(sorted(['users', 'users2']),
+ sorted(b_members))
+
def test_basic_groups(self):
distro = self._make_distro('ubuntu')
ug_cfg = {