[ARVADOS] updated: 2.1.0-113-g95b80af80

Git user git at public.arvados.org
Tue Dec 8 16:16:46 UTC 2020


Summary of changes:
 lib/controller/federation_test.go | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

       via  95b80af8065266f8116a9dded43c3c45fb01f991 (commit)
      from  f99d4e313c18bef3eeb2e84abc809452c2af2e69 (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 95b80af8065266f8116a9dded43c3c45fb01f991
Author: Nico Cesar <nico at nicocesar.com>
Date:   Tue Dec 8 11:16:20 2020 -0500

    adding an old friend: TestCreateRemoteContainerRequestCheckRuntimeToken
    
    Arvados-DCO-1.1-Signed-off-by: Nico Cesar <nico at curii.com>

diff --git a/lib/controller/federation_test.go b/lib/controller/federation_test.go
index 9cc9859b6..072ec009a 100644
--- a/lib/controller/federation_test.go
+++ b/lib/controller/federation_test.go
@@ -633,6 +633,38 @@ func (s *FederationSuite) TestCreateRemoteContainerRequest(c *check.C) {
 	c.Check(strings.HasPrefix(cr.UUID, "zzzzz-"), check.Equals, true)
 }
 
+func (s *FederationSuite) TestCreateRemoteContainerRequestCheckRuntimeToken(c *check.C) {
+	// Send request to zmock and check that outgoing request has
+	// runtime_token set with a new random v2 token.
+
+	defer s.localServiceReturns404(c).Close()
+	req := httptest.NewRequest("POST", "/arvados/v1/container_requests?cluster_id=zmock",
+		strings.NewReader(`{
+	  "container_request": {
+	    "name": "hello world",
+	    "state": "Uncommitted",
+	    "output_path": "/",
+	    "container_image": "123",
+	    "command": ["abc"]
+	  }
+	}
+	`))
+	req.Header.Set("Authorization", "Bearer "+arvadostest.ActiveTokenV2)
+	req.Header.Set("Content-type", "application/json")
+
+	arvadostest.SetServiceURL(&s.testHandler.Cluster.Services.RailsAPI, "https://"+os.Getenv("ARVADOS_TEST_API_HOST"))
+	s.testHandler.Cluster.ClusterID = "zzzzz"
+
+	resp := s.testRequest(req).Result()
+	c.Check(resp.StatusCode, check.Equals, http.StatusOK)
+	var cr struct {
+		arvados.ContainerRequest `json:"container_request"`
+	}
+	c.Check(json.NewDecoder(s.remoteMockRequests[0].Body).Decode(&cr), check.IsNil)
+	c.Check(strings.HasPrefix(cr.ContainerRequest.RuntimeToken, "v2/zzzzz-gj3su-"), check.Equals, true)
+	c.Check(cr.ContainerRequest.RuntimeToken, check.Not(check.Equals), arvadostest.ActiveTokenV2)
+}
+
 func (s *FederationSuite) TestCreateRemoteContainerRequestError(c *check.C) {
 	defer s.localServiceReturns404(c).Close()
 	// pass cluster_id via query parameter, this allows arvados-controller

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list