def METHOD_NAME(required_node_num, online_nodes, pages_list, ori_page_set):
    """
    Setup host for test - update number of hugepages and check
    :param required_node_num: int, numa node number at least on the host required by the test
    :param online_nodes: List of all online nodes with memory available
    :param pages_list: List of required number of pages for particular nodes
    :param ori_page_set: A dict used to save original node page
    """
    index = 0
    if len(online_nodes) >= required_node_num:
        for pages in pages_list:
            ori_page_set[online_nodes[index]] = process.run(
                'cat /sys/devices/system/node/node{}/hugepages/hugepages-2048kB/nr_hugepages'.
                format(online_nodes[index]), shell=True).stdout_text.strip()
            logging.debug("ori_page_set is {}".format(ori_page_set))
            ret = process.run(
                'echo {} > /sys/devices/system/node/node{}/hugepages/hugepages-2048kB/nr_hugepages'.
                format(pages, online_nodes[index]), shell=True)
            if ret.exit_status:
                raise TestError('Cannot set {} hugepages on node {}'.
                                format(pages, online_nodes[index]))
            ret = process.run(
                'cat /sys/devices/system/node/node{}/hugepages/hugepages-2048kB/nr_hugepages'.
                format(online_nodes[index]), shell=True)
            if pages not in ret.stdout_text:
                raise TestError('Setting {} hugepages on node {} was unsuccessful'.
                                format(pages, online_nodes[index]))
            index += 1
    else:
        raise TestCancel("The test cannot continue since there is no enough "
                         "available NUMA nodes with memory.")