Ejemplo n.º 1
0
    def mount_existing_system_test(self, mount):
        storage = create_storage()
        device = StorageDevice("dev1", fmt=get_format("ext4"))
        storage.devicetree._add_device(device)

        task = MountExistingSystemTask(storage, device, True)
        task.run()

        mount.assert_called_once_with(storage=storage,
                                      root_device=device,
                                      read_only=True)
Ejemplo n.º 2
0
    def mount_existing_system_with_task(self, device_name, read_only):
        """Mount existing GNU/Linux installation.

        :param device_name: a name of the root device
        :param read_only: mount the system in read-only mode
        :return: a task
        """
        return MountExistingSystemTask(storage=self.storage,
                                       device=self._get_device(device_name),
                                       read_only=read_only)
Ejemplo n.º 3
0
    def mount_existing_system_with_task(self, device_name, read_only):
        """Mount existing GNU/Linux installation.

        :param device_name: a name of the root device
        :param read_only: mount the system in read-only mode
        :return: a path to the task
        """
        task = MountExistingSystemTask(
            storage=self.storage,
            device=self._get_device(device_name),
            read_only=read_only
        )

        path = self.publish_task(DEVICE_TREE_HANDLER.namespace, task)
        return path