1885: Stubbed out integration test for proxy
authorPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 21 May 2014 20:32:23 +0000 (16:32 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 23 May 2014 19:53:50 +0000 (15:53 -0400)
services/keep/src/arvados.org/keepproxy/keepproxy_test.go [new file with mode: 0644]

diff --git a/services/keep/src/arvados.org/keepproxy/keepproxy_test.go b/services/keep/src/arvados.org/keepproxy/keepproxy_test.go
new file mode 100644 (file)
index 0000000..d4f3ef4
--- /dev/null
@@ -0,0 +1,43 @@
+package main
+
+import (
+       "arvados.org/keepclient"
+       "fmt"
+       . "gopkg.in/check.v1"
+       "os"
+       "os/exec"
+       "strings"
+       "testing"
+)
+
+// Gocheck boilerplate
+func Test(t *testing.T) {
+       TestingT(t)
+}
+
+// Gocheck boilerplate
+var _ = Suite(&ServerRequiredSuite{})
+
+// Tests that require the Keep server running
+type ServerRequiredSuite struct{}
+
+func pythonDir() string {
+       gopath := os.Getenv("GOPATH")
+       return fmt.Sprintf("%s/../python", strings.Split(gopath, ":")[0])
+}
+
+func (s *ServerRequiredSuite) SetUpSuite(c *C) {
+       os.Chdir(pythonDir())
+       exec.Command("python", "run_test_server.py", "start").Run()
+       exec.Command("python", "run_test_server.py", "start_keep").Run()
+}
+
+func (s *ServerRequiredSuite) TearDownSuite(c *C) {
+       os.Chdir(pythonDir())
+       exec.Command("python", "run_test_server.py", "stop_keep").Run()
+       exec.Command("python", "run_test_server.py", "stop").Run()
+}
+
+func (s *ServerRequiredSuite) TestPutAndGet(c *C) {
+       kc := keepclient.KeepClient{"localhost", "", true, 29950, nil, 2, nil, true}
+}