summaryrefslogtreecommitdiff
path: root/ironic_python_agent/tests/unit
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2021-06-07 09:47:12 +0000
committerGerrit Code Review <review@openstack.org>2021-06-07 09:47:12 +0000
commit434de569e66d2a41c675ebf345240a4d73a43ff0 (patch)
treea84534905e13068c28424c7624ac9e6897c97d8a /ironic_python_agent/tests/unit
parent6be440eb3becbb75f9546ee66ee050076a747fa6 (diff)
parenta057be7dadc898ec813b2cac14913cd8523fbbcc (diff)
downloadironic-python-agent-434de569e66d2a41c675ebf345240a4d73a43ff0.tar.gz
Merge "Ignore efi grub2-install failure"
Diffstat (limited to 'ironic_python_agent/tests/unit')
-rw-r--r--ironic_python_agent/tests/unit/extensions/test_image.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/ironic_python_agent/tests/unit/extensions/test_image.py b/ironic_python_agent/tests/unit/extensions/test_image.py
index e2b633a7..599a1973 100644
--- a/ironic_python_agent/tests/unit/extensions/test_image.py
+++ b/ironic_python_agent/tests/unit/extensions/test_image.py
@@ -1675,6 +1675,21 @@ efibootmgr: ** Warning ** : Boot0005 has same label ironic1\n
mock_is_md_device,
mock_execute, mock_dispatch):
+ # return success for every execute call
+ mock_execute.side_effect = [('', '')] * 21
+
+ # make grub2-install calls fail
+ grub_failure = processutils.ProcessExecutionError(
+ stdout='',
+ stderr='grub2-install: error: this utility cannot be used '
+ 'for EFI platforms because it does not support '
+ 'UEFI Secure Boot.\n',
+ exit_code=1,
+ cmd='grub2-install'
+ )
+ mock_execute.side_effect[9] = grub_failure
+ mock_execute.side_effect[10] = grub_failure
+
mock_get_part_uuid.side_effect = [self.fake_root_part,
self.fake_efi_system_part]
environ_mock.get.return_value = '/sbin'
@@ -1686,7 +1701,10 @@ efibootmgr: ** Warning ** : Boot0005 has same label ironic1\n
efi_system_part_uuid=self.fake_efi_system_part_uuid,
target_boot_mode='uefi')
- expected = [mock.call('mount', '/dev/fake2', self.fake_dir),
+ expected = [mock.call('partx', '-u', '/dev/fake', attempts=3,
+ delay_on_retry=True),
+ mock.call('udevadm', 'settle'),
+ mock.call('mount', '/dev/fake2', self.fake_dir),
mock.call('mount', '-o', 'bind', '/dev',
self.fake_dir + '/dev'),
mock.call('mount', '-o', 'bind', '/proc',