diff --git a/pkg/serverconfig/serverconfig_test.go b/pkg/serverconfig/serverconfig_test.go index eb2085dd0..2ce175bd8 100644 --- a/pkg/serverconfig/serverconfig_test.go +++ b/pkg/serverconfig/serverconfig_test.go @@ -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) } diff --git a/pkg/serverconfig/testdata/baseurl-want.json b/pkg/serverconfig/testdata/baseurl-want.json index 83837503b..9a9a7d404 100644 --- a/pkg/serverconfig/testdata/baseurl-want.json +++ b/pkg/serverconfig/testdata/baseurl-want.json @@ -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/": { diff --git a/pkg/serverconfig/testdata/default-want.json b/pkg/serverconfig/testdata/default-want.json index ae5256f32..fa0e99272 100644 --- a/pkg/serverconfig/testdata/default-want.json +++ b/pkg/serverconfig/testdata/default-want.json @@ -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/": { diff --git a/pkg/serverconfig/testdata/listenbase-want.json b/pkg/serverconfig/testdata/listenbase-want.json index 2ad3e5246..6fa1f708b 100644 --- a/pkg/serverconfig/testdata/listenbase-want.json +++ b/pkg/serverconfig/testdata/listenbase-want.json @@ -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/": { diff --git a/pkg/serverconfig/testdata/mem-want.json b/pkg/serverconfig/testdata/mem-want.json index 70a667361..4b566875b 100644 --- a/pkg/serverconfig/testdata/mem-want.json +++ b/pkg/serverconfig/testdata/mem-want.json @@ -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/": { diff --git a/pkg/serverconfig/testdata/mongo-want.json b/pkg/serverconfig/testdata/mongo-want.json index 98dab8852..93b3a4fc5 100644 --- a/pkg/serverconfig/testdata/mongo-want.json +++ b/pkg/serverconfig/testdata/mongo-want.json @@ -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/": { diff --git a/pkg/serverconfig/testdata/sqlite-want.json b/pkg/serverconfig/testdata/sqlite-want.json index 479d40f60..cc92349f5 100644 --- a/pkg/serverconfig/testdata/sqlite-want.json +++ b/pkg/serverconfig/testdata/sqlite-want.json @@ -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/": { diff --git a/pkg/serverconfig/testdata/tls-want.json b/pkg/serverconfig/testdata/tls-want.json index b221a0c86..2c29c6974 100644 --- a/pkg/serverconfig/testdata/tls-want.json +++ b/pkg/serverconfig/testdata/tls-want.json @@ -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/": { diff --git a/pkg/serverconfig/testdata/with_blog-want.json b/pkg/serverconfig/testdata/with_blog-want.json index 57b8c5630..ac748a486 100644 --- a/pkg/serverconfig/testdata/with_blog-want.json +++ b/pkg/serverconfig/testdata/with_blog-want.json @@ -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/": { diff --git a/pkg/serverconfig/testdata/with_gallery-want.json b/pkg/serverconfig/testdata/with_gallery-want.json index 8b104e10c..65d13630d 100644 --- a/pkg/serverconfig/testdata/with_gallery-want.json +++ b/pkg/serverconfig/testdata/with_gallery-want.json @@ -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/": { diff --git a/pkg/serverconfig/testdata/with_sourceroot-want.json b/pkg/serverconfig/testdata/with_sourceroot-want.json index 87e79056a..fa1b83251 100644 --- a/pkg/serverconfig/testdata/with_sourceroot-want.json +++ b/pkg/serverconfig/testdata/with_sourceroot-want.json @@ -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/": {