selftests/resctrl: Fix missing options "-n" and "-p"
authorFenghua Yu <fenghua.yu@intel.com>
Wed, 17 Mar 2021 02:22:40 +0000 (02:22 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 May 2021 12:47:27 +0000 (14:47 +0200)
commit0ccead50c386975a576bc9c66bb515a3c8ad576f
treeee53e9286e29ae401116adb16a35835e6281dfba
parentcd29eef12771fa48c271df13ce88745ff97366d2
selftests/resctrl: Fix missing options "-n" and "-p"

[ Upstream commit d7af3d0d515cbdf63b6c3398a3c15ecb1bc2bd38 ]

resctrl test suite accepts command line arguments (like -b, -t, -n and -p)
as documented in the help. But passing -n and -p throws an invalid option
error. This happens because -n and -p are missing in the list of
characters that getopt() recognizes as valid arguments. Hence, they are
treated as invalid options.

Fix this by adding them to the list of characters that getopt() recognizes
as valid arguments. Please note that the main() function already has the
logic to deal with the values passed as part of these arguments and hence
no changes are needed there.

Tested-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/resctrl/resctrl_tests.c