X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/24af6ae1b23a4fd82c816d077c0178f0d75db2d7..16f704326f44fd1e5e5e60b936c9b5895d6a6ff8:/services/keepproxy/keepproxy_test.go diff --git a/services/keepproxy/keepproxy_test.go b/services/keepproxy/keepproxy_test.go index 9b58c394b5..dc70d968e2 100644 --- a/services/keepproxy/keepproxy_test.go +++ b/services/keepproxy/keepproxy_test.go @@ -186,9 +186,6 @@ func (s *ServerRequiredSuite) TestStorageClassesHeader(c *C) { content := []byte("Very important data") _, _, err := kc.PutB(content) c.Check(err, NotNil) - // errNotFound, _ := err.(*keepclient.ErrNotFound) - // c.Check(errNotFound.Temporary(), Equals, true) - // c.Assert(err, ErrorMatches, ".*connection refused.*") c.Check(hdr.Get("X-Keep-Storage-Classes"), Equals, "secure") } @@ -617,30 +614,29 @@ func (s *ServerRequiredSuite) TestPutAskGetInvalidToken(c *C) { } func (s *ServerRequiredSuite) TestAskGetKeepProxyConnectionError(c *C) { - arv, err := arvadosclient.MakeArvadosClient() - c.Assert(err, Equals, nil) + kc := runProxy(c, nil, false) + defer closeListener() - // keepclient with no such keep server - kc := keepclient.New(arv) + // Point keepproxy at a non-existent keepstore locals := map[string]string{ TestProxyUUID: "http://localhost:12345", } - kc.SetServiceRoots(locals, nil, nil) + router.(*proxyHandler).KeepClient.SetServiceRoots(locals, nil, nil) - // Ask should result in temporary connection refused error + // Ask should result in temporary bad gateway error hash := fmt.Sprintf("%x", md5.Sum([]byte("foo"))) - _, _, err = kc.Ask(hash) + _, _, err := kc.Ask(hash) c.Check(err, NotNil) errNotFound, _ := err.(*keepclient.ErrNotFound) c.Check(errNotFound.Temporary(), Equals, true) - c.Assert(err, ErrorMatches, ".*connection refused.*") + c.Assert(err, ErrorMatches, ".*HTTP 502.*") - // Get should result in temporary connection refused error + // Get should result in temporary bad gateway error _, _, _, err = kc.Get(hash) c.Check(err, NotNil) errNotFound, _ = err.(*keepclient.ErrNotFound) c.Check(errNotFound.Temporary(), Equals, true) - c.Assert(err, ErrorMatches, ".*connection refused.*") + c.Assert(err, ErrorMatches, ".*HTTP 502.*") } func (s *NoKeepServerSuite) TestAskGetNoKeepServerError(c *C) {