From: Florian Westphal <fw@strlen.de>
To: <netdev@vger.kernel.org>
Cc: Florian Westphal <fw@strlen.de>
Subject: [PATCH net-next 1/4] selftests: add 'ip get' to rtnetlink.sh
Date: Tue, 15 Aug 2017 16:34:41 +0200 [thread overview]
Message-ID: <20170815143444.17002-2-fw@strlen.de> (raw)
In-Reply-To: <20170815143444.17002-1-fw@strlen.de>
exercise ip/ip6 RTM_GETROUTE doit() callpath.
Signed-off-by: Florian Westphal <fw@strlen.de>
---
tools/testing/selftests/net/rtnetlink.sh | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rtnetlink.sh
index 5b04ad912525..84b4acf5baa9 100755
--- a/tools/testing/selftests/net/rtnetlink.sh
+++ b/tools/testing/selftests/net/rtnetlink.sh
@@ -164,6 +164,37 @@ kci_test_polrouting()
echo "PASS: policy routing"
}
+kci_test_route_get()
+{
+ ret=0
+
+ ip route get 127.0.0.1 > /dev/null
+ check_err $?
+ ip route get 127.0.0.1 dev "$devdummy" > /dev/null
+ check_err $?
+ ip route get ::1 > /dev/null
+ check_err $?
+ ip route get fe80::1 dev "$devdummy" > /dev/null
+ check_err $?
+ ip route get 127.0.0.1 from 127.0.0.1 oif lo tos 0x1 mark 0x1 > /dev/null
+ check_err $?
+ ip route get ::1 from ::1 iif lo oif lo tos 0x1 mark 0x1 > /dev/null
+ check_err $?
+ ip addr add dev "$devdummy" 10.23.7.11/24
+ check_err $?
+ ip route get 10.23.7.11 from 10.23.7.12 iif "$devdummy" > /dev/null
+ check_err $?
+ ip addr del dev "$devdummy" 10.23.7.11/24
+ check_err $?
+
+ if [ $ret -ne 0 ];then
+ echo "FAIL: route get"
+ return 1
+ fi
+
+ echo "PASS: route get"
+}
+
kci_test_rtnl()
{
kci_add_dummy
@@ -173,6 +204,7 @@ kci_test_rtnl()
fi
kci_test_polrouting
+ kci_test_route_get
kci_test_tc
kci_test_gre
kci_test_bridge
--
2.13.0
next prev parent reply other threads:[~2017-08-15 14:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-15 14:34 [PATCH net-next 0/4] inet: make RTM_GETROUTE work without rtnl Florian Westphal
2017-08-15 14:34 ` Florian Westphal [this message]
2017-08-15 14:34 ` [PATCH net-next 2/4] ipv6: route: make rtm_getroute not assume rtnl is locked Florian Westphal
2017-08-15 14:34 ` [PATCH net-next 3/4] ipv6: route: set ipv6 RTM_GETROUTE to not use rtnl Florian Westphal
2017-08-15 14:34 ` [PATCH net-next 4/4] ipv4: route: set ipv4 " Florian Westphal
2017-08-16 0:21 ` [PATCH net-next 0/4] inet: make RTM_GETROUTE work without rtnl 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=20170815143444.17002-2-fw@strlen.de \
--to=fw@strlen.de \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).