of13: Add experimenter property to table features reply 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-02-27 09:06:54 +09:00 committed by FUJITA Tomonori
parent 9aafc0eb56
commit a3afbf0877
5 changed files with 43 additions and 4 deletions

View File

@ -5149,7 +5149,7 @@ class OFPTableFeaturePropExperimenter(OFPTableFeatureProp):
while offset < length: while offset < length:
(word,) = struct.unpack_from(cls._DATA_ELEMENT_PACK_STR, (word,) = struct.unpack_from(cls._DATA_ELEMENT_PACK_STR,
buf, offset) buf, offset)
exp.data.append(word) data.append(word)
offset += pack_size offset += pack_size
return { return {

View File

@ -1732,7 +1732,19 @@ x() ->
arp_tha,ipv6_src,ipv6_dst,ipv6_flabel, arp_tha,ipv6_src,ipv6_dst,ipv6_flabel,
icmpv6_type,icmpv6_code,ipv6_nd_target, icmpv6_type,icmpv6_code,ipv6_nd_target,
ipv6_nd_sll,ipv6_nd_tll,mpls_label,mpls_tc, ipv6_nd_sll,ipv6_nd_tll,mpls_label,mpls_tc,
mpls_bos,pbb_isid]}]}, mpls_bos,pbb_isid]},
#ofp_table_feature_prop_experimenter{
experimenter = 101,
exp_type = 0,
data = <<>>},
#ofp_table_feature_prop_experimenter{
experimenter = 101,
exp_type = 1,
data = <<1:32>>},
#ofp_table_feature_prop_experimenter{
experimenter = 101,
exp_type = 2,
data = <<1:32,2:32>>}]},
#ofp_table_features{ #ofp_table_features{
table_id = 1,name = <<"Flow Table 0x01">>, table_id = 1,name = <<"Flow Table 0x01">>,
metadata_match = <<"\377\377\377\377\377\377\377\377">>, metadata_match = <<"\377\377\377\377\377\377\377\377">>,

View File

@ -4,7 +4,7 @@
{ {
"OFPTableFeaturesStats": { "OFPTableFeaturesStats": {
"config": 0, "config": 0,
"length": 1112, "length": 1168,
"max_entries": 16777216, "max_entries": 16777216,
"metadata_match": 18446744073709551615, "metadata_match": 18446744073709551615,
"metadata_write": 18446744073709551615, "metadata_write": 18446744073709551615,
@ -1591,6 +1591,33 @@
], ],
"type": 14 "type": 14
} }
},
{
"OFPTableFeaturePropExperimenter": {
"length": 12,
"type": 65534,
"exp_type": 0,
"experimenter": 101,
"data": []
}
},
{
"OFPTableFeaturePropExperimenter": {
"length": 16,
"type": 65534,
"exp_type": 1,
"experimenter": 101,
"data": [1]
}
},
{
"OFPTableFeaturePropExperimenter": {
"length": 20,
"type": 65534,
"exp_type": 2,
"experimenter": 101,
"data": [1, 2]
}
} }
], ],
"table_id": 0 "table_id": 0

View File

@ -100,7 +100,7 @@ def hex_array(data):
def bytearray_to_hex(data): def bytearray_to_hex(data):
"""Convert bytearray into array of hexes to be printed.""" """Convert bytearray into array of hexes to be printed."""
return ' '.join(hex(byte) for byte in data) return ' '.join(hex(ord(byte)) for byte in data)
# the following functions are taken from OpenStack # the following functions are taken from OpenStack