diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-11-09 15:35:48 -0800 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-11-09 15:35:48 -0800 |
commit | 2c79c14b510751ab455888ab46f70c27b219bd19 (patch) | |
tree | d546d530bdbcf2470f7a91ac686a5fc7923bb34b /tests/unittests/test_distros/test_user_data_normalize.py | |
parent | 0bd973791f05f1d7f94e91b354015789b6b608dc (diff) | |
parent | 1169dcc5f18fd9a5adbf353bec87e48d563550a5 (diff) | |
download | vyos-cloud-init-2c79c14b510751ab455888ab46f70c27b219bd19.tar.gz vyos-cloud-init-2c79c14b510751ab455888ab46f70c27b219bd19.zip |
Fix the merging of group configuration.
Diffstat (limited to 'tests/unittests/test_distros/test_user_data_normalize.py')
-rw-r--r-- | tests/unittests/test_distros/test_user_data_normalize.py | 22 |
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 = { |