summaryrefslogtreecommitdiff
path: root/tests/unittests/test_handler
diff options
context:
space:
mode:
authorMal Graty <mal.graty@googlemail.com>2021-08-03 17:08:26 +0100
committerGitHub <noreply@github.com>2021-08-03 11:08:26 -0500
commit758acf976f2cb67a85411467fa5fca2ea17a2283 (patch)
tree493dec308eeaf4122db58548cc630eb4fc5f919a /tests/unittests/test_handler
parent824977bd58bae601600682f134bfec00b0c69bbd (diff)
downloadvyos-cloud-init-758acf976f2cb67a85411467fa5fca2ea17a2283.tar.gz
vyos-cloud-init-758acf976f2cb67a85411467fa5fca2ea17a2283.zip
Implementing device_aliases as described in docs (#945)
Implement missing device_aliases feature The device_aliases key has been documented as part of disk_setup for years, however the feature was never implemented. This implements the feature as documented allowing usercfg (rather than dsconfig) to create a mapping of device names. This is not to be confused with disk_aliases, a very similar map but existing solely for use by datasources. LP: #1867532
Diffstat (limited to 'tests/unittests/test_handler')
-rw-r--r--tests/unittests/test_handler/test_handler_mounts.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/unittests/test_handler/test_handler_mounts.py b/tests/unittests/test_handler/test_handler_mounts.py
index e87069f6..69e8b30d 100644
--- a/tests/unittests/test_handler/test_handler_mounts.py
+++ b/tests/unittests/test_handler/test_handler_mounts.py
@@ -133,6 +133,15 @@ class TestSanitizeDevname(test_helpers.FilesystemMockingTestCase):
disk_path,
cc_mounts.sanitize_devname(disk_path, None, mock.Mock()))
+ def test_device_aliases_remapping(self):
+ disk_path = '/dev/sda'
+ self.mock_existence_of_disk(disk_path)
+ self.assertEqual(disk_path,
+ cc_mounts.sanitize_devname('mydata',
+ lambda x: None,
+ mock.Mock(),
+ {'mydata': disk_path}))
+
class TestSwapFileCreation(test_helpers.FilesystemMockingTestCase):