openflow: Fix aggregate request
This commit is contained in:
parent
c5e38155e1
commit
b32cfff395
22 changed files with 71 additions and 44 deletions
29
test/lib/openflow/ofp_hello_test.exs
Normal file
29
test/lib/openflow/ofp_hello_test.exs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
defmodule OfpHelloTest do
|
||||
use ExUnit.Case
|
||||
doctest Openflow
|
||||
|
||||
describe "Openflow.read/1" do
|
||||
test "with OFP_HELLO packet" do
|
||||
{:ok, hello, ""} =
|
||||
"test/packet_data/ofp_hello.raw"
|
||||
|> File.read!()
|
||||
|> Openflow.read()
|
||||
|
||||
assert hello.version == 4
|
||||
assert hello.xid == 0
|
||||
assert hello.elements == [versionbitmap: [30, 10, 9, 3, 2, 1]]
|
||||
end
|
||||
end
|
||||
|
||||
describe "Openflow.to_binary/1" do
|
||||
test "with %Openflow.Hello{}" do
|
||||
hello = Openflow.Hello.new([30, 10, 9, 3, 2, 1])
|
||||
|
||||
expect =
|
||||
"test/packet_data/ofp_hello.raw"
|
||||
|> File.read!()
|
||||
|
||||
assert Openflow.to_binary(hello) == expect
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue