diff options
author | harlowja <harlowja@virtualbox.rhel> | 2013-01-24 23:24:46 -0800 |
---|---|---|
committer | harlowja <harlowja@virtualbox.rhel> | 2013-01-24 23:24:46 -0800 |
commit | 352316f96f3c0ce89dbfbac3c18f0f8b8aadec3e (patch) | |
tree | 757c4850283135b3e2e5da3dd3011cea660951cf /tests | |
parent | 6fb6fe24d5ba185d42f2d7a82c3c54d26fea3392 (diff) | |
parent | 06ca24c39289f2d1f0f3f810abf155043a36d2f2 (diff) | |
download | vyos-cloud-init-352316f96f3c0ce89dbfbac3c18f0f8b8aadec3e.tar.gz vyos-cloud-init-352316f96f3c0ce89dbfbac3c18f0f8b8aadec3e.zip |
Merge the old user style with the distro provided config.
When the old user: style entry is found, don't forget that
we need to use the distro settings that are provided but
override the name with the new name, this is now accomplished
by merging them together in the correct order (using the standard
cloud-init merging algo).
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unittests/test_distros/test_user_data_normalize.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/unittests/test_distros/test_user_data_normalize.py b/tests/unittests/test_distros/test_user_data_normalize.py index 5d9d4311..50398c74 100644 --- a/tests/unittests/test_distros/test_user_data_normalize.py +++ b/tests/unittests/test_distros/test_user_data_normalize.py @@ -173,26 +173,29 @@ class TestUGNormalize(MockerTestCase): 'users': 'default' } (users, _groups) = self._norm(ug_cfg, distro) - self.assertIn('bob', users) + self.assertNotIn('bob', users) # Bob is not the default now, zetta is self.assertIn('zetta', users) + self.assertTrue(users['zetta']['default']) self.assertNotIn('default', users) ug_cfg = { 'user': 'zetta', 'users': 'default, joe' } (users, _groups) = self._norm(ug_cfg, distro) - self.assertIn('bob', users) + self.assertNotIn('bob', users) # Bob is not the default now, zetta is self.assertIn('joe', users) self.assertIn('zetta', users) + self.assertTrue(users['zetta']['default']) self.assertNotIn('default', users) ug_cfg = { 'user': 'zetta', 'users': ['bob', 'joe'] } (users, _groups) = self._norm(ug_cfg, distro) - self.assertNotIn('bob', users) + self.assertIn('bob', users) self.assertIn('joe', users) self.assertIn('zetta', users) + self.assertTrue(users['zetta']['default']) ug_cfg = { 'user': 'zetta', 'users': { @@ -204,6 +207,7 @@ class TestUGNormalize(MockerTestCase): self.assertIn('bob', users) self.assertIn('joe', users) self.assertIn('zetta', users) + self.assertTrue(users['zetta']['default']) ug_cfg = { 'user': 'zetta', } |