[ARVADOS] updated: 1.1.4-354-g7b79507

Git user git at public.curoverse.com
Tue Jun 5 14:37:39 EDT 2018


Summary of changes:
 services/keepproxy/keepproxy_test.go | 49 ++++++++++++++++++++++++++++--------
 1 file changed, 39 insertions(+), 10 deletions(-)

       via  7b7950766b7a77cd6c2d6ecee7603dd7394c4144 (commit)
       via  24af6ae1b23a4fd82c816d077c0178f0d75db2d7 (commit)
      from  dd97299b6b3ce82b6a57e2838fbe3f81bb51f140 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 7b7950766b7a77cd6c2d6ecee7603dd7394c4144
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Tue Jun 5 15:37:05 2018 -0300

    13431: Fixes unrelated test
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/services/keepproxy/keepproxy_test.go b/services/keepproxy/keepproxy_test.go
index 9b58c39..b5e30de 100644
--- a/services/keepproxy/keepproxy_test.go
+++ b/services/keepproxy/keepproxy_test.go
@@ -617,30 +617,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 to a non-existant 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) {

commit 24af6ae1b23a4fd82c816d077c0178f0d75db2d7
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Tue Jun 5 15:22:18 2018 -0300

    13431: Adds test confirming that keepproxy propagates X-Keep-Storage-Classes
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/services/keepproxy/keepproxy_test.go b/services/keepproxy/keepproxy_test.go
index 65e22e3..9b58c39 100644
--- a/services/keepproxy/keepproxy_test.go
+++ b/services/keepproxy/keepproxy_test.go
@@ -162,6 +162,36 @@ func (s *ServerRequiredSuite) TestLoopDetection(c *C) {
 	c.Check(err, ErrorMatches, `.*loop detected.*`)
 }
 
+func (s *ServerRequiredSuite) TestStorageClassesHeader(c *C) {
+	kc := runProxy(c, nil, false)
+	defer closeListener()
+
+	// Set up fake keepstore to record request headers
+	var hdr http.Header
+	ts := httptest.NewServer(http.HandlerFunc(
+		func(w http.ResponseWriter, r *http.Request) {
+			hdr = r.Header
+			http.Error(w, "Error", http.StatusInternalServerError)
+		}))
+	defer ts.Close()
+
+	// Point keepproxy router's keepclient to the fake keepstore
+	sr := map[string]string{
+		TestProxyUUID: ts.URL,
+	}
+	router.(*proxyHandler).KeepClient.SetServiceRoots(sr, sr, sr)
+
+	// Set up client to ask for storage classes to keepproxy
+	kc.StorageClasses = []string{"secure"}
+	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")
+}
+
 func (s *ServerRequiredSuite) TestDesiredReplicas(c *C) {
 	kc := runProxy(c, nil, false)
 	defer closeListener()

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list