serverconfig: fix secring path for update_golden.

Also regenerated the golden config files.

Change-Id: Id87dcad5f85b060eeee477e1fd3c72bff93d3d5e
This commit is contained in:
Bill Thiede 2013-11-24 20:38:00 -08:00
parent fd122a5de6
commit 6b9f81e3f8
11 changed files with 16 additions and 11 deletions

View File

@ -37,6 +37,8 @@ import (
var updateGolden = flag.Bool("update_golden", false, "Update golden *.want files")
const secringPlaceholder = "/path/to/secring"
func init() {
// Avoid Linux vs. OS X differences in tests.
serverconfig.SetTempDirFunc(func() string { return "/tmp" })
@ -99,7 +101,7 @@ func configParser() *jsonconfig.ConfigParser {
if err != nil {
return nil, err
}
slurp := strings.Replace(string(slurpBytes), "/path/to/secring", secRing, 1)
slurp := strings.Replace(string(slurpBytes), secringPlaceholder, secRing, 1)
return namedReadSeeker{path, strings.NewReader(slurp)}, nil
},
}
@ -142,6 +144,9 @@ func testConfig(name string, t *testing.T) {
if err != nil {
t.Fatal(err)
}
secRing, err := filepath.Abs("../jsonsign/testdata/test-secring.gpg")
contents = bytes.Replace(contents, []byte(secRing),
[]byte(secringPlaceholder), 1)
if err := ioutil.WriteFile(wantFile, contents, 0644); err != nil {
t.Fatal(err)
}

View File

@ -74,7 +74,7 @@
"handlerArgs": {
"keyId": "26F5ABDA",
"publicKeyDest": "/bs-and-index/",
"secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg"
"secretRing": "/path/to/secring"
}
},
"/status/": {

View File

@ -73,7 +73,7 @@
"handlerArgs": {
"keyId": "26F5ABDA",
"publicKeyDest": "/bs-and-index/",
"secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg"
"secretRing": "/path/to/secring"
}
},
"/status/": {

View File

@ -72,7 +72,7 @@
"handlerArgs": {
"keyId": "26F5ABDA",
"publicKeyDest": "/bs-and-index/",
"secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg"
"secretRing": "/path/to/secring"
}
},
"/status/": {

View File

@ -72,7 +72,7 @@
"handlerArgs": {
"keyId": "26F5ABDA",
"publicKeyDest": "/bs-and-index/",
"secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg"
"secretRing": "/path/to/secring"
}
},
"/status/": {

View File

@ -77,7 +77,7 @@
"handlerArgs": {
"keyId": "26F5ABDA",
"publicKeyDest": "/bs-and-index/",
"secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg"
"secretRing": "/path/to/secring"
}
},
"/status/": {

View File

@ -72,7 +72,7 @@
"handlerArgs": {
"keyId": "26F5ABDA",
"publicKeyDest": "/bs-and-index/",
"secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg"
"secretRing": "/path/to/secring"
}
},
"/status/": {

View File

@ -73,7 +73,7 @@
"handlerArgs": {
"keyId": "26F5ABDA",
"publicKeyDest": "/bs-and-index/",
"secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg"
"secretRing": "/path/to/secring"
}
},
"/status/": {

View File

@ -89,7 +89,7 @@
"handlerArgs": {
"keyId": "26F5ABDA",
"publicKeyDest": "/bs-and-index/",
"secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg"
"secretRing": "/path/to/secring"
}
},
"/status/": {

View File

@ -92,7 +92,7 @@
"handlerArgs": {
"keyId": "26F5ABDA",
"publicKeyDest": "/bs-and-index/",
"secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg"
"secretRing": "/path/to/secring"
}
},
"/status/": {

View File

@ -71,7 +71,7 @@
"handlerArgs": {
"keyId": "26F5ABDA",
"publicKeyDest": "/bs-and-index/",
"secretRing": "/Users/bradfitz/src/camlistore.org/pkg/jsonsign/testdata/test-secring.gpg"
"secretRing": "/path/to/secring"
}
},
"/status/": {