mirror of https://github.com/perkeep/perkeep.git
serverconfig: fix secring path for update_golden.
Also regenerated the golden config files. Change-Id: Id87dcad5f85b060eeee477e1fd3c72bff93d3d5e
This commit is contained in:
parent
fd122a5de6
commit
6b9f81e3f8
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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/": {
|
||||
|
|
|
@ -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/": {
|
||||
|
|
|
@ -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/": {
|
||||
|
|
|
@ -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/": {
|
||||
|
|
|
@ -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/": {
|
||||
|
|
|
@ -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/": {
|
||||
|
|
|
@ -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/": {
|
||||
|
|
|
@ -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/": {
|
||||
|
|
|
@ -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/": {
|
||||
|
|
|
@ -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/": {
|
||||
|
|
Loading…
Reference in New Issue