X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/bcad695db9a1c3aac5807faa153086e653107f51..86660414472d4ff0d8267f9845a753497bd41692:/lib/config/load_test.go diff --git a/lib/config/load_test.go b/lib/config/load_test.go index 256e8a3e8c..a19400c191 100644 --- a/lib/config/load_test.go +++ b/lib/config/load_test.go @@ -238,7 +238,7 @@ Clusters: InternalURLs: "http://host.example:12345": {} Volumes: - zzzzz-nyw5e-aaaaaaaaaaaaaaa: {} + zzzzz-nyw5e-aaaaaaaaaaaaaaa: {Replication: 2} `, &logbuf).Load() c.Assert(err, check.IsNil) c.Log(logbuf.String()) @@ -407,7 +407,7 @@ Clusters: if v != nil { c.Logf("%#v", v.Clusters) } - c.Check(err, check.ErrorMatches, `.*cluster ID should be 5 alphanumeric characters.*`) + c.Check(err, check.ErrorMatches, `.*cluster ID should be 5 lowercase alphanumeric characters.*`) } } @@ -651,6 +651,31 @@ Clusters: c.Check(cc.InstanceTypes["a"].VCPUs, check.Equals, 9) } +func (s *LoadSuite) TestWarnUnusedLocalKeep(c *check.C) { + var logbuf bytes.Buffer + _, err := testLoader(c, ` +Clusters: + z1111: + Volumes: + z: + Replication: 1 +`, &logbuf).Load() + c.Assert(err, check.IsNil) + c.Check(logbuf.String(), check.Matches, `(?ms).*LocalKeepBlobBuffersPerVCPU is 1 but will not be used because at least one volume \(z\) has lower replication than DefaultReplication \(1 < 2\) -- suggest changing to 0.*`) + + logbuf.Reset() + _, err = testLoader(c, ` +Clusters: + z1111: + Volumes: + z: + AccessViaHosts: + "http://0.0.0.0:12345": {} +`, &logbuf).Load() + c.Assert(err, check.IsNil) + c.Check(logbuf.String(), check.Matches, `(?ms).*LocalKeepBlobBuffersPerVCPU is 1 but will not be used because at least one volume \(z\) uses AccessViaHosts -- suggest changing to 0.*`) +} + func (s *LoadSuite) TestImplicitStorageClasses(c *check.C) { // If StorageClasses and Volumes.*.StorageClasses are all // empty, there is a default storage class named "default".