summaryrefslogtreecommitdiff
path: root/test/fib_macos_SUITE.erl
diff options
context:
space:
mode:
authorJordan Bracco <href@random.sh>2021-10-29 13:58:16 +0200
committerJordan Bracco <href@random.sh>2021-10-29 13:58:16 +0200
commitdf8e6fc48c1b0119e7c286742c31b295de50c7b4 (patch)
tree4f9d23d7dd8ce41ee29cb50cc29c23b38401b118 /test/fib_macos_SUITE.erl
parent🤷 (diff)
macos_suite: add RT_DELADDR, RT_DELETE (todo)
Diffstat (limited to '')
-rw-r--r--test/fib_macos_SUITE.erl25
1 files changed, 24 insertions, 1 deletions
diff --git a/test/fib_macos_SUITE.erl b/test/fib_macos_SUITE.erl
index fd42f8d..5894d03 100644
--- a/test/fib_macos_SUITE.erl
+++ b/test/fib_macos_SUITE.erl
@@ -32,7 +32,7 @@ netstat_list(_) ->
%% Packet
pf_route_parser_tests() ->
- [pckt_rt_add, pckt_rt_add_error, pckt_rt_add_expire, pckt_rt_delete, pckt_rt_get, pckt_rt_get_default, pckt_rt_ifinfo].
+ [pckt_rt_add, pckt_rt_add_error, pckt_rt_add_expire, pckt_rt_delete, pckt_rt_get, pckt_rt_get_default, pckt_rt_ifinfo, pckt_rt_delete, pckt_rt_deladdr].
%% Result of `route add 192.168.3.0/24 8.8.8.8`.
pckt_rt_add(_) ->
@@ -152,6 +152,29 @@ pckt_rt_ifinfo(_) ->
?assertEqual(ifinfo, Rt#macos_rt.type),
{skip, todo}.
+pckt_rt_deladdr(_) ->
+ ct:comment("RT_DELADDR"),
+ Binary = <<5,13,52,0,0,0,0,1,0,0,15,0,0,0,0,0,0,0,28,30,0,0,0,0,0,0,255,
+ 255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,20,18,15,0,
+ 6,4,6,0,108,108,119,48,146,241,224,211,173,11,0,0,28,30,0,0,0,0,
+ 0,0,254,128,0,15,0,0,0,0,144,241,224,255,254,211,173,11,0,0,0,0>>,
+ Rt = fib_macos:parse_pf_route_packet(Binary),
+ ?assertEqual(deladdr, Rt#macos_rt.type),
+ ?assertEqual([cloning], Rt#macos_rt.flags),
+ ?assertEqual([destination, gateway, netmask, genmask], Rt#macos_rt.addrs),
+ {skip, todo}.
+
+pkt_rt_delete(_) ->
+ ct:comment("RT_DELETE"),
+ Binary = <<5,2,15,0,0,0,4,0,32,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,30,0,0,
+ 0,0,0,0,254,128,0,15,0,0,0,0,144,241,224,255,254,211,173,11,0,0,
+ 0,0,20,18,15,0,6,0,6,0,146,241,224,211,173,11,0,0,0,0,0,0>>,
+ Rt = fib_macos:parse_pf_route_packet(Binary),
+ ?assertEqual(delete, Rt#macos_rt.type),
+ {skip, todo}.
+
doc(String) ->
ct:comment(String),
ct:log(String).