summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp/validate_test.go
diff options
context:
space:
mode:
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)
}