X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/bfdecdcaf7dbeabfacc0efefb864e0024dbef9ab..f11933fe893204fc0378d83b25167eb14ba4a265:/tools/keep-block-check/keep-block-check_test.go diff --git a/tools/keep-block-check/keep-block-check_test.go b/tools/keep-block-check/keep-block-check_test.go index d973e06027..5bd7136eaa 100644 --- a/tools/keep-block-check/keep-block-check_test.go +++ b/tools/keep-block-check/keep-block-check_test.go @@ -48,6 +48,7 @@ func (s *ServerRequiredSuite) TearDownSuite(c *C) { } func (s *ServerRequiredSuite) SetUpTest(c *C) { + logBuffer.Reset() logOutput := io.MultiWriter(&logBuffer) log.SetOutput(logOutput) } @@ -55,7 +56,7 @@ func (s *ServerRequiredSuite) SetUpTest(c *C) { func (s *ServerRequiredSuite) TearDownTest(c *C) { arvadostest.StopKeep(2) log.SetOutput(os.Stdout) - log.Printf("%v", logBuffer.String()) + c.Log(logBuffer.String()) } func (s *DoMainTestSuite) SetUpSuite(c *C) { @@ -118,7 +119,6 @@ func setupConfigFile(c *C, fileName string) string { fileContent += "ARVADOS_API_TOKEN=" + arvadostest.DataManagerToken + "\n" fileContent += "\n" fileContent += "ARVADOS_API_HOST_INSECURE=" + os.Getenv("ARVADOS_API_HOST_INSECURE") + "\n" - fileContent += " ARVADOS_EXTERNAL_CLIENT = false \n" fileContent += " NotANameValuePairAndShouldGetIgnored \n" fileContent += "ARVADOS_BLOB_SIGNING_KEY=abcdefg\n" @@ -227,7 +227,9 @@ func (s *ServerRequiredSuite) TestBlockCheck_BadSignature(c *C) { setupTestData(c) err := performKeepBlockCheck(kc, blobSignatureTTL, "badblobsigningkey", []string{TestHash, TestHash2}, false) c.Assert(err.Error(), Equals, "Block verification failed for 2 out of 2 blocks with matching prefix") - checkErrorLog(c, []string{TestHash, TestHash2}, "Error verifying block", "HTTP 403") + // older versions of keepstore return 403 Forbidden for + // invalid signatures, newer versions return 400 Bad Request. + checkErrorLog(c, []string{TestHash, TestHash2}, "Error verifying block", "HTTP 40[03]") // verbose logging not requested c.Assert(strings.Contains(logBuffer.String(), "Verifying block 1 of 2"), Equals, false) } @@ -291,7 +293,6 @@ func (s *ServerRequiredSuite) TestLoadConfig(c *C) { c.Assert(config.APIHost, Equals, os.Getenv("ARVADOS_API_HOST")) c.Assert(config.APIToken, Equals, arvadostest.DataManagerToken) c.Assert(config.APIHostInsecure, Equals, arvadosclient.StringBool(os.Getenv("ARVADOS_API_HOST_INSECURE"))) - c.Assert(config.ExternalClient, Equals, false) c.Assert(blobSigningKey, Equals, "abcdefg") }