15014: Hide busy/idle nodes panel when crunch1 is not active.
[arvados.git] / lib / config / deprecated_test.go
index 76313ebb1615885298b3c8109ea73515fcfa8f2f..ea9b50d035483ab7fd0463669ab4dfda591bdc3f 100644 (file)
@@ -47,7 +47,7 @@ func testLoadLegacyConfig(content []byte, mungeFlag string, c *check.C) (*arvado
 func (s *LoadSuite) TestDeprecatedNodeProfilesToServices(c *check.C) {
        hostname, err := os.Hostname()
        c.Assert(err, check.IsNil)
-       s.checkEquivalent(c, `
+       checkEquivalent(c, `
 Clusters:
  z1111:
   NodeProfiles:
@@ -187,3 +187,32 @@ func fmtKeepproxyConfig(param string, debugLog bool) string {
 }
 `, debugLog, param)
 }
+
+func (s *LoadSuite) TestLegacyArvGitHttpdConfig(c *check.C) {
+       content := []byte(`
+{
+       "Client": {
+               "Scheme": "",
+               "APIHost": "example.com",
+               "AuthToken": "abcdefg",
+       },
+       "Listen": ":9000",
+       "GitCommand": "/test/git",
+       "GitoliteHome": "/test/gitolite",
+       "RepoRoot": "/test/reporoot",
+       "ManagementToken": "xyzzy"
+}
+`)
+       f := "-legacy-git-httpd-config"
+       cluster, err := testLoadLegacyConfig(content, f, c)
+
+       c.Check(err, check.IsNil)
+       c.Check(cluster, check.NotNil)
+       c.Check(cluster.Services.Controller.ExternalURL, check.Equals, arvados.URL{Scheme: "https", Host: "example.com"})
+       c.Check(cluster.SystemRootToken, check.Equals, "abcdefg")
+       c.Check(cluster.ManagementToken, check.Equals, "xyzzy")
+       c.Check(cluster.Git.GitCommand, check.Equals, "/test/git")
+       c.Check(cluster.Git.GitoliteHome, check.Equals, "/test/gitolite")
+       c.Check(cluster.Git.Repositories, check.Equals, "/test/reporoot")
+       c.Check(cluster.Services.Keepproxy.InternalURLs[arvados.URL{Host: ":9000"}], check.Equals, arvados.ServiceInstance{})
+}