[PATCH V2 05/19] selftests/resctrl: Return if resctrl file system is not supported

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Presently, return value of check_resctrlfs_support() is not checked and
hence the test tries to execute individual tests like CAT, CMT, MBM and
MBA even if resctrl file system is not supported in /proc/filesystems. Fix
this by checking for the return value of check_resctrlfs_support() and if
it returns false i.e. resctrl file system is not supported, then don't run
any tests.

Fixes: ecdbb911f22d ("selftests/resctrl: Add MBM test")
Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@xxxxxxxxx>
---
 tools/testing/selftests/resctrl/resctrl_tests.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
index b2a560c0c5dc..d24de546d4ef 100644
--- a/tools/testing/selftests/resctrl/resctrl_tests.c
+++ b/tools/testing/selftests/resctrl/resctrl_tests.c
@@ -155,7 +155,11 @@ int main(int argc, char **argv)
 	sprintf(bw_report, "reads");
 	sprintf(bm_type, "fill_buf");
 
-	check_resctrlfs_support();
+	if (!check_resctrlfs_support()) {
+		printf("Bail out! resctrl FS does not exist\n");
+		goto out;
+	}
+
 	filter_dmesg();
 
 	if (!is_amd && mbm_test) {
@@ -196,6 +200,7 @@ int main(int argc, char **argv)
 		cat_test_cleanup();
 	}
 
+out:
 	printf("1..%d\n", tests_run);
 
 	return 0;
-- 
2.19.1




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux