Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107105992
D41436.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D41436.diff
View Options
diff --git a/tests/sys/netlink/test_rtnl_route.py b/tests/sys/netlink/test_rtnl_route.py
--- a/tests/sys/netlink/test_rtnl_route.py
+++ b/tests/sys/netlink/test_rtnl_route.py
@@ -3,6 +3,7 @@
import pytest
from atf_python.sys.net.tools import ToolsHelper
+from atf_python.sys.net.vnet import IfaceFactory
from atf_python.sys.net.vnet import SingleVnetTestTemplate
from atf_python.sys.netlink.attrs import NlAttrIp
from atf_python.sys.netlink.attrs import NlAttrU32
@@ -45,6 +46,46 @@
ToolsHelper.print_net_debug()
ToolsHelper.print_output("netstat -6onW")
+ @pytest.mark.timeout(5)
+ def test_add_route6_ll_if_gw(self):
+ tun_ifname = IfaceFactory().create_iface("", "tun")[0].name
+ tun_ifindex = socket.if_nametoindex(tun_ifname)
+
+ msg = NetlinkRtMessage(self.helper, NlRtMsgType.RTM_NEWROUTE)
+ msg.set_request()
+ msg.add_nlflags([NlmNewFlags.NLM_F_CREATE])
+ msg.base_hdr.rtm_family = socket.AF_INET6
+ msg.base_hdr.rtm_dst_len = 64
+ msg.add_nla(NlAttrIp(RtattrType.RTA_DST, "2001:db8:2::"))
+ msg.add_nla(NlAttrU32(RtattrType.RTA_OIF, tun_ifindex))
+
+ rx_msg = self.get_reply(msg)
+ assert rx_msg.is_type(NlMsgType.NLMSG_ERROR)
+ assert rx_msg.error_code == 0
+
+ ToolsHelper.print_net_debug()
+ ToolsHelper.print_output("netstat -6onW")
+
+ @pytest.mark.timeout(5)
+ def test_add_route4_ll_if_gw(self):
+ tun_ifname = IfaceFactory().create_iface("", "tun")[0].name
+ tun_ifindex = socket.if_nametoindex(tun_ifname)
+
+ msg = NetlinkRtMessage(self.helper, NlRtMsgType.RTM_NEWROUTE)
+ msg.set_request()
+ msg.add_nlflags([NlmNewFlags.NLM_F_CREATE])
+ msg.base_hdr.rtm_family = socket.AF_INET
+ msg.base_hdr.rtm_dst_len = 32
+ msg.add_nla(NlAttrIp(RtattrType.RTA_DST, "192.0.2.1"))
+ msg.add_nla(NlAttrU32(RtattrType.RTA_OIF, tun_ifindex))
+
+ rx_msg = self.get_reply(msg)
+ assert rx_msg.is_type(NlMsgType.NLMSG_ERROR)
+ assert rx_msg.error_code == 0
+
+ ToolsHelper.print_net_debug()
+ ToolsHelper.print_output("netstat -4onW")
+
@pytest.mark.timeout(20)
def test_buffer_override(self):
msg_flags = (
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 11, 5:05 AM (18 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15750498
Default Alt Text
D41436.diff (2 KB)
Attached To
Mode
D41436: netlink: Add tests when adding an interface route
Attached
Detach File
Event Timeline
Log In to Comment