1 # Copyright (C) 2013 Stratosphere Inc.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # vim: tabstop=4 shiftwidth=4 softtabstop=4
20 from nose.tools import *
22 from ryu.lib import ofctl_v1_3
23 from ryu.ofproto import ofproto_v1_3, ofproto_v1_3_parser
24 from ryu.ofproto import ofproto_protocol
25 from ryu.ofproto.ofproto_v1_3_parser import OFPActionPopMpls
27 LOG = logging.getLogger('test_ofctl_v1_3')
30 class Test_ofctl_v1_3(unittest.TestCase):
32 """ Test case for ofctl_v1_3
41 def test_to_actions_pop_mpls(self):
42 dp = ofproto_protocol.ProtocolDesc(version=ofproto_v1_3.OFP_VERSION)
50 result = ofctl_v1_3.to_actions(dp, acts)
52 act = insts.actions[0]
53 ok_(isinstance(act, OFPActionPopMpls))
54 eq_(act.ethertype, 0x0800)