Commit 2cd9c466 authored by Po-Hsu Lin's avatar Po-Hsu Lin Committed by Khalid Elmously

selftests/net: skip psock_tpacket test if KALLSYMS was not enabled

BugLink: https://bugs.launchpad.net/bugs/1812176

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: default avatarPo-Hsu Lin <po-hsu.lin@canonical.com>
Acked-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
(backported from commit ff95bf28)
[PHLin: skip changes in config file]
Signed-off-by: default avatarPo-Hsu Lin <po-hsu.lin@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Acked-by: default avatarKleber Souza <kleber.souza@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 4affc04a
...@@ -20,11 +20,15 @@ fi ...@@ -20,11 +20,15 @@ fi
echo "--------------------" echo "--------------------"
echo "running psock_tpacket test" echo "running psock_tpacket test"
echo "--------------------" echo "--------------------"
./in_netns.sh ./psock_tpacket if [ -f /proc/kallsyms ]; then
if [ $? -ne 0 ]; then ./in_netns.sh ./psock_tpacket
echo "[FAIL]" if [ $? -ne 0 ]; then
ret=1 echo "[FAIL]"
ret=1
else
echo "[PASS]"
fi
else else
echo "[PASS]" echo "[SKIP] CONFIG_KALLSYMS not enabled"
fi fi
exit $ret exit $ret
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment