'Helper method to create a set of ondisk files and verify suffix_hashes.
:param filenames: list of filenames to create in an object hash dir
:param ts_data: newest data timestamp, used for expected result
:param ts_meta: newest meta timestamp, used for expected result
:param ts_ctype: newest content-type timestamp, used for expected
result
:param policy: storage policy to use for test'

def _verify_get_hashes(self, filenames, ts_data, ts_meta, ts_ctype, policy):

    df_mgr = self.df_router[policy]
    df = df_mgr.get_diskfile('sda1', '0', 'a', 'c', 'o', policy=policy, frag_index=4)
    suffix = os.path.basename(os.path.dirname(df._datadir))
    partition_dir = os.path.dirname(os.path.dirname(df._datadir))
    rmtree(partition_dir, ignore_errors=True)
    mkdirs(df._datadir)
    hasher = md5()
    if (policy.policy_type == EC_POLICY):
        hasher.update((ts_meta.internal + '.meta'))
        hasher.update((ts_data.internal + '.durable'))
        if ts_ctype:
            hasher.update((ts_ctype.internal + '_ctype'))
        expected = {suffix: {None: hasher.hexdigest(), 4: md5(ts_data.internal).hexdigest()}}
    elif (policy.policy_type == REPL_POLICY):
        hasher.update((ts_meta.internal + '.meta'))
        hasher.update((ts_data.internal + '.data'))
        if ts_ctype:
            hasher.update((ts_ctype.internal + '_ctype'))
        expected = {suffix: hasher.hexdigest()}
    else:
        self.fail(('unknown    policy    type    %r' % policy.policy_type))
    for fname in filenames:
        open(os.path.join(df._datadir, fname), 'w').close()
    hashes = df_mgr.get_hashes('sda1', '0', [], policy)
    msg = ('expected    %r    !=    %r    for    policy    %r' % (expected, hashes, policy))
    self.assertEqual(hashes, expected, msg)
