of14: Add table status unit test

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Simon Horman 2014-03-11 10:42:05 +09:00 committed by FUJITA Tomonori
parent 5ae836b713
commit 7b3c1ab9cd
4 changed files with 83 additions and 1 deletions

View File

@ -2842,6 +2842,30 @@ x() ->
port = normal,
max_len = 0}]}]},
#ofp_flow_update_abbrev{event = abbrev,xid=1234},
#ofp_flow_update_paused{event = paused}]}
#ofp_flow_update_paused{event = paused}]},
#ofp_table_status{
reason = vacancy_down,
table =
#ofp_table_desc{
table_id = 8,
config = [],
properties =
[#ofp_table_mod_prop_eviction{flags = []},
#ofp_table_mod_prop_vacancy{
vacancy = 0,
vacancy_down = 0,
vacancy_up = 0},
#ofp_table_mod_prop_experimenter{
experimenter = 101,
exp_type = 0,
data = <<>>},
#ofp_table_mod_prop_experimenter{
experimenter = 101,
exp_type = 1,
data = <<1:32>>},
#ofp_table_mod_prop_experimenter{
experimenter = 101,
exp_type = 2,
data = <<1:32,2:32>>}]}}
],
lists:foldl(fun x:do/2, {5, 0}, List).

View File

@ -0,0 +1,57 @@
{
"OFPTableStatus": {
"reason": 3,
"table": {
"OFPTableDesc": {
"config": 0,
"length": 80,
"properties": [
{
"OFPTableModPropEviction": {
"flags": 0,
"length": 8,
"type": 2
}
},
{
"OFPTableModPropVacancy": {
"length": 8,
"type": 3,
"vacancy": 0,
"vacancy_down": 0,
"vacancy_up": 0
}
},
{
"OFPTableModPropExperimenter": {
"data": "",
"exp_type": 0,
"experimenter": 101,
"length": 12,
"type": 65535
}
},
{
"OFPTableModPropExperimenter": {
"data": "AAAAAQ==",
"exp_type": 1,
"experimenter": 101,
"length": 16,
"type": 65535
}
},
{
"OFPTableModPropExperimenter": {
"data": "AAAAAQAAAAI=",
"exp_type": 2,
"experimenter": 101,
"length": 20,
"type": 65535
}
}
],
"table_id": 8
}
}
}
}

View File

@ -112,6 +112,7 @@ implemented = {
ofproto_v1_4.OFPT_GET_ASYNC_REPLY: (True, False),
ofproto_v1_4.OFPT_SET_ASYNC: (False, True),
ofproto_v1_4.OFPT_ROLE_STATUS: (True, False),
ofproto_v1_4.OFPT_TABLE_STATUS: (True, False),
},
}