X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/47f2363638b5ad65cec9a96d372563c16bea2907..741b677dc5e85f60bc03ef130873e49ac0b75766:/lib/controller/router/router_test.go diff --git a/lib/controller/router/router_test.go b/lib/controller/router/router_test.go index a17bd3bd8b..c73bc64915 100644 --- a/lib/controller/router/router_test.go +++ b/lib/controller/router/router_test.go @@ -38,8 +38,8 @@ type RouterSuite struct { func (s *RouterSuite) SetUpTest(c *check.C) { s.stub = arvadostest.APIStub{} s.rtr = &router{ - mux: mux.NewRouter(), - fed: &s.stub, + mux: mux.NewRouter(), + backend: &s.stub, } s.rtr.addRoutes() } @@ -169,7 +169,7 @@ func (s *RouterIntegrationSuite) SetUpTest(c *check.C) { cluster.TLS.Insecure = true arvadostest.SetServiceURL(&cluster.Services.RailsAPI, "https://"+os.Getenv("ARVADOS_TEST_API_HOST")) url, _ := url.Parse("https://" + os.Getenv("ARVADOS_TEST_API_HOST")) - s.rtr = New(rpc.NewConn("zzzzz", url, true, rpc.PassthroughTokenProvider)) + s.rtr = New(rpc.NewConn("zzzzz", url, true, rpc.PassthroughTokenProvider), nil) } func (s *RouterIntegrationSuite) TearDownSuite(c *check.C) { @@ -286,6 +286,12 @@ func (s *RouterIntegrationSuite) TestContainerLock(c *check.C) { c.Check(jresp["uuid"], check.IsNil) } +func (s *RouterIntegrationSuite) TestWritableBy(c *check.C) { + _, rr, jresp := doRequest(c, s.rtr, arvadostest.ActiveTokenV2, "GET", `/arvados/v1/users/`+arvadostest.ActiveUserUUID, nil, nil) + c.Check(rr.Code, check.Equals, http.StatusOK) + c.Check(jresp["writable_by"], check.DeepEquals, []interface{}{"zzzzz-tpzed-000000000000000", "zzzzz-tpzed-xurymjxw79nv3jz", "zzzzz-j7d0g-48foin4vonvc2at"}) +} + func (s *RouterIntegrationSuite) TestFullTimestampsInResponse(c *check.C) { uuid := arvadostest.CollectionReplicationDesired2Confirmed2UUID token := arvadostest.ActiveTokenV2 @@ -321,6 +327,8 @@ func (s *RouterIntegrationSuite) TestSelectParam(c *check.C) { c.Check(rr.Code, check.Equals, http.StatusOK) c.Check(resp["kind"], check.Equals, "arvados#container") + c.Check(resp["etag"], check.FitsTypeOf, "") + c.Check(resp["etag"], check.Not(check.Equals), "") c.Check(resp["uuid"], check.HasLen, 27) c.Check(resp["command"], check.HasLen, 2) c.Check(resp["mounts"], check.IsNil)