test_sysctl: Fix test metadata getters
authorJoel Granados <j.granados@samsung.com>
Fri, 16 Jun 2023 08:59:16 +0000 (10:59 +0200)
committerLuis Chamberlain <mcgrof@kernel.org>
Sun, 18 Jun 2023 09:32:53 +0000 (02:32 -0700)
commita40b702789a480904b15f5843c4ed79f969ee4d5
tree5763e264f88be698d987c64309997d5e2cbb787b
parent37e9981e33e4d308c323a56bb908aa54c8f041a8
test_sysctl: Fix test metadata getters

The functions get_test_{count,enabled,target} use awk to get the N'th
field in the ALL_TESTS variable. A variable with leading zeros (e.g.
0009) is misinterpreted as an entire line instead of the N'th field.
Remove the leading zeros so this does not happen. We can now use the
helper in tests 6, 7 and 8.

Signed-off-by: Joel Granados <j.granados@samsung.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
tools/testing/selftests/sysctl/sysctl.sh