ignore bgp test in ci

This commit is contained in:
Mayuresh Gaitonde
2020-12-18 11:36:18 -08:00
parent 6be4d69d02
commit 12dc52edc6
3 changed files with 42 additions and 11 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"net"
"os"
"testing"
"github.com/golang/protobuf/ptypes"
@@ -18,8 +19,6 @@ type BgpListener struct {
recvdPaths chan string
}
var listener *BgpListener
// NewBgpListener starts a local BGP server for testing purposes
func NewBgpListener(localAS int) (*BgpListener, error) {
s := gobgp.NewBgpServer()
@@ -71,6 +70,14 @@ func (l *BgpListener) Shutdown() error {
// if the test timeouts are very small. It also needs to be run as
// root (sudo)
func TestBgpNew(t *testing.T) {
if os.Getenv("CI") != "" {
t.Skip("Skipping testing in CI environment")
}
listener, err := NewBgpListener(22222)
if err != nil {
panic(err)
}
defer listener.Shutdown()
a := assert.New(t)
c := config.BgpConfig{
LocalAS: 11111,