quality: Add test cases for barrier messages
This commit is contained in:
parent
211d703366
commit
578c0d1bdc
4 changed files with 99 additions and 18 deletions
|
|
@ -1158,6 +1158,36 @@ defmodule OfpActionTest do
|
|||
end
|
||||
end
|
||||
|
||||
describe "Openflow.Action.NxStackPush" do
|
||||
test "with push:NXM_NX_REG0[]" do
|
||||
push = Openflow.Action.NxStackPush.new(field: :reg0)
|
||||
|
||||
assert push.n_bits == 32
|
||||
assert push.offset == 0
|
||||
|
||||
push
|
||||
|> Openflow.Action.to_binary()
|
||||
|> Openflow.Action.read()
|
||||
|> Enum.at(0)
|
||||
|> Kernel.==(push)
|
||||
|> assert()
|
||||
end
|
||||
|
||||
test "with push:NXM_NX_REG0[1..31]" do
|
||||
push = Openflow.Action.NxStackPush.new(field: :reg0, offset: 1, n_bits: 31)
|
||||
|
||||
assert push.n_bits == 31
|
||||
assert push.offset == 1
|
||||
|
||||
push
|
||||
|> Openflow.Action.to_binary()
|
||||
|> Openflow.Action.read()
|
||||
|> Enum.at(0)
|
||||
|> Kernel.==(push)
|
||||
|> assert()
|
||||
end
|
||||
end
|
||||
|
||||
describe "Openflow.Action.NxSetTunnel" do
|
||||
test "with set_tunnel:0x1" do
|
||||
set_tunnel = Openflow.Action.NxSetTunnel.new(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue