'Test that we can open files by inode.'

def testTSKInodeHandling(self):

    path = os.path.join(self.base_path, 'ntfs_img.dd')
    ps2 = rdf_paths.PathSpec(inode=65, ntfs_type=128, ntfs_id=0, path='/this/will/be/ignored', pathtype=rdf_paths.PathSpec.PathType.TSK)
    ps = rdf_paths.PathSpec(path=path, pathtype=rdf_paths.PathSpec.PathType.OS, offset=(63 * 512))
    ps.Append(ps2)
    fd = vfs.VFSOpen(ps)
    self.assertEqual(fd.Read(100), 'Hello    world\n')
    ps2 = rdf_paths.PathSpec(inode=65, ntfs_type=128, ntfs_id=4, pathtype=rdf_paths.PathSpec.PathType.TSK)
    ps = rdf_paths.PathSpec(path=path, pathtype=rdf_paths.PathSpec.PathType.OS, offset=(63 * 512))
    ps.Append(ps2)
    fd = vfs.VFSOpen(ps)
    self.assertEqual(fd.read(100), 'I    am    a    real    ADS\n')
    self.assertEqual(fd.Stat().st_size, len('I    am    a    real    ADS\n'))
