quality: Add test case for nx_set_packet_in_format message
This commit is contained in:
parent
ad1a441239
commit
1f5d3cbab2
4 changed files with 33 additions and 214 deletions
23
test/lib/openflow/ofp_set_packet_in_format_test.exs
Normal file
23
test/lib/openflow/ofp_set_packet_in_format_test.exs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
defmodule OfpSetPacketInFormatTest do
|
||||
use ExUnit.Case
|
||||
doctest Openflow
|
||||
|
||||
describe "Openflow.to_binary/1" do
|
||||
test "with Openflow.SetPacket_In_Format.new/1" do
|
||||
packet_in_format =
|
||||
"test/packet_data/nx_set_packet_in_format.raw"
|
||||
|> File.read!()
|
||||
|> Openflow.read()
|
||||
|> Kernel.elem(1)
|
||||
|
||||
packet_in_format
|
||||
|> Openflow.to_binary()
|
||||
|> Openflow.read()
|
||||
|> Kernel.elem(1)
|
||||
|> Map.to_list()
|
||||
|> Openflow.NxSetPacketInFormat.new()
|
||||
|> Kernel.==(packet_in_format)
|
||||
|> assert()
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue