Skip to content

Commit

Permalink
better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mikenye committed Nov 17, 2023
1 parent d31d6b0 commit 3a23187
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pw-bordercontrol/cmd/bordercontrol/feeder_conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"testing"
"time"

"github.com/rs/zerolog"
"github.com/stretchr/testify/assert"
"golang.org/x/net/nettest"
)
Expand All @@ -19,6 +20,9 @@ const MinInt = -MaxInt - 1

func TestGetNum(t *testing.T) {

// set logging to trace level
zerolog.SetGlobalLevel(zerolog.TraceLevel)

iCT := incomingConnectionTracker{}

// test basic functionality
Expand Down Expand Up @@ -50,6 +54,9 @@ func TestGetNum(t *testing.T) {

func TestEvict(t *testing.T) {

// set logging to trace level
zerolog.SetGlobalLevel(zerolog.TraceLevel)

iCT := incomingConnectionTracker{}

// add a connection with connection time older than 10 seconds
Expand Down Expand Up @@ -79,6 +86,9 @@ func TestEvict(t *testing.T) {

func TestCheck(t *testing.T) {

// set logging to trace level
zerolog.SetGlobalLevel(zerolog.TraceLevel)

// prepare test data
srcIP := net.IPv4(172, 0, 0, 1)
iCT := incomingConnectionTracker{}
Expand All @@ -100,6 +110,9 @@ func TestCheck(t *testing.T) {

func TestLookupContainerTCP(t *testing.T) {

// set logging to trace level
zerolog.SetGlobalLevel(zerolog.TraceLevel)

// test lookup of loopback
t.Run("test lookup of loopback", func(t *testing.T) {

Expand Down Expand Up @@ -131,6 +144,9 @@ func TestLookupContainerTCP(t *testing.T) {

func TestDialContainerTCP(t *testing.T) {

// set logging to trace level
zerolog.SetGlobalLevel(zerolog.TraceLevel)

// prepare mocked server
srv, err := nettest.NewLocalListener("tcp4")
assert.NoError(t, err)
Expand Down

0 comments on commit 3a23187

Please sign in to comment.