mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
internal/testutils: merge with internal/testutil
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package testutils
|
||||
package testutil
|
||||
|
||||
import (
|
||||
"io"
|
||||
@@ -1,4 +1,4 @@
|
||||
package testutils
|
||||
package testutil
|
||||
|
||||
import "testing"
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/moby/moby/v2/daemon/libnetwork/ns"
|
||||
"github.com/moby/moby/v2/internal/testutils"
|
||||
"github.com/moby/moby/v2/internal/testutil"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/vishvananda/netns"
|
||||
"golang.org/x/sys/unix"
|
||||
@@ -143,7 +143,7 @@ func (c *OSContext) restore(t *testing.T) {
|
||||
// t.Fatalf("%+v", err)
|
||||
// }
|
||||
// }
|
||||
func (c *OSContext) Set() (func(testutils.Logger), error) {
|
||||
func (c *OSContext) Set() (func(testutil.Logger), error) {
|
||||
runtime.LockOSThread()
|
||||
orig, err := netns.Get()
|
||||
if err != nil {
|
||||
@@ -158,7 +158,7 @@ func (c *OSContext) Set() (func(testutils.Logger), error) {
|
||||
tid := unix.Gettid()
|
||||
_, file, line, callerOK := runtime.Caller(0)
|
||||
|
||||
return func(log testutils.Logger) {
|
||||
return func(log testutil.Logger) {
|
||||
if unix.Gettid() != tid {
|
||||
msg := "teardown function must be called from the same goroutine as c.Set()"
|
||||
if callerOK {
|
||||
Reference in New Issue
Block a user