def METHOD_NAME(self):
    '''
    Enables THP, Turns off the defrag and fragments the memory.
    Once the memory gets fragmented turns on the defrag and checks
    whether defrag happened.
    '''
    # Enables THP
    memory.set_thp_value("enabled", "always")
    # Turns off Defrag
    memory.set_thp_value("khugepaged/defrag", "0")
    # Fragments The memory
    self.log.info("Fragmenting the memory Using dd command \n")
    for iterator in range(self.count):
        defrag_cmd = 'dd if=/dev/urandom of=%s/%d bs=%dK count=1'\
                     % (self.mem_path, iterator, self.block_size)
        if(process.system(defrag_cmd, timeout=900,
                          verbose=False, ignore_status=True, shell=True)):
            self.fail('Defrag command Failed %s' % defrag_cmd)
    hugepagesize = memory.get_huge_page_size()
    nr_full = int(0.8 * (memory.meminfo.MemTotal.k / hugepagesize))
    # Sets max possible hugepages before defrag on
    nr_hp_before = self.set_max_hugepages(nr_full)
    # Turns Defrag ON
    memory.set_thp_value("khugepaged/defrag", "1")
    self.log.info("Sleeping %d seconds to settle out things", 12)
    time.sleep(12)
    # Sets max hugepages after defrag on
    nr_hp_after = self.set_max_hugepages(nr_full)
    # Check for memory defragmentation
    if nr_hp_before >= nr_hp_after:
        e_msg = "No Memory Defragmentation\n"
        e_msg += "%d hugepages before turning khugepaged on,\n"\
                 "%d After it" % (nr_hp_before, nr_hp_after)
        self.fail(e_msg)
    self.log.info("Defrag test passed")