summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2013-01-18 10:57:20 -0800
committerJoshua Harlow <harlowja@yahoo-inc.com>2013-01-18 10:57:20 -0800
commitbaefd17a9d997e11f85bf89d9337c2d40748bc37 (patch)
tree70e00dbab88cdc45ba0ed52805346f7c47c001c7 /tests
parentbf7bdf27e109ffb4964d4869b79da964fc40fb65 (diff)
downloadvyos-cloud-init-baefd17a9d997e11f85bf89d9337c2d40748bc37.tar.gz
vyos-cloud-init-baefd17a9d997e11f85bf89d9337c2d40748bc37.zip
Adjust how the legacy user: XYZ config alters the normalized user list
Previously if a legacy user: XYZ entry was found, XYZ would not automatically be promoted to the default user but would instead just be added on as a new entry to the normalized user list. It appears the behavior that is wanted is for the XYZ entry to be added on as the default user (thus overriding a distro provided default user), which better matches how the code previous worked. LP: #1100920
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/test_distros/test_user_data_normalize.py10
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',
}