summaryrefslogtreecommitdiff
path: root/tests/unittests/test_datasource/test_smartos.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2013-09-20 20:39:55 -0400
committerScott Moser <smoser@ubuntu.com>2013-09-20 20:39:55 -0400
commit35469c11703b1df66b3b14ad06b583d672f39ff5 (patch)
treee04e01cefb6b1ca3c39a4d782a5236114d81d5e9 /tests/unittests/test_datasource/test_smartos.py
parent266d12c5777d5fba97c374c33cb4f31d50e2d347 (diff)
parentfc97491fef9780a03cca6b78b477cbf75856f46c (diff)
downloadvyos-cloud-init-35469c11703b1df66b3b14ad06b583d672f39ff5.tar.gz
vyos-cloud-init-35469c11703b1df66b3b14ad06b583d672f39ff5.zip
add support for partitioning and creating filesystems
If the disks that are attached on boot do not have a filesystem on them, then this module is useful to set that up. LP: #1218506
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 = []