projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
20522: Load dispatch key from file if configured as file:///...
[arvados.git]
/
lib
/
config
/
export_test.go
diff --git
a/lib/config/export_test.go
b/lib/config/export_test.go
index e12fbdc7f6aa65ed3f181374aca15f932f2ff0da..f11b65f452b797a0cbe05720f29c51343baa7779 100644
(file)
--- a/
lib/config/export_test.go
+++ b/
lib/config/export_test.go
@@
-17,14
+17,15
@@
var _ = check.Suite(&ExportSuite{})
type ExportSuite struct{}
func (s *ExportSuite) TestExport(c *check.C) {
type ExportSuite struct{}
func (s *ExportSuite) TestExport(c *check.C) {
- confdata := strings.Replace(string(DefaultYAML), "SAMPLE", "
testkey
", -1)
+ confdata := strings.Replace(string(DefaultYAML), "SAMPLE", "
12345
", -1)
cfg, err := testLoader(c, confdata, nil).Load()
c.Assert(err, check.IsNil)
cfg, err := testLoader(c, confdata, nil).Load()
c.Assert(err, check.IsNil)
- cluster := cfg.Clusters["xxxxx"]
+ cluster, err := cfg.GetCluster("xxxxx")
+ c.Assert(err, check.IsNil)
cluster.ManagementToken = "abcdefg"
var exported bytes.Buffer
cluster.ManagementToken = "abcdefg"
var exported bytes.Buffer
- err = ExportJSON(&exported,
&
cluster)
+ err = ExportJSON(&exported, cluster)
c.Check(err, check.IsNil)
if err != nil {
c.Logf("If all the new keys are safe, add these to whitelist in export.go:")
c.Check(err, check.IsNil)
if err != nil {
c.Logf("If all the new keys are safe, add these to whitelist in export.go:")
@@
-32,5
+33,7
@@
func (s *ExportSuite) TestExport(c *check.C) {
c.Logf("\t%q: true,", strings.Replace(k, `"`, "", -1))
}
}
c.Logf("\t%q: true,", strings.Replace(k, `"`, "", -1))
}
}
- c.Check(exported.String(), check.Not(check.Matches), `(?ms).*abcdefg.*`)
+ var exportedStr = exported.String()
+ c.Check(exportedStr, check.Matches, `(?ms).*ClusterID":"xxxxx.*`)
+ c.Check(exportedStr, check.Not(check.Matches), `(?ms).*abcdefg.*`)
}
}