summaryrefslogtreecommitdiff
path: root/tests/unittests/test_datasource/test_smartos.py
diff options
context:
space:
mode:
authorBen Howard <ben.howard@canonical.com>2013-09-19 16:49:50 -0600
committerBen Howard <ben.howard@canonical.com>2013-09-19 16:49:50 -0600
commitd1bad8880c2219b9d7a648169bbe7a0a27c03be2 (patch)
tree3080345395538f215cea2708982acbc408ead6ba /tests/unittests/test_datasource/test_smartos.py
parent23f7b8a39bb197db557bdcf851639ea4111b7786 (diff)
downloadvyos-cloud-init-d1bad8880c2219b9d7a648169bbe7a0a27c03be2.tar.gz
vyos-cloud-init-d1bad8880c2219b9d7a648169bbe7a0a27c03be2.zip
Fixes for the MP.
Changed cc_disk_setup to handle the file systems as a label, no longer passing "log" around. Tidied up the documentation to reflect the changes and made grammer, spelling and improved the content a little. Added disk_setup to the default modules list.
Diffstat (limited to 'tests/unittests/test_datasource/test_smartos.py')
-rw-r--r--tests/unittests/test_datasource/test_smartos.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/unittests/test_datasource/test_smartos.py b/tests/unittests/test_datasource/test_smartos.py
index f53715b0..56fe811e 100644
--- a/tests/unittests/test_datasource/test_smartos.py
+++ b/tests/unittests/test_datasource/test_smartos.py
@@ -261,6 +261,41 @@ class TestSmartOSDataSource(MockerTestCase):
self.assertEquals(MOCK_RETURNS['enable_motd_sys_info'],
dsrc.metadata['motd_sys_info'])
+ def test_default_ephemeral(self):
+ # Test to make sure that the builtin config has the ephemeral
+ # configuration.
+ dsrc = self._get_ds()
+ cfg = dsrc.get_config_obj()
+
+ ret = dsrc.get_data()
+ self.assertTrue(ret)
+
+ assert 'disk_setup' in cfg
+ assert 'fs_setup' in cfg
+ self.assertIsInstance(cfg['disk_setup'], dict)
+ self.assertIsInstance(cfg['fs_setup'], list)
+
+ def test_override_builtin_ds(self):
+ # Test to make sure that the built-in DS is overriden
+ data = {}
+ data['disk_setup'] = {'test_dev': {}}
+ data['fs_setup'] = [{'label': 'test_dev'}]
+ data['serial_device'] = '/dev/ttyS2'
+ dsrc = self._get_ds(ds_cfg=data)
+ cfg = dsrc.get_config_obj()
+
+ ret = dsrc.get_data()
+ self.assertTrue(ret)
+
+ assert 'disk_setup' in cfg
+ assert 'fs_setup' in cfg
+ self.assertIsInstance(cfg['disk_setup'], dict)
+ self.assertIsInstance(cfg['fs_setup'], list)
+ assert 'test_dev' in cfg['disk_setup']
+ assert 'test_dev' in cfg['fs_setup'][0]['label']
+
+ self.assertEquals(data['serial_device'], dsrc.seed)
+
def apply_patches(patches):
ret = []