testing: move echosvr into testutils
authorGabriel Rosenhouse <grosenhouse@pivotal.io>
Thu, 7 Sep 2017 02:10:20 +0000 (19:10 -0700)
committerGabriel Rosenhouse <grosenhouse@pivotal.io>
Thu, 7 Sep 2017 02:10:48 +0000 (19:10 -0700)
pkg/testutils/echosvr/echosvr_test.go [moved from plugins/meta/portmap/echosvr/echosvr_test.go with 97% similarity]
pkg/testutils/echosvr/init_test.go [moved from plugins/meta/portmap/echosvr/init_test.go with 80% similarity]
pkg/testutils/echosvr/main.go [moved from plugins/meta/portmap/echosvr/main.go with 72% similarity]
plugins/meta/portmap/portmap_suite_test.go

similarity index 97%
rename from plugins/meta/portmap/echosvr/echosvr_test.go
rename to pkg/testutils/echosvr/echosvr_test.go
index 7b6d7c8..6a4c3bf 100644 (file)
@@ -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) {
similarity index 80%
rename from plugins/meta/portmap/echosvr/init_test.go
rename to pkg/testutils/echosvr/init_test.go
index 51cc540..a858acc 100644 (file)
@@ -9,5 +9,5 @@ import (
 
 func TestEchosvr(t *testing.T) {
        RegisterFailHandler(Fail)
-       RunSpecs(t, "Echosvr Suite")
+       RunSpecs(t, "Testutils Echosvr Suite")
 }
similarity index 72%
rename from plugins/meta/portmap/echosvr/main.go
rename to pkg/testutils/echosvr/main.go
index 21eca21..7e932bf 100644 (file)
@@ -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 (
index 3ab0a62..ac09a0d 100644 (file)
@@ -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) {