X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3959d7afff8bb3c3b8da9eb7d178919275180f2a..5c6c6946b034b821446a3657ca065b5646e0f104:/services/arv-git-httpd/server_test.go diff --git a/services/arv-git-httpd/server_test.go b/services/arv-git-httpd/server_test.go index 77c4d3bb3b..c1364ca75b 100644 --- a/services/arv-git-httpd/server_test.go +++ b/services/arv-git-httpd/server_test.go @@ -80,15 +80,33 @@ func (s *IntegrationSuite) TestExpiredToken(c *check.C) { func (s *IntegrationSuite) TestInvalidToken(c *check.C) { for _, repo := range []string{"active/foo.git", "active/foo/.git"} { - err := s.runGit(c, "no-such-token-in-the-system", "fetch", repo) + err := s.runGit(c, "s3cr3tp@ssw0rd", "fetch", repo) + c.Assert(err, check.ErrorMatches, `.* requested URL returned error.*`) + } +} + +func (s *IntegrationSuite) TestShortToken(c *check.C) { + for _, repo := range []string{"active/foo.git", "active/foo/.git"} { + err := s.runGit(c, "s3cr3t", "fetch", repo) c.Assert(err, check.ErrorMatches, `.* 500 while accessing.*`) } } +func (s *IntegrationSuite) TestShortTokenBadReq(c *check.C) { + for _, repo := range []string{"bogus"} { + err := s.runGit(c, "s3cr3t", "fetch", repo) + c.Assert(err, check.ErrorMatches, `.* requested URL returned error.*`) + } +} + func (s *IntegrationSuite) SetUpSuite(c *check.C) { arvadostest.StartAPI() } +func (s *IntegrationSuite) TearDownSuite(c *check.C) { + arvadostest.StopAPI() +} + func (s *IntegrationSuite) SetUpTest(c *check.C) { arvadostest.ResetEnv() s.testServer = &server{} @@ -118,7 +136,7 @@ func (s *IntegrationSuite) SetUpTest(c *check.C) { c.Assert(err, check.Equals, nil) theConfig = &config{ - Addr: ":", + Addr: ":0", GitCommand: "/usr/bin/git", Root: s.tmpRepoRoot, }