selftests:net:forwarding: Included install command
Subsystems (4)
PATCH 1/1 selftests:net:forwarding: Included install command
If the execution is skipped due to "jq not installed" message then the installation methods on different OS's have been provided with this message.
--- tools/testing/selftests/net/forwarding/lib.sh | 8 ++++++++ 1 file changed, 8 insertions(+)
tools/testing/selftests/net/forwarding/lib.sh +8 -0
@@ -152,6 +152,14 @@ require_command() if [[ ! -x "$(command -v "$cmd")" ]]; then echo "SKIP: $cmd not installed" + if [[ $cmd == "jq" ]]; then + echo " Install on Debian based systems" + echo " sudo apt -y install jq" + echo " Install on RHEL based systems" + echo " sudo yum -y install jq" + echo " Install on Fedora based systems" + echo " sudo dnf -y install jq" + fi exit $ksft_skip fi }
--
2.37.1
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Quoted 29 lines · On Wed, 10 Aug 2022 15:05:08 +0530 Piyush Thange <[email protected]> wrote:
If the execution is skipped due to "jq not installed" message then the installation methods on different OS's have been provided with this message.
Signed-off-by Piyush Thange <[email protected]>--- tools/testing/selftests/net/forwarding/lib.sh | 8 ++++++++ 1 file changed, 8 insertions(+)tools/testing/selftests/net/forwarding/lib.sh +8
-1@@ -152,6 +152,14 @@ require_command() if [[ ! -x "$(command -v "$cmd")" ]]; then echo "SKIP: $cmd not installed" + if [[ $cmd == "jq" ]]; then + echo " Install on Debian based systems" + echo " sudo apt -y install jq" + echo " Install on RHEL based systems" + echo " sudo yum -y install jq" + echo " Install on Fedora based systems" + echo " sudo dnf -y install jq" + fi exit $ksft_skip fi } --
Quoted 1 line
2.37.1
This is very specific to jq command. What's special with jq and not others? If methods have to be shown, they should be shown for all the programs which are not installed.
Further, this limits the information to specific package managers and systems in the userspace. Tomorrow a new system may come, which will cause this list to grow, not to mention other existing package managers. The kernel also doesn't have a role in it, so we should try to be generic as much as possible.
Thanks,
Siddh
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Quoted 27 lines · Siddh Raman Pant
Quoted 26 lines · On Wed, 10 Aug 2022 15:05:08 +0530 Piyush Thange <[email protected]> wrote:
If the execution is skipped due to "jq not installed" message then the installation methods on different OS's have been provided with this message.
Signed-off-by Piyush Thange <[email protected]>--- tools/testing/selftests/net/forwarding/lib.sh | 8 ++++++++ 1 file changed, 8 insertions(+)tools/testing/selftests/net/forwarding/lib.sh +8
-0@@ -152,6 +152,14 @@ require_command() if [[ ! -x "$(command -v "$cmd")" ]]; then echo "SKIP: $cmd not installed" + if [[ $cmd == "jq" ]]; then + echo " Install on Debian based systems" + echo " sudo apt -y install jq" + echo " Install on RHEL based systems" + echo " sudo yum -y install jq" + echo " Install on Fedora based systems" + echo " sudo dnf -y install jq" + fi exit $ksft_skip
Quoted 8 lines
Quoted 4 lines
tools/testing/selftests/net/forwarding/lib.sh +0
-1fi } --2.37.1
This is very specific to
jqcommand. What's special withjqand not others? If methods have to be shown, they should be shown for all the programs which are not installed.
Agree. The user could decide if jq should be install via REQUIRE_JQ. There are also other cmds that vendor may not build by default. I didn't see any selftests need to handle the installation. The users should takes care of it.
require_command() has takes care most of the needed cmds. If we want to improve the user's experience for the needed cmds. I think add the needed cmds to README file is better.
Thanks
Hangbin
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees