[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201020235126.1871815-18-fenghua.yu@intel.com>
Date: Tue, 20 Oct 2020 23:51:22 +0000
From: Fenghua Yu <fenghua.yu@...el.com>
To: "Shuah Khan" <shuah@...nel.org>,
"Reinette Chatre" <reinette.chatre@...el.com>,
"Tony Luck" <tony.luck@...el.com>,
"Babu Moger" <babu.moger@....com>,
"James Morse" <james.morse@....com>,
"Borislav Petkov" <bp@...en8.de>,
"Thomas Gleixner" <tglx@...utronix.de>,
"Ravi V Shankar" <ravi.v.shankar@...el.com>
Cc: "linux-kselftest" <linux-kselftest@...r.kernel.org>,
"linux-kernel" <linux-kernel@...r.kernel.org>,
Fenghua Yu <fenghua.yu@...el.com>
Subject: [PATCH v3 17/21] selftests/resctrl: Unmount resctrl FS after running all tests
Resctrl test suite is expected to unmount the resctrl file system upon
exit. But there are few scenarios where resctrl test suite might forget to
unmount resctrl FS upon exit. For example, running only mba test on a
Broadwell (BDW) machine (MBA isn't supported on BDW CPU).
This happens because validate_resctrl_feature_request() would mount resctrl
FS to check if mba is enabled on the platform or not and finds that the H/W
doesn't support mba and hence will return false to run_mba_test(). This in
turn makes the main() function return without unmounting resctrl FS.
Fix this by calling umount_resctrlfs() before returning from main()
function, so that the resctrl FS will always be unmounted upon exit.
Fixes: ecdbb911f22d ("selftests/resctrl: Add MBM test")
Signed-off-by: Fenghua Yu <fenghua.yu@...el.com>
---
tools/testing/selftests/resctrl/resctrl_tests.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
index a22dc96c0b43..fb66da65b373 100644
--- a/tools/testing/selftests/resctrl/resctrl_tests.c
+++ b/tools/testing/selftests/resctrl/resctrl_tests.c
@@ -257,6 +257,7 @@ int main(int argc, char **argv)
run_cat_test(cpu_no, no_of_bits);
out:
+ umount_resctrlfs();
printf("1..%d\n", tests_run);
return 0;
--
2.29.0
Powered by blists - more mailing lists