Пример #1
0
    def test_prefer_existing_bootx_loader_with_no_shim(self):
        # touch all loaders in target filesystem
        loaders = self._possible_loaders()[1:]
        for loader in loaders:
            tloader = os.path.join(self.target, loader)
            util.ensure_dir(os.path.dirname(tloader))
            with open(tloader, 'w+') as fh:
                fh.write('\n')

        found = install_grub.find_efi_loader(self.target, self.bootid)
        self.assertTrue(
            found.endswith(os.path.join(self.efi_path, 'BOOT', 'BOOTX64.EFI')))
Пример #2
0
    def test_prefer_shim_loader(self):
        # touch loaders in target filesystem
        loaders = self._possible_loaders()
        for loader in loaders:
            tloader = os.path.join(self.target, loader)
            util.ensure_dir(os.path.dirname(tloader))
            with open(tloader, 'w+') as fh:
                fh.write('\n')

        found = install_grub.find_efi_loader(self.target, self.bootid)
        self.assertTrue(
            found.endswith(
                os.path.join(self.efi_path, self.bootid, 'shimx64.efi')))
Пример #3
0
 def test_return_none_with_no_loaders(self):
     self.assertIsNone(
         install_grub.find_efi_loader(self.target, self.bootid))