def METHOD_NAME(self):
    smm = SoftwareManager()
    dist = distro.detect()
    memsize = int(memory.meminfo.MemFree.b * 0.2)
    self.nr_pages = self.params.get(
        'nr_pages', default=memsize // memory.get_page_size())
    self.map_type = self.params.get('map_type', default='private')
    self.hpage = self.params.get('h_page', default=False)
    nodes = memory.numa_nodes_with_memory()
    pkgs = ['gcc', 'make']
    hp_check = 0
    if self.hpage:
        hp_size = memory.get_huge_page_size()
        for node in nodes:
            genio.write_file('/sys/devices/system/node/node%s/hugepages/hu'
                             'gepages-%skB/nr_hugepages' %
                             (node, str(hp_size)), str(self.nr_pages))
        for node in nodes:
            hp_check += int(genio.read_file(
                '/sys/devices/system/node/node%s/hugepages/hugepages-%skB'
                '/nr_hugepages' % (node, str(hp_size))).strip())
        if hp_check < self.nr_pages:
            self.cancel('Not enough pages to be configured on nodes')
    if dist.name in ["Ubuntu", 'debian']:
        pkgs.extend(['libpthread-stubs0-dev',
                     'libnuma-dev', 'libhugetlbfs-dev'])
    elif dist.name in ["centos", "rhel", "fedora"]:
        if (dist.name == 'rhel' and dist.version >= '9'):
            self.cancel(
                "libhugetlbfs packages are not available on RHEL 9.x onwards.")
        pkgs.extend(['numactl-devel', 'libhugetlbfs-devel'])
    elif dist.name == "SuSE":
        pkgs.extend(['libnuma-devel'])
        if dist.version >= 15:
            pkgs.extend(['libhugetlbfs-devel'])
        else:
            pkgs.extend(['libhugetlbfs-libhugetlb-devel'])
    for package in pkgs:
        if not smm.check_installed(package) and not smm.install(package):
            self.cancel('%s is needed for the test to be run' % package)
    for file_name in ['util.c', 'numa_test.c', 'softoffline.c',
                      'bench_movepages.c', 'Makefile']:
        self.copyutil(file_name)
    build.make(self.teststmpdir)