Example #1
0
 def _postprocess(self):
     if self.state[EvidenceState.PARENT_MOUNTED]:
         mount_local.PostprocessUnmountPath(self.mount_path)
         self.state[EvidenceState.PARENT_MOUNTED] = False
     if self.state[EvidenceState.PARENT_ATTACHED]:
         mount_local.PostprocessDeleteLosetup(self.device_path)
         self.state[EvidenceState.PARENT_ATTACHED] = False
Example #2
0
 def _postprocess(self):
     if self.state[EvidenceState.MOUNTED]:
         mount_local.PostprocessUnmountPath(self.mount_path)
         self.state[EvidenceState.MOUNTED] = False
     if self.state[EvidenceState.ATTACHED]:
         google_cloud.PostprocessDetachDisk(self.disk_name,
                                            self.device_path)
         self.state[EvidenceState.ATTACHED] = False
Example #3
0
  def _postprocess(self):
    if self.state[EvidenceState.ATTACHED]:
      mount_local.PostprocessDeleteLosetup(self.device_path)
      self.state[EvidenceState.ATTACHED] = False

    # Need to unmount parent disk
    if self.parent_evidence.state[EvidenceState.MOUNTED]:
      mount_local.PostprocessUnmountPath(self.parent_evidence.mount_path)
      self.parent_evidence.state[EvidenceState.MOUNTED] = False
Example #4
0
  def _postprocess(self):
    if self.state[EvidenceState.MOUNTED]:
      mount_local.PostprocessUnmountPath(self.mount_path)
      self.state[EvidenceState.MOUNTED] = False
    if self.state[EvidenceState.ATTACHED]:
      # Late loading the partition processor to avoid loading dfVFS unnecessarily.
      from turbinia.processors import partitions

      # Check for encryption
      encryption_type = partitions.GetPartitionEncryptionType(self.path_spec)
      if encryption_type == 'BDE':
        # bdemount creates a virtual device named bde1 in the mount path. This
        # needs to be unmounted rather than detached.
        mount_local.PostprocessUnmountPath(self.device_path.replace('bde1', ''))
        self.state[EvidenceState.ATTACHED] = False
      else:
        mount_local.PostprocessDeleteLosetup(self.device_path)
        self.state[EvidenceState.ATTACHED] = False
Example #5
0
    def testPostprocessUnmountPath(self, mock_rmdir, mock_subprocess):
        """Test PostprocessUnmountPath method."""
        mount_path = '/mnt/turbinia/turbinia0ckdntz0'
        mount_local.PostprocessUnmountPath(mount_path)
        mock_subprocess.assert_called_once_with(['sudo', 'umount', mount_path])
        mock_rmdir.assert_called_once_with(mount_path)

        # Test error unmounting
        mock_subprocess.reset_mock()
        mock_rmdir.reset_mock()
        mock_subprocess.side_effect = CalledProcessError(1, 'umount')
        with self.assertRaises(TurbiniaException):
            mount_local.PostprocessUnmountPath(mount_path)

        # Test error removing mount path
        mock_subprocess.reset_mock()
        mock_subprocess.side_effect = None
        mock_rmdir.side_effect = OSError
        with self.assertRaises(TurbiniaException):
            mount_local.PostprocessUnmountPath(mount_path)
Example #6
0
 def _postprocess(self):
   google_cloud.PostprocessDetachDisk(self.disk_name, self.local_path)
   mount_local.PostprocessUnmountPath(self.mount_path)
   mount_local.PostprocessDeleteLosetup(self.loopdevice_path)
Example #7
0
 def _postprocess(self):
     # Unmount the container's filesystem
     mount_local.PostprocessUnmountPath(self._container_fs_path)
Example #8
0
 def _postprocess(self):
     mount_local.PostprocessUnmountPath(self.mount_path)
     mount_local.PostprocessDeleteLosetup(self.device_path)
Example #9
0
 def _postprocess(self):
     mount_local.PostprocessUnmountPath(self.mount_path)
     google_cloud.PostprocessDetachDisk(self.disk_name, self.device_path)
Example #10
0
 def _postprocess(self):
   if self.state[EvidenceState.MOUNTED]:
     # Unmount the container's filesystem
     mount_local.PostprocessUnmountPath(self._container_fs_path)
     self.state[EvidenceState.MOUNTED] = False