2751: Teaching run_test_server how to run the proxy server for testing. Added -pid...
[arvados.git] / services / keep / src / arvados.org / keepproxy / keepproxy_test.go
index af1377b249c6fca6e811f258f00aad5a965927a1..f03c94f88b9f380ca4dccc31a07b95feed50d28f 100644 (file)
@@ -39,8 +39,13 @@ func (s *ServerRequiredSuite) SetUpSuite(c *C) {
        defer os.Chdir(cwd)
 
        os.Chdir(pythonDir())
-       exec.Command("python", "run_test_server.py", "start").Run()
-       exec.Command("python", "run_test_server.py", "start_keep").Run()
+
+       if err := exec.Command("python", "run_test_server.py", "start").Run(); err != nil {
+               panic("'python run_test_server.py start' returned error")
+       }
+       if err := exec.Command("python", "run_test_server.py", "start_keep").Run(); err != nil {
+               panic("'python run_test_server.py start_keep' returned error")
+       }
 
        os.Setenv("ARVADOS_API_HOST", "localhost:3001")
        os.Setenv("ARVADOS_API_TOKEN", "4axaw8zxe0qm22wa6urpp5nskcne8z88cvbupv653y1njyi05h")
@@ -109,8 +114,8 @@ func (s *ServerRequiredSuite) TestPutAskGet(c *C) {
        kc, err := keepclient.MakeKeepClient()
        c.Check(kc.External, Equals, true)
        c.Check(kc.Using_proxy, Equals, true)
-       c.Check(len(kc.Service_roots), Equals, 1)
-       c.Check(kc.Service_roots[0], Equals, "http://localhost:29950")
+       c.Check(len(kc.ServiceRoots()), Equals, 1)
+       c.Check(kc.ServiceRoots()[0], Equals, "http://localhost:29950")
        c.Check(err, Equals, nil)
        os.Setenv("ARVADOS_EXTERNAL_CLIENT", "")
 
@@ -159,8 +164,8 @@ func (s *ServerRequiredSuite) TestPutAskGetForbidden(c *C) {
        kc.ApiToken = "123xyz"
        c.Check(kc.External, Equals, true)
        c.Check(kc.Using_proxy, Equals, true)
-       c.Check(len(kc.Service_roots), Equals, 1)
-       c.Check(kc.Service_roots[0], Equals, "http://localhost:29950")
+       c.Check(len(kc.ServiceRoots()), Equals, 1)
+       c.Check(kc.ServiceRoots()[0], Equals, "http://localhost:29950")
        c.Check(err, Equals, nil)
        os.Setenv("ARVADOS_EXTERNAL_CLIENT", "")