summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp/validate_test.go
diff options
context:
space:
mode:
authorJeff Bean <bean@uber.com>2018-06-22 19:12:33 -0700
committerJeff Bean <bean@uber.com>2018-06-22 19:12:33 -0700
commit154650594c5b40b2905eb73b90f52de72f6ced16 (patch)
tree2ba6ffe099ff216a92df7fb3806eb9aeaa988208 /packet/bgp/validate_test.go
parent954562d65a90af4e8d2e9bf29e4c2bccc4420b38 (diff)
Fixing all megacheck errors.
Diffstat (limited to 'packet/bgp/validate_test.go')
-rw-r--r--packet/bgp/validate_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/packet/bgp/validate_test.go b/packet/bgp/validate_test.go
index 4228c260..f780b5cc 100644
--- a/packet/bgp/validate_test.go
+++ b/packet/bgp/validate_test.go
@@ -6,6 +6,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
)
func bgpupdate() *BGPMessage {
@@ -47,6 +48,7 @@ func Test_Validate_CapV4(t *testing.T) {
assert.Error(err)
res, err = ValidateUpdateMsg(message, map[RouteFamily]BGPAddPathMode{RF_IPv4_UC: BGP_ADD_PATH_BOTH}, false, false)
+ require.NoError(t, err)
assert.Equal(true, res)
}
@@ -58,6 +60,7 @@ func Test_Validate_CapV6(t *testing.T) {
assert.NoError(err)
res, err = ValidateUpdateMsg(message, map[RouteFamily]BGPAddPathMode{RF_IPv4_UC: BGP_ADD_PATH_BOTH}, false, false)
+ require.NoError(t, err)
assert.Equal(false, res)
}
@@ -295,12 +298,12 @@ func Test_Validate_unrecognized_well_known(t *testing.T) {
}
func Test_Validate_aspath(t *testing.T) {
-
assert := assert.New(t)
message := bgpupdate().Body.(*BGPUpdate)
// VALID AS_PATH
res, err := ValidateUpdateMsg(message, map[RouteFamily]BGPAddPathMode{RF_IPv4_UC: BGP_ADD_PATH_BOTH}, true, false)
+ require.NoError(t, err)
assert.Equal(true, res)
// CONFED_SET
@@ -360,6 +363,7 @@ func Test_Validate_aspath(t *testing.T) {
assert.Nil(e.Data)
res, err = ValidateUpdateMsg(message, map[RouteFamily]BGPAddPathMode{RF_IPv4_UC: BGP_ADD_PATH_BOTH}, true, true)
+ require.NoError(t, err)
assert.Equal(true, res)
}