

def test_open2(self):
    opt_param = [bgp.BGPOptParamCapabilityUnknown(cap_code=200, cap_value=b'hoge'), bgp.BGPOptParamCapabilityGracefulRestart(flags=0, time=120, tuples=[]), bgp.BGPOptParamCapabilityRouteRefresh(), bgp.BGPOptParamCapabilityCiscoRouteRefresh(), bgp.BGPOptParamCapabilityMultiprotocol(afi=afi.IP, safi=safi.MPLS_VPN), bgp.BGPOptParamCapabilityCarryingLabelInfo(), bgp.BGPOptParamCapabilityFourOctetAsNumber(as_number=1234567), bgp.BGPOptParamUnknown(type_=99, value=b'fuga')]
    msg = bgp.BGPOpen(my_as=30000, bgp_identifier='192.0.2.2', opt_param=opt_param)
    binmsg = msg.serialize()
    (msg2, rest) = bgp.BGPMessage.parser(binmsg)
    eq_(str(msg), str(msg2))
    ok_((len(msg) > 29))
    eq_(rest, b'')

dataset/ETHPy150Open osrg/ryu/ryu/tests/unit/packet/test_bgp.py Test_bgp.test_open2/original