|
|
@@ -70,35 +70,37 @@ class BaseRedHatMorphingToolsTestCase(test_base.CoriolisBaseTestCase):
|
|
|
|
|
|
@mock.patch.object(base.BaseLinuxOSMorphingTools, '_exec_cmd_chroot')
|
|
|
@mock.patch.object(base.BaseLinuxOSMorphingTools, '_test_path_chroot')
|
|
|
- def test__get_grub2_cfg_location_uefi(self, mock_test_path_chroot,
|
|
|
+ def test__get_grub2_cfg_location_bios(self, mock_test_path_chroot,
|
|
|
mock_exec_cmd_chroot):
|
|
|
mock_test_path_chroot.return_value = True
|
|
|
|
|
|
result = self.morphing_tools._get_grub2_cfg_location()
|
|
|
|
|
|
- self.assertEqual(result, '/boot/efi/EFI/redhat/grub.cfg')
|
|
|
+ self.assertEqual(result, '/boot/grub2/grub.cfg')
|
|
|
mock_exec_cmd_chroot.assert_has_calls([
|
|
|
mock.call("mount /boot || true"),
|
|
|
mock.call("mount /boot/efi || true")
|
|
|
])
|
|
|
mock_test_path_chroot.assert_called_once_with(
|
|
|
- '/boot/efi/EFI/redhat/grub.cfg')
|
|
|
+ '/boot/grub2/grub.cfg')
|
|
|
|
|
|
@mock.patch.object(base.BaseLinuxOSMorphingTools, '_exec_cmd_chroot')
|
|
|
@mock.patch.object(base.BaseLinuxOSMorphingTools, '_test_path_chroot')
|
|
|
- def test__get_grub2_cfg_location_bios(self, mock_test_path_chroot,
|
|
|
+ def test__get_grub2_cfg_location_uefi(self, mock_test_path_chroot,
|
|
|
mock_exec_cmd_chroot):
|
|
|
mock_test_path_chroot.side_effect = [False, True]
|
|
|
|
|
|
result = self.morphing_tools._get_grub2_cfg_location()
|
|
|
|
|
|
- mock_test_path_chroot.assert_called_with('/boot/grub2/grub.cfg')
|
|
|
+ self.assertEqual(result, '/boot/efi/EFI/redhat/grub.cfg')
|
|
|
mock_exec_cmd_chroot.assert_has_calls([
|
|
|
mock.call("mount /boot || true"),
|
|
|
mock.call("mount /boot/efi || true")
|
|
|
])
|
|
|
-
|
|
|
- self.assertEqual(result, '/boot/grub2/grub.cfg')
|
|
|
+ mock_test_path_chroot.assert_has_calls([
|
|
|
+ mock.call('/boot/grub2/grub.cfg'),
|
|
|
+ mock.call('/boot/efi/EFI/redhat/grub.cfg')
|
|
|
+ ])
|
|
|
|
|
|
@mock.patch.object(base.BaseLinuxOSMorphingTools, '_exec_cmd_chroot')
|
|
|
@mock.patch.object(base.BaseLinuxOSMorphingTools, '_test_path_chroot')
|
|
|
@@ -117,8 +119,8 @@ class BaseRedHatMorphingToolsTestCase(test_base.CoriolisBaseTestCase):
|
|
|
mock.call("mount /boot/efi || true")
|
|
|
])
|
|
|
mock_test_path_chroot.assert_has_calls([
|
|
|
- mock.call('/boot/efi/EFI/redhat/grub.cfg'),
|
|
|
- mock.call('/boot/grub2/grub.cfg')
|
|
|
+ mock.call('/boot/grub2/grub.cfg'),
|
|
|
+ mock.call('/boot/efi/EFI/redhat/grub.cfg')
|
|
|
])
|
|
|
|
|
|
@mock.patch.object(base.BaseLinuxOSMorphingTools, '_exec_cmd_chroot')
|