X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1267366d66cadcc09972721bf7381f96f8fe73d6..18d976b4701d76bdeb05e0fe3c1757060d3b8a2a:/lib/config/deprecated_keepstore_test.go diff --git a/lib/config/deprecated_keepstore_test.go b/lib/config/deprecated_keepstore_test.go index d1028e8bd0..ff1d8be7bd 100644 --- a/lib/config/deprecated_keepstore_test.go +++ b/lib/config/deprecated_keepstore_test.go @@ -17,8 +17,8 @@ import ( "text/template" "time" - "git.curoverse.com/arvados.git/sdk/go/arvados" - "git.curoverse.com/arvados.git/sdk/go/arvadostest" + "git.arvados.org/arvados.git/sdk/go/arvados" + "git.arvados.org/arvados.git/sdk/go/arvadostest" check "gopkg.in/check.v1" ) @@ -30,6 +30,10 @@ type KeepstoreMigrationSuite struct { var _ = check.Suite(&KeepstoreMigrationSuite{}) func (s *KeepstoreMigrationSuite) SetUpSuite(c *check.C) { + os.Setenv("ARVADOS_API_HOST", os.Getenv("ARVADOS_TEST_API_HOST")) + os.Setenv("ARVADOS_API_HOST_INSECURE", "1") + os.Setenv("ARVADOS_API_TOKEN", arvadostest.AdminToken) + // We don't need the keepstore servers, but we do need // keep_services listings that point to localhost, rather than // the apiserver fixtures that point to fictional hosts @@ -105,7 +109,7 @@ Clusters: TLS: {Insecure: true} Services: Controller: - ExternalURL: "https://`+os.Getenv("ARVADOS_API_HOST")+`" + ExternalURL: "https://`+os.Getenv("ARVADOS_API_HOST")+`/" `, ` Clusters: z1111: @@ -116,7 +120,7 @@ Clusters: InternalURLs: "http://`+hostname+`:25107": {Rendezvous: `+s.ksByPort[25107].UUID[12:]+`} Controller: - ExternalURL: "https://`+os.Getenv("ARVADOS_API_HOST")+`" + ExternalURL: "https://`+os.Getenv("ARVADOS_API_HOST")+`/" SystemLogs: Format: text LogLevel: debug @@ -221,8 +225,8 @@ Volumes: Driver: "S3", Replication: 4, }, &arvados.S3VolumeDriverParameters{ - AccessKey: "accesskeydata", - SecretKey: "secretkeydata", + AccessKeyID: "accesskeydata", + SecretAccessKey: "secretkeydata", Endpoint: "https://storage.googleapis.com", Region: "us-east-1z", Bucket: "testbucket", @@ -250,7 +254,7 @@ Volumes: ReadOnly: true StorageAccountName: storageacctname StorageAccountKeyFile: `+secretkeyfile.Name()+` - StorageBaseURL: https://example.example + StorageBaseURL: https://example.example/ ContainerName: testctr LocationConstraint: true AzureReplication: 4 @@ -264,7 +268,7 @@ Volumes: }, &arvados.AzureVolumeDriverParameters{ StorageAccountName: "storageacctname", StorageAccountKey: "secretkeydata", - StorageBaseURL: "https://example.example", + StorageBaseURL: "https://example.example/", ContainerName: "testctr", RequestTimeout: arvados.Duration(time.Minute * 3), ListBlobsRetryDelay: arvados.Duration(time.Minute * 4), @@ -329,7 +333,7 @@ func (s *KeepstoreMigrationSuite) testDeprecatedVolume(c *check.C, oldconfigdata c.Check(v.Driver, check.Equals, expectvol.Driver) c.Check(v.Replication, check.Equals, expectvol.Replication) - avh, ok := v.AccessViaHosts[arvados.URL{Scheme: "http", Host: hostname + ":12345"}] + avh, ok := v.AccessViaHosts[arvados.URL{Scheme: "http", Host: hostname + ":12345", Path: "/"}] c.Check(ok, check.Equals, true) c.Check(avh.ReadOnly, check.Equals, expectvol.ReadOnly) @@ -512,6 +516,7 @@ Volumes: url := arvados.URL{ Scheme: "http", Host: fmt.Sprintf("%s:%d", hostname, port), + Path: "/", } _, ok := before["zzzzz-nyw5e-readonlyonother"].AccessViaHosts[url] c.Check(ok, check.Equals, false) @@ -539,6 +544,7 @@ Volumes: url := arvados.URL{ Scheme: "http", Host: fmt.Sprintf("%s:%d", hostname, port), + Path: "/", } _, ok := before["zzzzz-nyw5e-writableonother"].AccessViaHosts[url] c.Check(ok, check.Equals, false) @@ -568,7 +574,7 @@ Volumes: hostname, err := os.Hostname() c.Assert(err, check.IsNil) - _, ok := newvol.AccessViaHosts[arvados.URL{Scheme: "http", Host: fmt.Sprintf("%s:%d", hostname, port)}] + _, ok := newvol.AccessViaHosts[arvados.URL{Scheme: "http", Host: fmt.Sprintf("%s:%d", hostname, port), Path: "/"}] c.Check(ok, check.Equals, true) } @@ -597,7 +603,7 @@ Volumes: c.Check(logs, check.Matches, `(?ms).*you should remove the legacy keepstore config file.*`) c.Check(logs, check.Matches, `(?ms).*you should migrate the legacy keepstore configuration file on host keep1.zzzzz.example.com.*`) c.Check(logs, check.Not(check.Matches), `(?ms).*should migrate.*keep0.zzzzz.example.com.*`) - c.Check(logs, check.Matches, `(?ms).*keepstore configured at http://keep2.zzzzz.example.com:25107 does not have access to any volumes.*`) + c.Check(logs, check.Matches, `(?ms).*keepstore configured at http://keep2.zzzzz.example.com:25107/ does not have access to any volumes.*`) c.Check(logs, check.Matches, `(?ms).*Volumes.zzzzz-nyw5e-possconfigerror.AccessViaHosts refers to nonexistent keepstore server http://keep00.zzzzz.example.com:25107.*`) }