summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/resctrl/cmt_test.c
diff options
context:
space:
mode:
authorShaopeng Tan <tan.shaopeng@jp.fujitsu.com>2023-04-13 16:22:59 +0900
committerShuah Khan <skhan@linuxfoundation.org>2023-04-13 11:34:29 -0600
commit91db4fd9019a08251a500157cf0d88de457e1a96 (patch)
tree7f45f9023528ca3359ccbd99e1876fa705e48120 /tools/testing/selftests/resctrl/cmt_test.c
parent73c55fa5ab5539d38561b0d816be1315c8bf6752 (diff)
selftests/resctrl: Remove duplicate codes that clear each test result file
Before exiting each test function(run_cmt/cat/mbm/mba_test()), test results("ok","not ok") are printed by ksft_test_result() and then temporary result files are cleaned by function cmt/cat/mbm/mba_test_cleanup(). However, before running ksft_test_result(), function cmt/cat/mbm/mba_test_cleanup() has been run in each test function as follows: cmt_resctrl_val() cat_perf_miss_val() mba_schemata_change() mbm_bw_change() Remove duplicate codes that clear each test result file, while ensuring cleanup properly even when errors occur in each test. Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/resctrl/cmt_test.c')
-rw-r--r--tools/testing/selftests/resctrl/cmt_test.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/testing/selftests/resctrl/cmt_test.c b/tools/testing/selftests/resctrl/cmt_test.c
index 47cde5c02b7f..af71b2141271 100644
--- a/tools/testing/selftests/resctrl/cmt_test.c
+++ b/tools/testing/selftests/resctrl/cmt_test.c
@@ -132,13 +132,12 @@ int cmt_resctrl_val(int cpu_no, int n, char **benchmark_cmd)
ret = resctrl_val(benchmark_cmd, &param);
if (ret)
- return ret;
+ goto out;
ret = check_results(&param, n);
- if (ret)
- return ret;
+out:
cmt_test_cleanup();
- return 0;
+ return ret;
}