summaryrefslogtreecommitdiff
path: root/tests/unittests/test_handler
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-04-28 09:23:25 -0400
committerScott Moser <smoser@brickies.net>2017-05-17 12:03:03 -0400
commit31b6f173280fcc8e9be2732ae2e9b6f6c89679d4 (patch)
treeb14140dc4c5e904da17cf82b81c7e1b5fcceb918 /tests/unittests/test_handler
parentf4d3ca43d8a8b1da136c9c07fa9cd0a08c5e3dba (diff)
downloadvyos-cloud-init-31b6f173280fcc8e9be2732ae2e9b6f6c89679d4.tar.gz
vyos-cloud-init-31b6f173280fcc8e9be2732ae2e9b6f6c89679d4.zip
Azure: fix reformatting of ephemeral disks on resize to large types.
Large instance types have a different disk format on the newly partitioned ephemeral drive. So we have to adjust the logic in the Azure datasource to recognize that a disk with 2 partitions and an empty ntfs filesystem on the second one is acceptable. This also adjusts the datasources's builtin fs_setup config to remove the 'replace_fs' entry. This entry was previously ignored, and confusing. I've clarified the doc on that also. LP: #1686514
Diffstat (limited to 'tests/unittests/test_handler')
-rw-r--r--tests/unittests/test_handler/test_handler_disk_setup.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unittests/test_handler/test_handler_disk_setup.py b/tests/unittests/test_handler/test_handler_disk_setup.py
index 9f00d46a..68fc6aae 100644
--- a/tests/unittests/test_handler/test_handler_disk_setup.py
+++ b/tests/unittests/test_handler/test_handler_disk_setup.py
@@ -151,6 +151,22 @@ class TestUpdateFsSetupDevices(TestCase):
'filesystem': 'xfs'
}, fs_setup)
+ def test_dotted_devname_populates_partition(self):
+ fs_setup = {
+ 'device': 'ephemeral0.1',
+ 'label': 'test2',
+ 'filesystem': 'xfs'
+ }
+ cc_disk_setup.update_fs_setup_devices([fs_setup],
+ lambda device: device)
+ self.assertEqual({
+ '_origname': 'ephemeral0.1',
+ 'device': 'ephemeral0',
+ 'partition': '1',
+ 'label': 'test2',
+ 'filesystem': 'xfs'
+ }, fs_setup)
+
@mock.patch('cloudinit.config.cc_disk_setup.find_device_node',
return_value=('/dev/xdb1', False))