19166: Fix logging noise in test suite.
[arvados.git] / lib / crunchrun / integration_test.go
index 3f7c7e50f14f7713c0de4885f0cae4fd64ab11f8..a18829f30d24d8a66673b8ed1fa073124eb13518 100644 (file)
@@ -224,13 +224,25 @@ func (s *integrationSuite) TestRunTrivialContainerWithLocalKeepstore(c *C) {
                        c.Check(log, trial.matchPutReq, `(?ms).*"reqMethod":"PUT".*,"reqPath":"0e3bcff26d51c895a60ea0d4585e134d".*`)
                }
        }
+}
 
+func (s *integrationSuite) TestRunTrivialContainerWithNoLocalKeepstore(c *C) {
        // Check that (1) config is loaded from $ARVADOS_CONFIG when
        // not provided on stdin and (2) if a local keepstore is not
        // started, crunch-run.txt explains why not.
        s.SetUpTest(c)
        s.stdin.Reset()
        s.testRunTrivialContainer(c)
+       c.Check(s.logFiles["crunch-run.txt"], Matches, `(?ms).*not starting a local keepstore process because KeepBuffers=0 in config\n.*`)
+
+       s.SetUpTest(c)
+       s.args = []string{"-config", c.MkDir() + "/config.yaml"}
+       s.stdin.Reset()
+       buf, err := ioutil.ReadFile(os.Getenv("ARVADOS_CONFIG"))
+       c.Assert(err, IsNil)
+       err = ioutil.WriteFile(s.args[1], bytes.Replace(buf, []byte("LocalKeepBlobBuffersPerVCPU: 0"), []byte("LocalKeepBlobBuffersPerVCPU: 1"), -1), 0666)
+       c.Assert(err, IsNil)
+       s.testRunTrivialContainer(c)
        c.Check(s.logFiles["crunch-run.txt"], Matches, `(?ms).*not starting a local keepstore process because a volume \(zzzzz-nyw5e-00000000000000\d\) uses AccessViaHosts\n.*`)
 
        // Check that config read errors are logged
@@ -243,7 +255,7 @@ func (s *integrationSuite) TestRunTrivialContainerWithLocalKeepstore(c *C) {
        s.SetUpTest(c)
        s.args = []string{"-config", c.MkDir() + "/config-unreadable.yaml"}
        s.stdin.Reset()
-       err := ioutil.WriteFile(s.args[1], []byte{}, 0)
+       err = ioutil.WriteFile(s.args[1], []byte{}, 0)
        c.Check(err, IsNil)
        s.testRunTrivialContainer(c)
        c.Check(s.logFiles["crunch-run.txt"], Matches, `(?ms).*could not load config file \Q`+s.args[1]+`\E:.* permission denied\n.*`)