def test(config): result = consts.TEST_PASSED cause = None out = Cgroup.lscgroup(config, controller=[CONTROLLER, CONTROLLER], path=[PARENT_CGNAME, SIBLING_CGNAME]) if out != EXPECTED_OUT1: result = consts.TEST_FAILED cause = ( "Expected lscgroup output doesn't match received output\n" "Expected:\n{}\n" "Received:\n{}\n" "".format(utils.indent(EXPECTED_OUT1, 4), utils.indent(out, 4)) ) return result, cause ret = Cgroup.lscgroup(config, cghelp=True) if 'Usage:' not in ret: result = consts.TEST_FAILED cause = 'Failed to print help text' return result, cause return result, cause
def test(config): result = consts.TEST_PASSED cause = None out = Cgroup.lscgroup(config, controller=CONTROLLER, path=PARENT_CGNAME) if out != EXPECTED_OUT1: result = consts.TEST_FAILED cause = ("Expected lscgroup output doesn't match received output\n'" "Expected:\n{}\n" "Received:\n{}\n" "".format(utils.indent(EXPECTED_OUT1, 4), utils.indent(out, 4))) return result, cause return result, cause