diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-03-08 15:13:07 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-03-08 15:13:07 +0900 |
commit | 1c982d8336c9d89732e8a481a8c90b3e7e283f6f (patch) | |
tree | 60c48bd57d3fb771ddab46a9e9e2b76b7715069b /packet/validate_test.go | |
parent | 608d09c90e906ed43e9206e903443753f73d80b0 (diff) |
server: support multiple route familes per peer
You can configure like the following:
[Global]
As = 65032
RouterId = "192.168.255.1"
[[NeighborList]]
NeighborAddress = "10.0.255.1"
PeerAs = 65001
[NeighborList.RouteServer]
RouteServerClient = true
[[NeighborList.AfiSafiList]]
AfiSafiName = "ipv4-unicast"
[[NeighborList.AfiSafiList]]
AfiSafiName = "ipv6-unicast"
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'packet/validate_test.go')
-rw-r--r-- | packet/validate_test.go | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/packet/validate_test.go b/packet/validate_test.go index effd9d89..46ee3798 100644 --- a/packet/validate_test.go +++ b/packet/validate_test.go @@ -41,29 +41,29 @@ func bgpupdateV6() *BGPMessage { func Test_Validate_CapV4(t *testing.T) { assert := assert.New(t) message := bgpupdate().Body.(*BGPUpdate) - res, err := ValidateUpdateMsg(message, []RouteFamily{RF_IPv6_UC}) + res, err := ValidateUpdateMsg(message, map[RouteFamily]bool{RF_IPv6_UC: true}) assert.Equal(false, res) assert.Error(err) - res, err = ValidateUpdateMsg(message, []RouteFamily{RF_IPv4_UC}) + res, err = ValidateUpdateMsg(message, map[RouteFamily]bool{RF_IPv4_UC: true}) assert.Equal(true, res) } func Test_Validate_CapV6(t *testing.T) { assert := assert.New(t) message := bgpupdateV6().Body.(*BGPUpdate) - res, err := ValidateUpdateMsg(message, []RouteFamily{RF_IPv6_UC}) + res, err := ValidateUpdateMsg(message, map[RouteFamily]bool{RF_IPv6_UC: true}) assert.Equal(true, res) assert.NoError(err) - res, err = ValidateUpdateMsg(message, []RouteFamily{RF_IPv4_UC}) + res, err = ValidateUpdateMsg(message, map[RouteFamily]bool{RF_IPv4_UC: true}) assert.Equal(false, res) } func Test_Validate_OK(t *testing.T) { assert := assert.New(t) message := bgpupdate().Body.(*BGPUpdate) - res, err := ValidateUpdateMsg(message, []RouteFamily{RF_IPv4_UC}) + res, err := ValidateUpdateMsg(message, map[RouteFamily]bool{RF_IPv4_UC: true}) assert.Equal(true, res) assert.NoError(err) @@ -151,7 +151,7 @@ func Test_Validate_duplicate_attribute(t *testing.T) { origin.DecodeFromBytes(originBytes) message.PathAttributes = append(message.PathAttributes, origin) - res, err := ValidateUpdateMsg(message, []RouteFamily{RF_IPv4_UC}) + res, err := ValidateUpdateMsg(message, map[RouteFamily]bool{RF_IPv4_UC: true}) assert.Equal(false, res) assert.Error(err) e := err.(*MessageError) @@ -164,7 +164,7 @@ func Test_Validate_mandatory_missing(t *testing.T) { assert := assert.New(t) message := bgpupdate().Body.(*BGPUpdate) message.PathAttributes = message.PathAttributes[1:] - res, err := ValidateUpdateMsg(message, []RouteFamily{RF_IPv4_UC}) + res, err := ValidateUpdateMsg(message, map[RouteFamily]bool{RF_IPv4_UC: true}) assert.Equal(false, res) assert.Error(err) e := err.(*MessageError) @@ -180,7 +180,7 @@ func Test_Validate_mandatory_missing_nocheck(t *testing.T) { message.PathAttributes = message.PathAttributes[1:] message.NLRI = nil - res, err := ValidateUpdateMsg(message, []RouteFamily{RF_IPv4_UC}) + res, err := ValidateUpdateMsg(message, map[RouteFamily]bool{RF_IPv4_UC: true}) assert.Equal(true, res) assert.NoError(err) } @@ -194,7 +194,7 @@ func Test_Validate_invalid_origin(t *testing.T) { origin.DecodeFromBytes(originBytes) message.PathAttributes[0] = origin - res, err := ValidateUpdateMsg(message, []RouteFamily{RF_IPv4_UC}) + res, err := ValidateUpdateMsg(message, map[RouteFamily]bool{RF_IPv4_UC: true}) assert.Equal(false, res) assert.Error(err) e := err.(*MessageError) @@ -215,7 +215,7 @@ func Test_Validate_invalid_nexthop_zero(t *testing.T) { nexthop.DecodeFromBytes(nexthopBytes) message.PathAttributes[2] = nexthop - res, err := ValidateUpdateMsg(message, []RouteFamily{RF_IPv4_UC}) + res, err := ValidateUpdateMsg(message, map[RouteFamily]bool{RF_IPv4_UC: true}) assert.Equal(false, res) assert.Error(err) e := err.(*MessageError) @@ -236,7 +236,7 @@ func Test_Validate_invalid_nexthop_lo(t *testing.T) { nexthop.DecodeFromBytes(nexthopBytes) message.PathAttributes[2] = nexthop - res, err := ValidateUpdateMsg(message, []RouteFamily{RF_IPv4_UC}) + res, err := ValidateUpdateMsg(message, map[RouteFamily]bool{RF_IPv4_UC: true}) assert.Equal(false, res) assert.Error(err) e := err.(*MessageError) @@ -257,7 +257,7 @@ func Test_Validate_invalid_nexthop_de(t *testing.T) { nexthop.DecodeFromBytes(nexthopBytes) message.PathAttributes[2] = nexthop - res, err := ValidateUpdateMsg(message, []RouteFamily{RF_IPv4_UC}) + res, err := ValidateUpdateMsg(message, map[RouteFamily]bool{RF_IPv4_UC: true}) assert.Equal(false, res) assert.Error(err) e := err.(*MessageError) @@ -277,7 +277,7 @@ func Test_Validate_unrecognized_well_known(t *testing.T) { unknown.DecodeFromBytes(unknownBytes) message.PathAttributes = append(message.PathAttributes, unknown) - res, err := ValidateUpdateMsg(message, []RouteFamily{RF_IPv4_UC}) + res, err := ValidateUpdateMsg(message, map[RouteFamily]bool{RF_IPv4_UC: true}) assert.Equal(false, res) assert.Error(err) e := err.(*MessageError) |