'Makes a file with a lot of blocks, seeks around'

def test_seek_across_blocks(self):

    if is_live_cluster():
        raise SkipTest('HUE-2946:    Skipping    because    requires    more    memory')
    fs = self.cluster.fs
    test_file = (self.prefix + '/fortest-blocks.txt')
    fs.create(test_file, replication=1, blocksize=(1024 ** 2))
    f = fs.open(test_file, 'w')
    try:
        data = (('abcdefghijklmnopqrstuvwxyz' * 30) * (1024 ** 2))
        f.write(data)
        f.close()
        for i in xrange(1, 10):
            f = fs.open(test_file, 'r')
            for j in xrange(1, 100):
                offset = random.randint(0, (len(data) - 1))
                f.seek(offset, os.SEEK_SET)
                assert_equals(data[offset:(offset + 50)], f.read(50))
            f.close()
    finally:
        fs.remove(test_file)
