X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3cf6c6d8dcd3616d0075f9af1732d5ed4231b861..6a07b65a896407afa11d0cd4deef78d779e6725a:/services/keep-web/cadaver_test.go diff --git a/services/keep-web/cadaver_test.go b/services/keep-web/cadaver_test.go index 0fc6e47ba3..3814a459d5 100644 --- a/services/keep-web/cadaver_test.go +++ b/services/keep-web/cadaver_test.go @@ -53,6 +53,8 @@ func (s *IntegrationSuite) TestCadaverUserProject(c *check.C) { } func (s *IntegrationSuite) testCadaver(c *check.C, password string, pathFunc func(arvados.Collection) (string, string, string), skip func(string) bool) { + s.testServer.Config.AnonymousTokens = []string{arvadostest.AnonymousToken} + testdata := []byte("the human tragedy consists in the necessity of living with the consequences of actions performed under the pressure of compulsions we do not understand") tempdir, err := ioutil.TempDir("", "keep-web-test-") @@ -265,7 +267,28 @@ func (s *IntegrationSuite) testCadaver(c *check.C, password string, pathFunc fun } } +func (s *IntegrationSuite) TestCadaverByID(c *check.C) { + for _, path := range []string{"/by_id", "/by_id/"} { + stdout := s.runCadaver(c, arvadostest.ActiveToken, path, "ls") + c.Check(stdout, check.Matches, `(?ms).*collection is empty.*`) + } + for _, path := range []string{ + "/by_id/" + arvadostest.FooPdh, + "/by_id/" + arvadostest.FooPdh + "/", + "/by_id/" + arvadostest.FooCollection, + "/by_id/" + arvadostest.FooCollection + "/", + } { + stdout := s.runCadaver(c, arvadostest.ActiveToken, path, "ls") + c.Check(stdout, check.Matches, `(?ms).*\s+foo\s+3 .*`) + } +} + func (s *IntegrationSuite) TestCadaverUsersDir(c *check.C) { + for _, path := range []string{"/"} { + stdout := s.runCadaver(c, arvadostest.ActiveToken, path, "ls") + c.Check(stdout, check.Matches, `(?ms).*Coll:\s+by_id\s+0 .*`) + c.Check(stdout, check.Matches, `(?ms).*Coll:\s+users\s+0 .*`) + } for _, path := range []string{"/users", "/users/"} { stdout := s.runCadaver(c, arvadostest.ActiveToken, path, "ls") c.Check(stdout, check.Matches, `(?ms).*Coll:\s+active.*`)