Skip to content

Commit d14d768

Browse files
fix:make linter happy
1 parent b19d622 commit d14d768

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

cns/nodesubnet/initialization_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package nodesubnet_test
22

33
import (
4+
"context"
45
"net"
56
"testing"
67

78
"github.com/Azure/azure-container-networking/cns"
89
"github.com/Azure/azure-container-networking/cns/cnireconciler"
10+
"github.com/Azure/azure-container-networking/cns/logger"
911
"github.com/Azure/azure-container-networking/cns/nodesubnet"
1012
"github.com/Azure/azure-container-networking/cns/restserver"
1113
"github.com/Azure/azure-container-networking/cns/types"
@@ -97,3 +99,16 @@ func TestNewCNSPodInfoProvider(t *testing.T) {
9799
})
98100
}
99101
}
102+
103+
// testContext creates a context from the provided testing.T that will be
104+
// canceled if the test suite is terminated.
105+
func testContext(t *testing.T) (context.Context, context.CancelFunc) {
106+
if deadline, ok := t.Deadline(); ok {
107+
return context.WithDeadline(context.Background(), deadline)
108+
}
109+
return context.WithCancel(context.Background())
110+
}
111+
112+
func init() {
113+
logger.InitLogger("testlogs", 0, 0, "./")
114+
}

0 commit comments

Comments
 (0)