Refactored testcases

This commit is contained in:
Eishun Kondoh 2017-11-21 11:29:26 +09:00
parent 2c0b0024a1
commit 892fd0fbae
4 changed files with 201 additions and 446 deletions

View file

@ -32,6 +32,9 @@ defmodule Flay do
{:noreply, %{state|reply_to: from}}
end
def handle_cast({:register_pid, tester_pid}, state) do
{:noreply, %{state|tester_pid: tester_pid}}
end
def handle_cast({:flow_install, flow_opts, tester_pid}, state) do
send_flow_mod_add(state.datapath_id, flow_opts)
flow_opts_to_ofp_print(flow_opts)
@ -42,6 +45,10 @@ defmodule Flay do
send(state.tester_pid, error)
{:noreply, state}
end
def handle_info(%PacketIn{} = pktin, state) do
send(state.tester_pid, pktin)
{:noreply, state}
end
def handle_info(%PortDesc.Reply{} = desc, state) do
GenServer.reply(state.reply_to, desc)
{:noreply, %{state|reply_to: nil}}