def setup(config): Cgroup.create(config, CONTROLLER, PARENT_CGNAME) Cgroup.create(config, CONTROLLER, os.path.join(PARENT_CGNAME, CHILD_CGNAME)) Cgroup.set_cgrules_conf(config, CGRULE, append=False) cg.start_cgrules(config)
def setup(config): user_name = Run.run('whoami', shell_bool=True) group_name = Run.run('groups', shell_bool=True).split(' ')[0] CgroupCli.create(config, controller_list=CONTROLLER, cgname=PARENT_NAME, user_name=user_name, group_name=group_name)
def setup(config): Cgroup.create(config, CONTROLLER, PARENT_CGNAME) Cgroup.create(config, CONTROLLER, os.path.join(PARENT_CGNAME, CHILD_CGNAME)) Cgroup.create(config, CONTROLLER, os.path.join(PARENT_CGNAME, CHILD_CGNAME, GRANDCHILD_CGNAME)) Cgroup.create(config, CONTROLLER, SIBLING_CGNAME) Cgroup.create(config, CONTROLLER, os.path.join(SIBLING_CGNAME, SIBLING_CHILD_CGNAME))
def setup(config): Cgroup.create(config, CONTROLLER, CGNAME1) Cgroup.create(config, CONTROLLER, CGNAME2) version = CgroupVersion.get_version(CONTROLLER) if version == CgroupVersion.CGROUP_V1: Cgroup.set(config, CGNAME1, SETTING_V1, VALUE) Cgroup.set(config, CGNAME2, SETTING_V1, VALUE) elif version == CgroupVersion.CGROUP_V2: Cgroup.set(config, CGNAME1, SETTING_V2, VALUE) Cgroup.set(config, CGNAME2, SETTING_V2, VALUE)
def test(config): result = consts.TEST_PASSED cause = None Cgroup.create(config, None, CGNAME) # verify the cgroup exists by reading cgroup.procs Cgroup.get( config, controller=None, cgname=CGNAME, setting='cgroup.procs', print_headers=True, values_only=False ) return result, cause
def setup(config): ver1 = CgroupVersion.get_version(CONTROLLER1) ver2 = CgroupVersion.get_version(CONTROLLER2) if ver1 == CgroupVersion.CGROUP_V2 and \ ver2 == CgroupVersion.CGROUP_V2: # If both controllers are cgroup v2, then we only need to make # one cgroup. The path will be the same for both Cgroup.create(config, [CONTROLLER1, CONTROLLER2], CGNAME) else: Cgroup.create(config, CONTROLLER1, CGNAME) Cgroup.create(config, CONTROLLER2, CGNAME)
def setup(config): Cgroup.create(config, CONTROLLER, PARENT) Cgroup.create(config, CONTROLLER, os.path.join(PARENT, CHILD)) Cgroup.create(config, CONTROLLER, os.path.join(PARENT, CHILD, GRANDCHILD)) version = CgroupVersion.get_version(CONTROLLER) if version == CgroupVersion.CGROUP_V1: # cgdelete in a cgroup v1 controller should be able to move a process # from a child cgroup to its parent. # # Moving a process from a child cgroup to its parent isn't (easily) # supported in cgroup v2 because of cgroup v2's restriction that # processes only be located in leaf cgroups grandchild_cgrp_path = os.path.join(PARENT, CHILD, GRANDCHILD) config.process.create_process_in_cgroup(config, CONTROLLER, grandchild_cgrp_path)
def setup(config): for cg in CGNAMES: Cgroup.create(config, CONTROLLER, cg)
def setup(config): Cgroup.create(config, CONTROLLER, SRC_CGNAME) Cgroup.create(config, CONTROLLER, DST_CGNAME) Cgroup.set(config, cgname=SRC_CGNAME, setting=SETTINGS, value=VALUES)
def setup(config): Cgroup.create(config, CONTROLLER, CGNAME1) Cgroup.create(config, CONTROLLER, CGNAME2)
def setup(config): CgroupCli.create(config, CONTROLLER, CGNAME) if CgroupVersion.get_version('cpu') == CgroupVersion.CGROUP_V1: CgroupCli.set(config, CGNAME, SETTING1, VALUE1) else: CgroupCli.set(config, CGNAME, SETTING2, VALUE2)
def setup(config): Cgroup.create(config, CONTROLLER1, CGNAME)
def setup(config): Cgroup.create(config, CONTROLLER, CGNAME) Cgroup.set(config, CGNAME, SETTING, VALUE)
def setup(config): Cgroup.create(config, CONTROLLER, CGNAME) Cgroup.get_and_validate(config, CGNAME, SETTING, BEFORE) return consts.TEST_PASSED, None
def setup(config): Cgroup.create(config, CONTROLLER, CGNAME) Cgroup.set_cgrules_conf(config, CGRULE, append=False) cg.start_cgrules(config)
def setup(config): Cgroup.create(config, None, cgname=CGNAME)