[V2,17/19] selftests/resctrl: Unmount resctrl FS after running all tests
diff mbox series

Message ID 79f565afd45e9f4a72a4b84ea80df63b78c47d21.1589835155.git.sai.praneeth.prakhya@intel.com
State New
Headers show
  • Miscellaneous fixes for resctrl selftests
Related show

Commit Message

Prakhya, Sai Praneeth May 18, 2020, 10:08 p.m. UTC
validate_resctrl_feature_request() would mount resctrl FS (if not already
mounted) to check if a requested feature is supported by the platform or
not. There could be situations where in all the resctrl tests are skipped
and hence main() function would return leaving the resctrl FS mounted.

To avoid resctrl FS being mounted, unmount resctrl FS before returning.
This shouldn't have any impact on the cases where all the tests might get
to run (or some of the test cases might get to run and the individual tests
unmount resctrl FS) because umount_resctrlfs() attempts to unmount
resctrl FS only if it's mounted.

Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
 tools/testing/selftests/resctrl/resctrl_tests.c | 1 +
 1 file changed, 1 insertion(+)

diff mbox series

diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
index d45ae004ed77..a0c14555d259 100644
--- a/tools/testing/selftests/resctrl/resctrl_tests.c
+++ b/tools/testing/selftests/resctrl/resctrl_tests.c
@@ -226,6 +226,7 @@  int main(int argc, char **argv)
+	umount_resctrlfs();
 	printf("1..%d\n", tests_run);
 	return 0;