(t *testing.T)
| 2982 | } |
| 2983 | |
| 2984 | func TestAddBogusPath(t *testing.T) { |
| 2985 | s := runNewServer(t, 1, "1.1.1.1", 10179) |
| 2986 | defer s.StopBgp(context.Background(), &api.StopBgpRequest{}) |
| 2987 | |
| 2988 | nlri := &api.NLRI{Nlri: &api.NLRI_Prefix{Prefix: &api.IPAddressPrefix{}}} |
| 2989 | |
| 2990 | a := &api.Attribute{Attr: &api.Attribute_MpReach{MpReach: &api.MpReachNLRIAttribute{}}} |
| 2991 | |
| 2992 | p := &api.Path{ |
| 2993 | Family: &api.Family{Afi: api.Family_AFI_IP, Safi: api.Family_SAFI_UNICAST}, |
| 2994 | Nlri: nlri, |
| 2995 | Pattrs: []*api.Attribute{a}, |
| 2996 | } |
| 2997 | ap, err := api2apiutilPath(p) |
| 2998 | assert.Error(t, err) |
| 2999 | _, err = s.AddPath(apiutil.AddPathRequest{Paths: []*apiutil.Path{ap}}) |
| 3000 | assert.Error(t, err) |
| 3001 | _, err = s.AddPath(apiutil.AddPathRequest{VRFID: "", Paths: []*apiutil.Path{ap}}) |
| 3002 | assert.Error(t, err) |
| 3003 | |
| 3004 | nlri = &api.NLRI{Nlri: &api.NLRI_Prefix{Prefix: &api.IPAddressPrefix{}}} |
| 3005 | a = &api.Attribute{Attr: &api.Attribute_MpReach{MpReach: &api.MpReachNLRIAttribute{ |
| 3006 | Family: &api.Family{Afi: api.Family_AFI_IP, Safi: api.Family_SAFI_FLOW_SPEC_UNICAST}, |
| 3007 | }}} |
| 3008 | p = &api.Path{ |
| 3009 | Family: &api.Family{Afi: api.Family_AFI_IP, Safi: api.Family_SAFI_UNICAST}, |
| 3010 | Nlri: nlri, |
| 3011 | Pattrs: []*api.Attribute{a}, |
| 3012 | } |
| 3013 | ap, err = api2apiutilPath(p) |
| 3014 | assert.Error(t, err) |
| 3015 | _, err = s.AddPath(apiutil.AddPathRequest{Paths: []*apiutil.Path{ap}}) |
| 3016 | assert.Error(t, err) |
| 3017 | _, err = s.AddPath(apiutil.AddPathRequest{VRFID: "45", Paths: []*apiutil.Path{ap}}) |
| 3018 | assert.Error(t, err) |
| 3019 | } |
| 3020 | |
| 3021 | // TestListPathWithIdentifiers confirms whether ListPath properly returns the |
| 3022 | // identifier information for paths for the Global RIB and for VRF RIBs. |
nothing calls this directly
no test coverage detected
searching dependent graphs…