summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/resctrl/resctrlfs.c
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2023-12-15 18:05:11 +0300
committerShuah Khan <skhan@linuxfoundation.org>2024-02-13 23:56:45 +0300
commitc603ff5bb830b8c22dae56ca3ca5ceb5c103525b (patch)
tree3a2d7d5fdf66f2b9c91272196d6a474413545f71 /tools/testing/selftests/resctrl/resctrlfs.c
parent15f298821289d3efba87bb34db29d0ba9780a443 (diff)
downloadlinux-c603ff5bb830b8c22dae56ca3ca5ceb5c103525b.tar.xz
selftests/resctrl: Introduce generalized test framework
Each test currently has a "run test" function in per test file and another resctrl_tests.c. The functions in resctrl_tests.c are almost identical. Generalize the one in resctrl_tests.c such that it can be shared between all of the tests. It makes adding new tests easier and removes the per test if () forests. Also add comment to CPU vendor IDs that they must be defined as bits for a bitmask. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/resctrl/resctrlfs.c')
-rw-r--r--tools/testing/selftests/resctrl/resctrlfs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/resctrl/resctrlfs.c b/tools/testing/selftests/resctrl/resctrlfs.c
index 1bcb9aa96cc2..140f65467ddb 100644
--- a/tools/testing/selftests/resctrl/resctrlfs.c
+++ b/tools/testing/selftests/resctrl/resctrlfs.c
@@ -706,6 +706,11 @@ bool validate_resctrl_feature_request(const char *resource, const char *feature)
return !!res;
}
+bool test_resource_feature_check(const struct resctrl_test *test)
+{
+ return validate_resctrl_feature_request(test->resource, NULL);
+}
+
int filter_dmesg(void)
{
char line[1024];