示例#1
0
    def testGetRootFileEntry(self):
        """Test the get root file entry functionality."""
        file_system = tsk_file_system.TSKFileSystem(self._resolver_context)
        self.assertIsNotNone(file_system)

        file_system.Open(self._tsk_path_spec)

        file_entry = file_system.GetRootFileEntry()

        self.assertIsNotNone(file_entry)
        self.assertEqual(file_entry.name, '')

        file_system.Close()
示例#2
0
    def setUp(self):
        """Sets up the needed objects used throughout the test."""
        self._resolver_context = context.Context()
        test_file = self._GetTestFilePath(['ímynd.dd'])
        self._SkipIfPathNotExists(test_file)

        self._os_path_spec = os_path_spec.OSPathSpec(location=test_file)
        self._tsk_path_spec = tsk_path_spec.TSKPathSpec(
            location='/', parent=self._os_path_spec)

        self._file_system = tsk_file_system.TSKFileSystem(
            self._resolver_context)
        self._file_system.Open(self._tsk_path_spec)
示例#3
0
  def testFileEntryExistsByPathSpec(self):
    """Test the file entry exists by path specification functionality."""
    file_system = tsk_file_system.TSKFileSystem(self._resolver_context)
    self.assertIsNotNone(file_system)

    file_system.Open(self._tsk_path_spec)

    path_spec = tsk_path_spec.TSKPathSpec(
        inode=15, location='/password.txt', parent=self._os_path_spec)
    self.assertTrue(file_system.FileEntryExistsByPathSpec(path_spec))

    path_spec = tsk_path_spec.TSKPathSpec(
        inode=19, location='/bogus.txt', parent=self._os_path_spec)
    self.assertFalse(file_system.FileEntryExistsByPathSpec(path_spec))

    file_system.Close()
示例#4
0
  def testFileEntryExistsByPathSpec(self):
    """Test the file entry exists by path specification functionality."""
    file_system = tsk_file_system.TSKFileSystem(
        self._resolver_context, self._tsk_path_spec)
    self.assertIsNotNone(file_system)

    file_system.Open()

    path_spec = path_spec_factory.Factory.NewPathSpec(
        definitions.TYPE_INDICATOR_TSK, inode=self._INODE_PASSWORDS_TXT,
        location='/password.txt', parent=self._raw_path_spec)
    self.assertTrue(file_system.FileEntryExistsByPathSpec(path_spec))

    path_spec = path_spec_factory.Factory.NewPathSpec(
        definitions.TYPE_INDICATOR_TSK, inode=9999, location='/bogus.txt',
        parent=self._raw_path_spec)
    self.assertFalse(file_system.FileEntryExistsByPathSpec(path_spec))
示例#5
0
    def setUp(self):
        """Sets up the needed objects used throughout the test."""
        self._resolver_context = context.Context()
        test_path = self._GetTestFilePath(['vsstest.qcow2'])
        self._SkipIfPathNotExists(test_path)

        test_os_path_spec = path_spec_factory.Factory.NewPathSpec(
            definitions.TYPE_INDICATOR_OS, location=test_path)
        self._qcow_path_spec = path_spec_factory.Factory.NewPathSpec(
            definitions.TYPE_INDICATOR_QCOW, parent=test_os_path_spec)
        self._tsk_path_spec = path_spec_factory.Factory.NewPathSpec(
            definitions.TYPE_INDICATOR_TSK,
            location='/',
            parent=self._qcow_path_spec)

        self._file_system = tsk_file_system.TSKFileSystem(
            self._resolver_context, self._tsk_path_spec)
        self._file_system.Open()
示例#6
0
  def setUp(self):
    """Sets up the needed objects used throughout the test."""
    self._resolver_context = context.Context()
    test_file = os.path.join(os.getcwd(), u'test_data')
    self._os_path_spec = os_path_spec.OSPathSpec(location=test_file)
    self._os_file_system = os_file_system.OSFileSystem(self._resolver_context)

    # TODO: add RAW volume only test image.

    test_file = os.path.join(u'test_data', u'vsstest.qcow2')
    path_spec = os_path_spec.OSPathSpec(location=test_file)
    self._qcow_path_spec = qcow_path_spec.QcowPathSpec(parent=path_spec)
    self._tsk_path_spec = tsk_path_spec.TSKPathSpec(
        location=u'/', parent=self._qcow_path_spec)

    self._tsk_file_system = tsk_file_system.TSKFileSystem(
        self._resolver_context)
    self._tsk_file_system.Open(path_spec=self._tsk_path_spec)
示例#7
0
    def setUp(self):
        """Sets up the needed objects used throughout the test."""
        self._resolver_context = context.Context()
        self._os_path = self._GetTestFilePath([])
        self._os_path_spec = os_path_spec.OSPathSpec(location=self._os_path)
        self._os_file_system = os_file_system.OSFileSystem(
            self._resolver_context)

        # TODO: add RAW volume only test image.

        test_file = self._GetTestFilePath([u'vsstest.qcow2'])
        path_spec = os_path_spec.OSPathSpec(location=test_file)
        self._qcow_path_spec = qcow_path_spec.QCOWPathSpec(parent=path_spec)
        self._tsk_path_spec = tsk_path_spec.TSKPathSpec(
            location=u'/', parent=self._qcow_path_spec)

        self._tsk_file_system = tsk_file_system.TSKFileSystem(
            self._resolver_context)
        self._tsk_file_system.Open(self._tsk_path_spec)