Permalink
Browse files

Add tests for SCTP SHUTDOWN chunks

  • Loading branch information...
1 parent d9eb8e5 commit 93f24406bf2c293d2f0c22af08f07dd691845349 @ates committed Sep 17, 2013
View
@@ -16,7 +16,10 @@ sctp_test_() ->
sctp_sack_chunk(),
sctp_heartbeat_chunk(),
sctp_heartbeat_ack_chunk(),
- sctp_abort_chunk()
+ sctp_abort_chunk(),
+ sctp_shutdown_chunk(),
+ sctp_shutdown_ack_chunk(),
+ sctp_shutdown_complete_chunk()
].
sctp_init_chunk() ->
@@ -157,3 +160,38 @@ sctp_abort_chunk() ->
}, []
},
?_assertEqual(Result, pkt:sctp(Data)).
+
+sctp_shutdown_chunk() ->
+ {ok, Data} = file:read_file(?SCTP_DATA_FILE("shutdown.raw")),
+ Result = {
+ #sctp{
+ sport = 44282,dport = 2006,vtag = 3894864518,sum = 3455106587,chunks = [
+ #sctp_chunk{type = 7,flags = 0,len = 4,payload =
+ #sctp_chunk_shutdown{tsn_ack = 430357211}
+ }
+ ]
+ }, []
+ },
+ ?_assertEqual(Result, pkt:sctp(Data)).
+
+sctp_shutdown_ack_chunk() ->
+ {ok, Data} = file:read_file(?SCTP_DATA_FILE("shutdown_ack.raw")),
+ Result = {
+ #sctp{
+ sport = 2006,dport = 44282,vtag = 1619613099,sum = 3544315687,chunks = [
+ #sctp_chunk{type = 8,flags = 0,len = 0,payload = #sctp_chunk_shutdown_ack{}}
+ ]
+ }, []
+ },
+ ?_assertEqual(Result, pkt:sctp(Data)).
+
+sctp_shutdown_complete_chunk() ->
+ {ok, Data} = file:read_file(?SCTP_DATA_FILE("shutdown_complete.raw")),
+ Result = {
+ #sctp{
+ sport = 44282,dport = 2006,vtag = 3894864518,sum = 2141610842,chunks = [
+ #sctp_chunk{type = 14,flags = 0,len = 0,payload = #sctp_chunk_shutdown_complete{}}
+ ]
+ }, []
+ },
+ ?_assertEqual(Result, pkt:sctp(Data)).
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 93f2440

Please sign in to comment.