From: shuah <shuah@kernel.org>
To: Po-Hsu Lin <po-hsu.lin@canonical.com>,
davem@davemloft.net, linux-kselftest@vger.kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
shuah <shuah@kernel.org>
Subject: Re: [PATCHv2] selftests/net: skip psock_tpacket test if KALLSYMS was not enabled
Date: Tue, 2 Jul 2019 13:09:32 -0600 [thread overview]
Message-ID: <8b39caac-0278-93a9-230f-0c9d83657526@kernel.org> (raw)
In-Reply-To: <20190701044031.19451-1-po-hsu.lin@canonical.com>
On 6/30/19 10:40 PM, Po-Hsu Lin wrote:
> The psock_tpacket test will need to access /proc/kallsyms, this would
> require the kernel config CONFIG_KALLSYMS to be enabled first.
>
> Apart from adding CONFIG_KALLSYMS to the net/config file here, check the
> file existence to determine if we can run this test will be helpful to
> avoid a false-positive test result when testing it directly with the
> following commad against a kernel that have CONFIG_KALLSYMS disabled:
> make -C tools/testing/selftests TARGETS=net run_tests
>
> Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
> ---
> tools/testing/selftests/net/config | 1 +
> tools/testing/selftests/net/run_afpackettests | 14 +++++++++-----
> 2 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/tools/testing/selftests/net/config b/tools/testing/selftests/net/config
> index 4740404..3dea2cb 100644
> --- a/tools/testing/selftests/net/config
> +++ b/tools/testing/selftests/net/config
> @@ -25,3 +25,4 @@ CONFIG_NF_TABLES_IPV6=y
> CONFIG_NF_TABLES_IPV4=y
> CONFIG_NFT_CHAIN_NAT_IPV6=m
> CONFIG_NFT_CHAIN_NAT_IPV4=m
> +CONFIG_KALLSYMS=y
> diff --git a/tools/testing/selftests/net/run_afpackettests b/tools/testing/selftests/net/run_afpackettests
> index ea5938e..8b42e8b 100755
> --- a/tools/testing/selftests/net/run_afpackettests
> +++ b/tools/testing/selftests/net/run_afpackettests
> @@ -21,12 +21,16 @@ fi
> echo "--------------------"
> echo "running psock_tpacket test"
> echo "--------------------"
> -./in_netns.sh ./psock_tpacket
> -if [ $? -ne 0 ]; then
> - echo "[FAIL]"
> - ret=1
> +if [ -f /proc/kallsyms ]; then
> + ./in_netns.sh ./psock_tpacket
> + if [ $? -ne 0 ]; then
> + echo "[FAIL]"
> + ret=1
> + else
> + echo "[PASS]"
> + fi
> else
> - echo "[PASS]"
> + echo "[SKIP] CONFIG_KALLSYMS not enabled"
> fi
>
> echo "--------------------"
>
Looks good to me. Thanks for the patch.
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
thanks,
-- Shuah
next prev parent reply other threads:[~2019-07-02 19:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-01 4:40 Po-Hsu Lin
2019-07-02 19:09 ` shuah [this message]
2019-07-03 0:18 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8b39caac-0278-93a9-230f-0c9d83657526@kernel.org \
--to=shuah@kernel.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=po-hsu.lin@canonical.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®