From: Kamalesh Babulal Date: Mon, 3 Jun 2024 15:21:53 +0000 (+0530) Subject: ftests/010: Use the controller list from consts X-Git-Tag: v3.2.0~111 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e9741c2760de58019d4ec089f54e50122d2a9bc3;p=thirdparty%2Flibcgroup.git ftests/010: Use the controller list from consts Use consts.EXPECTED_CPU_OUT_* lists, instead of local EXPECTED_OUT_* lists. This removes maintaining of duplicate controller output lists. ----------------------------------------------------------------- Test Results: Run Date: Jun 03 15:22:15 Passed: 1 test(s) Skipped: 0 test(s) Failed: 0 test(s) ----------------------------------------------------------------- Timing Results: Test Time (sec) -------------------------------------------------------- setup 0.00 010-cgget-g_flag_controller_and_cgroup.py 0.04 teardown 0.00 -------------------------------------------------------- Total Run Time 0.04 Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- diff --git a/tests/ftests/010-cgget-g_flag_controller_and_cgroup.py b/tests/ftests/010-cgget-g_flag_controller_and_cgroup.py index 6533f2f1..169a72f8 100755 --- a/tests/ftests/010-cgget-g_flag_controller_and_cgroup.py +++ b/tests/ftests/010-cgget-g_flag_controller_and_cgroup.py @@ -16,123 +16,6 @@ import os CONTROLLER = 'cpu' CGNAME = '010cgget' -EXPECTED_OUT_V1 = [ - '''cpu.cfs_period_us: 100000 - cpu.stat: nr_periods 0 - nr_throttled 0 - throttled_time 0 - cpu.shares: 1024 - cpu.cfs_quota_us: -1 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # cfs_bandwidth without cpu.stat nr_busts, burst_time - '''cpu.cfs_burst_us: 0 - cpu.cfs_period_us: 100000 - cpu.stat: nr_periods 0 - nr_throttled 0 - throttled_time 0 - cpu.shares: 1024 - cpu.idle: 0 - cpu.cfs_quota_us: -1 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # cfs_bandwidth with cpu.stat nr_busts, burst_time - '''cpu.cfs_burst_us: 0 - cpu.cfs_period_us: 100000 - cpu.stat: nr_periods 0 - nr_throttled 0 - throttled_time 0 - nr_bursts 0 - burst_time 0 - cpu.shares: 1024 - cpu.idle: 0 - cpu.cfs_quota_us: -1 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''' -] - -EXPECTED_OUT_V2 = [ - '''cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # with PSI - '''cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - full avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # with PSI, cfs_bandwidth without cpu.stat nr_busts, burst_time - '''cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - full avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.idle: 0 - cpu.max.burst: 0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # with PSI, cfs_bandwidth with cpu.stat nr_busts, burst_time - '''cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - nr_bursts 0 - burst_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - full avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.idle: 0 - cpu.max.burst: 0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''', - # with PSI, cfs_bandwidth with cpu.stat nr_busts, burst_time, force_idle - '''cpu.weight: 100 - cpu.stat: usage_usec 0 - user_usec 0 - system_usec 0 - core_sched.force_idle_usec 0 - nr_periods 0 - nr_throttled 0 - throttled_usec 0 - nr_bursts 0 - burst_usec 0 - cpu.weight.nice: 0 - cpu.pressure: some avg10=0.00 avg60=0.00 avg300=0.00 total=0 - full avg10=0.00 avg60=0.00 avg300=0.00 total=0 - cpu.idle: 0 - cpu.max.burst: 0 - cpu.max: max 100000 - cpu.uclamp.min: 0.00 - cpu.uclamp.max: max''' -] - def prereqs(config): pass @@ -152,11 +35,11 @@ def test(config): version = CgroupVersion.get_version(CONTROLLER) if version == CgroupVersion.CGROUP_V1: - for expected_out in EXPECTED_OUT_V1: + for expected_out in consts.EXPECTED_CPU_OUT_V1: if len(out.splitlines()) == len(expected_out.splitlines()): break elif version == CgroupVersion.CGROUP_V2: - for expected_out in EXPECTED_OUT_V2: + for expected_out in consts.EXPECTED_CPU_OUT_V2: if len(out.splitlines()) == len(expected_out.splitlines()): break