diff options
author | Dmitry Tantsur <dtantsur@protonmail.com> | 2020-05-29 14:16:53 +0200 |
---|---|---|
committer | Dmitry Tantsur <dtantsur@protonmail.com> | 2020-06-02 15:05:59 +0200 |
commit | 6c1545b75b157584f04901cdbfa4897fd15042bb (patch) | |
tree | 9b4c5b194192a3ff5bbdeb8929bd49bb40dba0a6 /ironic_python_agent/tests | |
parent | 3fbcc7c38e858fea2279d376c60367a844ac3a04 (diff) | |
download | ironic-python-agent-6c1545b75b157584f04901cdbfa4897fd15042bb.tar.gz |
New extension call to return partition UUIDs
Currently we parse the success message from the write_image call.
This is inconvenient and incompatible with the deploy steps split.
Change-Id: I258dc1ff1ad1c9df5cbc26a7825d9e7ef2f3205b
Story: #2006963
Diffstat (limited to 'ironic_python_agent/tests')
-rw-r--r-- | ironic_python_agent/tests/unit/extensions/test_standby.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ironic_python_agent/tests/unit/extensions/test_standby.py b/ironic_python_agent/tests/unit/extensions/test_standby.py index b0cc081b..f3d5bccd 100644 --- a/ironic_python_agent/tests/unit/extensions/test_standby.py +++ b/ironic_python_agent/tests/unit/extensions/test_standby.py @@ -939,6 +939,9 @@ class TestStandbyExtension(base.IronicAgentTest): image_info['disk_format'] = 'raw' image_info['stream_raw_images'] = True self._test_prepare_image_raw(image_info, partition=True) + self.assertEqual({'root uuid': 'a318821b-2a60-40e5-a011-7ac07fce342b', + 'partitions': {'root': '/dev/foo-part1'}}, + self.agent_extension.partition_uuids) def test_prepare_partition_image_raw_and_stream_false(self): image_info = _build_fake_partition_image_info() @@ -1241,6 +1244,12 @@ class TestStandbyExtension(base.IronicAgentTest): self.agent_extension._sync_clock) execute_mock.assert_any_call('hwclock', '-v', '--systohc') + @mock.patch('ironic_python_agent.utils.execute', autospec=True) + def test_get_partition_uuids(self, execute_mock): + self.agent_extension.partition_uuids = {'1': '2'} + result = self.agent_extension.get_partition_uuids() + self.assertEqual({'1': '2'}, result.serialize()['command_result']) + @mock.patch('hashlib.md5', autospec=True) @mock.patch('requests.get', autospec=True) |