'A helper method that creates object fragments, stashes them in temp
dirs, and then moves selected fragments back into the hash_dirs on each
node according to a specified desired node state description.
:param objs: a dict that maps object references to dicts that describe
the object timestamp and content. Object frags will be
created for each item in this dict.
:param node_state: a dict that maps a node index to the desired state
for that node. Each desired state is a list of
dicts, with each dict describing object reference,
frag_index and whether the file moved to the node\'s
hash_dir should be marked as durable or not.'

def _setup_nodes_and_do_GET(self, objs, node_state):

    (prosrv, acc1srv, acc2srv, con1srv, con2srv, obj1srv, obj2srv, obj3srv, _obj4srv, _obj5srv, _obj6srv) = _test_servers
    ec_policy = POLICIES[3]
    container_name = uuid.uuid4().hex
    obj_name = uuid.uuid4().hex
    obj_path = os.path.join(os.sep, 'v1', 'a', container_name, obj_name)
    container_path = os.path.join(os.sep, 'v1', 'a', container_name)
    ec_container = Request.blank(container_path, environ={'REQUEST_METHOD': 'PUT'}, headers={'X-Storage-Policy': 'ec', 'X-Auth-Token': 't'})
    resp = ec_container.get_response(prosrv)
    self.assertIn(resp.status_int, (201, 202))
    (partition, nodes) = ec_policy.object_ring.get_nodes('a', container_name, obj_name)
    node_hash_dirs = {}
    node_tmp_dirs = collections.defaultdict(dict)
    for node in nodes:
        node_hash_dirs[node['index']] = os.path.join(_testdir, node['device'], storage_directory(diskfile.get_data_dir(ec_policy), partition, hash_path('a', container_name, obj_name)))
    def _put_object(ref, timestamp, body):
        headers = {'X-Timestamp': timestamp.internal}
        put_req1 = Request.blank(obj_path, method='PUT', headers=headers)
        put_req1.body = body
        resp = put_req1.get_response(prosrv)
        self.assertEqual(resp.status_int, 201)
        get_req = Request.blank(obj_path, method='GET')
        resp = get_req.get_response(prosrv)
        self.assertEqual(resp.status_int, 200)
        self.assertEqual(resp.body, body)
        for (node_index, hash_dir) in node_hash_dirs.items():
            node_tmp_dirs[node_index][ref] = mkdtemp()
            for f in os.listdir(hash_dir):
                move(os.path.join(hash_dir, f), os.path.join(node_tmp_dirs[node_index][ref], f))
    for (obj_ref, obj_info) in objs.items():
        _put_object(obj_ref, **obj_info)
    for hash_dir in node_hash_dirs.values():
        self.assertFalse(os.listdir(hash_dir))
    get_req = Request.blank(obj_path, method='GET')
    resp = get_req.get_response(prosrv)
    self.assertEqual(resp.status_int, 404)
    for (node_index, state) in node_state.items():
        dest = node_hash_dirs[node_index]
        for frag_info in state:
            src = node_tmp_dirs[frag_info['frag_index']][frag_info['ref']]
            src_files = os.listdir(src)
            self.assertFalse(src_files[1:])
            dest_file = src_files[0].replace('#d', ('#d' if frag_info['durable'] else ''))
            move(os.path.join(src, src_files[0]), os.path.join(dest, dest_file))
    get_req = Request.blank(obj_path, method='GET')
    return get_req.get_response(prosrv)
