1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
13 "git.curoverse.com/arvados.git/sdk/go/arvadostest"
17 func (s *UnitSuite) TestStatus(c *check.C) {
18 h := handler{Config: DefaultConfig()}
19 u, _ := url.Parse("http://keep-web.example/status.json")
24 RequestURI: u.RequestURI(),
26 resp := httptest.NewRecorder()
27 h.ServeHTTP(resp, req)
28 c.Check(resp.Code, check.Equals, http.StatusOK)
30 var status map[string]interface{}
31 err := json.NewDecoder(resp.Body).Decode(&status)
32 c.Check(err, check.IsNil)
33 c.Check(status["Cache.Requests"], check.Equals, float64(0))
34 c.Check(status["Version"], check.Not(check.Equals), "")
37 func (s *IntegrationSuite) TestNoStatusFromVHost(c *check.C) {
38 u, _ := url.Parse("http://" + arvadostest.FooCollection + "--keep-web.example/status.json")
43 RequestURI: u.RequestURI(),
45 "Authorization": {"OAuth2 " + arvadostest.ActiveToken},
48 resp := httptest.NewRecorder()
49 s.testServer.Handler.ServeHTTP(resp, req)
50 c.Check(resp.Code, check.Equals, http.StatusNotFound)