def test_hardlink(tmpdir, inplace):
    a = str(tmpdir.join('a'))
    with open(a, 'wb') as tmp:
        tmp.write(b'aXXX')
    b = str(tmpdir.join('b'))
    os.link(a, b)
    AtticRepositoryUpgrader.header_replace(b, b'a', b'b', inplace=inplace)
    if not inplace:
        assert os.stat(a).st_ino != os.stat(b).st_ino
    else:
        assert os.stat(a).st_ino == os.stat(b).st_ino
    with open(b, 'rb') as tmp:
        assert tmp.read() == b'bXXX'
Generate a random REQUEST_ID_HASH.
dataset/ETHPy150Open borgbackup/borg/borg/testsuite/upgrader.py/test_hardlink--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/devappserver2/server.py/Server.generate_request_id_hash