[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4f84985-8c98-3b56-3ecc-8258361302d4@linuxfoundation.org>
Date: Mon, 25 Jan 2021 19:29:38 -0700
From: Shuah Khan <skhan@...uxfoundation.org>
To: Fenghua Yu <fenghua.yu@...el.com>, Shuah Khan <shuah@...nel.org>,
Tony Luck <tony.luck@...el.com>,
Reinette Chatre <reinette.chatre@...el.com>,
David Binderman <dcb314@...mail.com>,
Babu Moger <babu.moger@....com>,
James Morse <james.morse@....com>,
Ravi V Shankar <ravi.v.shankar@...el.com>,
Shuah Khan <skhan@...uxfoundation.org>
Cc: linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 05/17] selftests/resctrl: Add a few dependencies
On 11/30/20 1:19 PM, Fenghua Yu wrote:
> Add a couple of sanity checks and the config file for test dependencies.
>
> Running any resctrl unit test involves writing to resctrl file system
> and only a root user has permission to write to resctrl FS. Resctrl
> test suite before running any test checks for the privilege of the
> user and if it's not a root user, the test suite prints a warning
> and continues attempting to run tests.
>
> Attempting to run any test without root privileges will fail as below
>
> TAP version 13
> ok kernel supports resctrl filesystem
> .................
> not ok mounting resctrl to "/sys/fs/resctrl"
> not ok MBA: schemata change
>
> Hence, don't attempt to run any test if the user is not a root user and
> change the warning message to a bail out message to comply with TAP 13
> standards.
>
> Regarding the second check, check_resctrlfs_support() checks if the
> platform supports resctrl file system or not by looking for resctrl
> in /proc/filesystems and returns a boolean value. The main function
> of resctrl test suite calls check_resctrlfs_support() but forgets to
> check for it's return value. This means that resctrl test suite will
> attempt to run resctrl tests (like CMT, CAT, MBM and MBA) even if the
> platform doesn't support resctrl file system.
>
> Fix this by checking for the return value of check_resctrlfs_support() in
> the main function. If resctrl file system isn't supported on the platform
> then exit the test suite gracefully without attempting to run any of
> resctrl unit tests.
>
Please use kselftest.h instead of adding TAP stuff. This way if updates
to newer TAP will not require changes.
thanks,
-- Shuah
Powered by blists - more mailing lists