(t *testing.T)
| 247 | } |
| 248 | |
| 249 | func TestExpansionsInHighlevelConfig(t *testing.T) { |
| 250 | srcRoot, err := osutil.PkSourceRoot() |
| 251 | if err != nil { |
| 252 | t.Fatalf("source root folder not found: %v", err) |
| 253 | } |
| 254 | const keyID = "26F5ABDA" |
| 255 | t.Setenv("TMP_EXPANSION_TEST", keyID) |
| 256 | t.Setenv("TMP_EXPANSION_SECRING", filepath.Join(srcRoot, filepath.FromSlash("pkg/jsonsign/testdata/test-secring.gpg"))) |
| 257 | // Setting CAMLI_CONFIG_DIR to avoid triggering failInTests in osutil.PerkeepConfigDir |
| 258 | t.Setenv("CAMLI_CONFIG_DIR", "whatever") |
| 259 | conf, err := serverinit.Load([]byte(` |
| 260 | { |
| 261 | "auth": "localhost", |
| 262 | "listen": ":4430", |
| 263 | "https": false, |
| 264 | "identity": ["_env", "${TMP_EXPANSION_TEST}"], |
| 265 | "identitySecretRing": ["_env", "${TMP_EXPANSION_SECRING}"], |
| 266 | "googlecloudstorage": ":camlistore-dev-blobs", |
| 267 | "kvIndexFile": "/tmp/camli-index.kvdb" |
| 268 | } |
| 269 | `)) |
| 270 | if err != nil { |
| 271 | t.Fatal(err) |
| 272 | } |
| 273 | got := fmt.Sprintf("%#v", conf) |
| 274 | if !strings.Contains(got, keyID) { |
| 275 | t.Errorf("Expected key %s in resulting low-level config. Got: %s", keyID, got) |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | func TestInstallHandlers(t *testing.T) { |
| 280 | srcRoot, err := osutil.PkSourceRoot() |
nothing calls this directly
no test coverage detected