def METHOD_NAME(config):
    result = consts.TEST_PASSED
    cause = None
    Cgroup.create_and_validate(config, CONTROLLER, CGNAME, create_scope=True)
    #
    # Test 1: call cgexec -r to replace idle_thread with infinite while loop
    #
    idle_pid = Cgroup.get_pids_in_cgroup(config, CGNAME, CONTROLLER)[0]
    config.process.create_process_in_cgroup(config, CONTROLLER, CGNAME, cgclassify=False,
                                            replace_idle=True)
    # We need pause, before the cgroups.procs gets updated, post cgexec
    time.sleep(1)
    pid = Cgroup.get_pids_in_cgroup(config, CGNAME, CONTROLLER)[0]
    if idle_pid == pid:
        result = consts.TEST_FAILED
        cause = 'Failed to replace scope idle_thread pid {} {}'.format(idle_pid, pid)
        return result, cause
    #
    # Test 2: call cgexec -r to replace non-idle_thread (while loop,
    #         previously created) with another while loop. It's expected to fail,
    #         because only idle_thread is allowed to be replaced.
    #
    config.process.create_process_in_cgroup(config, CONTROLLER, CGNAME,
                                            cgclassify=False, replace_idle=True)
    # We need pause, before the cgroups.procs gets updated, post cgexec
    time.sleep(1)
    replace_pid = Cgroup.get_pids_in_cgroup(config, CGNAME, CONTROLLER)[0]
    if replace_pid != pid:
        result = consts.TEST_FAILED
        cause = ('Erroneously replaced scope non idle_thread pid {} with '
                 'pid {}'.format(pid, replace_pid))
        return result, cause
    #
    # Test 3: create a non-scope cgroup, try creating a task with replace_idle
    #         set. It should fail way before creating a task, during cgroup name
    #         check.
    Cgroup.create_and_validate(config, CONTROLLER, OUT_OF_SCOPE_CGNAME1)
    config.process.create_process_in_cgroup(config, CONTROLLER, OUT_OF_SCOPE_CGNAME1,
                                            cgclassify=False, replace_idle=True)
    # We need pause, before the cgroups.procs gets updated, post cgexec
    time.sleep(1)
    pid = Cgroup.get_pids_in_cgroup(config, OUT_OF_SCOPE_CGNAME1, CONTROLLER)
    if len(pid) != 0:
        result = consts.TEST_FAILED
        cause = ('Erroneously succeeded in creating task in non scope cgroup: '
                 'pid {}'.format(pid))
        return result, cause
    #
    # Test 4: create a non-scope cgroup with .scope suffix, try creating a task with
    #         replace_idle set. It should fail when trying to find idle_task
    #         check.
    #
    Cgroup.create_and_validate(config, CONTROLLER, OUT_OF_SCOPE_CGNAME2)
    config.process.create_process_in_cgroup(config, CONTROLLER, OUT_OF_SCOPE_CGNAME2,
                                            cgclassify=False, replace_idle=True)
    # We need pause, before the cgroups.procs gets updated, post cgexec
    time.sleep(1)
    pid = Cgroup.get_pids_in_cgroup(config, OUT_OF_SCOPE_CGNAME2, CONTROLLER)
    if len(pid) != 0:
        result = consts.TEST_FAILED
        cause = ('Erroneously succeeded in creating task in non scope cgroup: '
                 'pid {}'.format(pid))
    return result, cause