diff --git a/plugins/meta/portmap/echosvr/echosvr_test.go b/pkg/testutils/echosvr/echosvr_test.go similarity index 97% rename from plugins/meta/portmap/echosvr/echosvr_test.go rename to pkg/testutils/echosvr/echosvr_test.go index 7b6d7c8f..6a4c3bf8 100644 --- a/plugins/meta/portmap/echosvr/echosvr_test.go +++ b/pkg/testutils/echosvr/echosvr_test.go @@ -16,7 +16,7 @@ import ( var binaryPath string var _ = SynchronizedBeforeSuite(func() []byte { - binaryPath, err := gexec.Build("github.com/containernetworking/plugins/plugins/meta/portmap/echosvr") + binaryPath, err := gexec.Build("github.com/containernetworking/plugins/pkg/testutils/echosvr") Expect(err).NotTo(HaveOccurred()) return []byte(binaryPath) }, func(data []byte) { diff --git a/plugins/meta/portmap/echosvr/init_test.go b/pkg/testutils/echosvr/init_test.go similarity index 80% rename from plugins/meta/portmap/echosvr/init_test.go rename to pkg/testutils/echosvr/init_test.go index 51cc5403..a858acc9 100644 --- a/plugins/meta/portmap/echosvr/init_test.go +++ b/pkg/testutils/echosvr/init_test.go @@ -9,5 +9,5 @@ import ( func TestEchosvr(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Echosvr Suite") + RunSpecs(t, "Testutils Echosvr Suite") } diff --git a/plugins/meta/portmap/echosvr/main.go b/pkg/testutils/echosvr/main.go similarity index 72% rename from plugins/meta/portmap/echosvr/main.go rename to pkg/testutils/echosvr/main.go index 21eca219..7e932bfc 100644 --- a/plugins/meta/portmap/echosvr/main.go +++ b/pkg/testutils/echosvr/main.go @@ -1,3 +1,9 @@ +// Echosvr is a simple TCP echo server +// +// It prints its listen address on stdout +// 127.0.0.1:xxxxx +// A test should wait for this line, parse it +// and may then attempt to connect. package main import ( diff --git a/plugins/meta/portmap/portmap_suite_test.go b/plugins/meta/portmap/portmap_suite_test.go index 3ab0a626..ac09a0d6 100644 --- a/plugins/meta/portmap/portmap_suite_test.go +++ b/plugins/meta/portmap/portmap_suite_test.go @@ -43,7 +43,7 @@ func TestPortmap(t *testing.T) { var echoServerBinaryPath string var _ = SynchronizedBeforeSuite(func() []byte { - binaryPath, err := gexec.Build("github.com/containernetworking/plugins/plugins/meta/portmap/echosvr") + binaryPath, err := gexec.Build("github.com/containernetworking/plugins/pkg/testutils/echosvr") Expect(err).NotTo(HaveOccurred()) return []byte(binaryPath) }, func(data []byte) {