Skip to content

Commit

Permalink
Test validating the RouteReflectorClusterID field
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Jerram committed Sep 6, 2018
1 parent 66027ff commit fdc5a14
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/validator/v3/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,18 @@ func init() {
Entry("should reject node with an empty BGP", api.NodeSpec{BGP: &api.NodeBGPSpec{}}, false),
Entry("should reject node with IPv6 address in IPv4 field", api.NodeSpec{BGP: &api.NodeBGPSpec{IPv4Address: netv6_1}}, false),
Entry("should reject node with IPv4 address in IPv6 field", api.NodeSpec{BGP: &api.NodeBGPSpec{IPv6Address: netv4_1}}, false),
Entry("should reject node with bad RR cluster ID #1", api.NodeSpec{BGP: &api.NodeBGPSpec{
IPv4Address: netv4_1,
RouteReflectorClusterID: "abcdef",
}}, false),
Entry("should reject node with bad RR cluster ID #2", api.NodeSpec{BGP: &api.NodeBGPSpec{
IPv4Address: netv4_1,
RouteReflectorClusterID: "300.34.3.1",
}}, false),
Entry("should accept node with good RR cluster ID", api.NodeSpec{BGP: &api.NodeBGPSpec{
IPv4Address: netv4_1,
RouteReflectorClusterID: "245.0.0.1",
}}, true),

// GlobalNetworkPolicy validation.
Entry("disallow name with invalid character", &api.GlobalNetworkPolicy{ObjectMeta: v1.ObjectMeta{Name: "t~!s.h.i.ng"}}, false),
Expand Down

0 comments on commit fdc5a14

Please sign in to comment.