quality: Add test case for nx_set_packet_in_format message

This commit is contained in:
Eishun Kondoh 2019-05-06 03:10:57 +09:00
parent ad1a441239
commit 1f5d3cbab2
4 changed files with 33 additions and 214 deletions

View 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