openflow: Fix aggregate request

This commit is contained in:
Eishun Kondoh 2019-05-01 23:54:40 +09:00
parent c5e38155e1
commit b32cfff395
22 changed files with 71 additions and 44 deletions

View file

@ -0,0 +1,35 @@
defmodule OfpInstructionTest do
use ExUnit.Case
doctest Openflow
alias Openflow.Instruction.{
ApplyActions,
WriteActions,
ClearActions,
GotoTable,
WriteMetadata,
Meter,
Experimenter
}
describe "Openflow.Instruction" do
test "with all instructions parse and generate" do
instructions = [
ApplyActions.new([Openflow.Action.Output.new(:controller)]),
WriteActions.new([Openflow.Action.Output.new(5)]),
ClearActions.new(),
GotoTable.new(10),
WriteMetadata.new(value: 100, mask: 0xFFFFFFFFFFFFFFFF),
Meter.new(100),
Experimenter.new(0xCAFEBABE, "hogehoge"),
Experimenter.new(0xCAFEBABE)
]
instructions
|> Openflow.Instruction.to_binary()
|> Openflow.Instruction.read()
|> Kernel.==(instructions)
|> assert()
end
end
end