- err := s.runGit(c, "no-such-token-in-the-system", "fetch", repo)
- c.Assert(err, check.ErrorMatches, `.* 500 while accessing.*`)
- }
-}
-
-func (s *IntegrationSuite) SetUpSuite(c *check.C) {
- arvadostest.StartAPI()
-}
-
-func (s *IntegrationSuite) SetUpTest(c *check.C) {
- arvadostest.ResetEnv()
- s.testServer = &server{}
- var err error
- s.tmpRepoRoot, err = ioutil.TempDir("", "arv-git-httpd")
- c.Assert(err, check.Equals, nil)
- s.tmpWorkdir, err = ioutil.TempDir("", "arv-git-httpd")
- c.Assert(err, check.Equals, nil)
- _, err = exec.Command("git", "init", s.tmpRepoRoot+"/zzzzz-s0uqq-382brsig8rp3666").Output()
- c.Assert(err, check.Equals, nil)
- _, err = exec.Command("sh", "-c", "cd "+s.tmpRepoRoot+"/zzzzz-s0uqq-382brsig8rp3666 && echo test >test && git add test && git -c user.name=Foo -c user.email=Foo commit -am 'foo: test'").CombinedOutput()
- c.Assert(err, check.Equals, nil)
- _, err = exec.Command("git", "init", s.tmpWorkdir).Output()
- c.Assert(err, check.Equals, nil)
- _, err = exec.Command("sh", "-c", "cd "+s.tmpWorkdir+" && echo work >work && git add work && git -c user.name=Foo -c user.email=Foo commit -am 'workdir: test'").CombinedOutput()
- c.Assert(err, check.Equals, nil)
-
- _, err = exec.Command("git", "config",
- "--file", s.tmpWorkdir+"/.git/config",
- "credential.http://"+s.testServer.Addr+"/.helper",
- "!cred(){ cat >/dev/null; if [ \"$1\" = get ]; then echo password=$ARVADOS_API_TOKEN; fi; };cred").Output()
- c.Assert(err, check.Equals, nil)
- _, err = exec.Command("git", "config",
- "--file", s.tmpWorkdir+"/.git/config",
- "credential.http://"+s.testServer.Addr+"/.username",
- "none").Output()
- c.Assert(err, check.Equals, nil)
-
- theConfig = &config{
- Addr: ":",
- GitCommand: "/usr/bin/git",
- Root: s.tmpRepoRoot,