X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9b91a7c2e783595b168a5aa101b4313f9dcce65e..44c95f99098fa6c6acbfa82d4b6cbc6015eb6e39:/sdk/go/arvadosclient/arvadosclient_test.go diff --git a/sdk/go/arvadosclient/arvadosclient_test.go b/sdk/go/arvadosclient/arvadosclient_test.go index f2fd0b1b33..372f09d14b 100644 --- a/sdk/go/arvadosclient/arvadosclient_test.go +++ b/sdk/go/arvadosclient/arvadosclient_test.go @@ -1,14 +1,19 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + package arvadosclient import ( "fmt" - "git.curoverse.com/arvados.git/sdk/go/arvadostest" - . "gopkg.in/check.v1" "net" "net/http" "os" "testing" "time" + + "git.curoverse.com/arvados.git/sdk/go/arvadostest" + . "gopkg.in/check.v1" ) // Gocheck boilerplate @@ -29,27 +34,32 @@ func (s *ServerRequiredSuite) SetUpSuite(c *C) { RetryDelay = 0 } +func (s *ServerRequiredSuite) TearDownSuite(c *C) { + arvadostest.StopKeep(2) + arvadostest.StopAPI() +} + func (s *ServerRequiredSuite) SetUpTest(c *C) { arvadostest.ResetEnv() } func (s *ServerRequiredSuite) TestMakeArvadosClientSecure(c *C) { os.Setenv("ARVADOS_API_HOST_INSECURE", "") - kc, err := MakeArvadosClient() + ac, err := MakeArvadosClient() c.Assert(err, Equals, nil) - c.Check(kc.ApiServer, Equals, os.Getenv("ARVADOS_API_HOST")) - c.Check(kc.ApiToken, Equals, os.Getenv("ARVADOS_API_TOKEN")) - c.Check(kc.ApiInsecure, Equals, false) + c.Check(ac.ApiServer, Equals, os.Getenv("ARVADOS_API_HOST")) + c.Check(ac.ApiToken, Equals, os.Getenv("ARVADOS_API_TOKEN")) + c.Check(ac.ApiInsecure, Equals, false) } func (s *ServerRequiredSuite) TestMakeArvadosClientInsecure(c *C) { os.Setenv("ARVADOS_API_HOST_INSECURE", "true") - kc, err := MakeArvadosClient() + ac, err := MakeArvadosClient() c.Assert(err, Equals, nil) - c.Check(kc.ApiInsecure, Equals, true) - c.Check(kc.ApiServer, Equals, os.Getenv("ARVADOS_API_HOST")) - c.Check(kc.ApiToken, Equals, os.Getenv("ARVADOS_API_TOKEN")) - c.Check(kc.Client.Transport.(*http.Transport).TLSClientConfig.InsecureSkipVerify, Equals, true) + c.Check(ac.ApiInsecure, Equals, true) + c.Check(ac.ApiServer, Equals, os.Getenv("ARVADOS_API_HOST")) + c.Check(ac.ApiToken, Equals, os.Getenv("ARVADOS_API_TOKEN")) + c.Check(ac.Client.Transport.(*http.Transport).TLSClientConfig.InsecureSkipVerify, Equals, true) } func (s *ServerRequiredSuite) TestGetInvalidUUID(c *C) { @@ -163,7 +173,7 @@ func (s *ServerRequiredSuite) TestErrorResponse(c *C) { Dict{"log": Dict{"bogus_attr": "foo"}}, &getback) c.Assert(err, ErrorMatches, "arvados API server error: .*") - c.Assert(err, ErrorMatches, ".*unknown attribute: bogus_attr.*") + c.Assert(err, ErrorMatches, ".*unknown attribute(: | ')bogus_attr.*") c.Assert(err, FitsTypeOf, APIServerError{}) c.Assert(err.(APIServerError).HttpStatusCode, Equals, 422) }