func mustBeOld(t *testing.T, paths ...string) {
for _, p := range paths {
i, err := os.Stat(p)
func mustBeOld(t *testing.T, paths ...string) {
for _, p := range paths {
i, err := os.Stat(p)
"status code 404")
mustNotExist(t, statePath, plainPath, groupPath)
"status code 404")
mustNotExist(t, statePath, plainPath, groupPath)
"status code 304 but did not send If-Modified-Since")
mustNotExist(t, statePath, plainPath, groupPath)
"status code 304 but did not send If-Modified-Since")
mustNotExist(t, statePath, plainPath, groupPath)
statePath+": permission denied")
mustNotExist(t, passwdPath, plainPath, groupPath)
statePath+": permission denied")
mustNotExist(t, passwdPath, plainPath, groupPath)
err = mainFetch(configPath)
mustBeErrorWithSubstring(t, err,
"file[0].username/passsword in use and unsafe permissions "+
err = mainFetch(configPath)
mustBeErrorWithSubstring(t, err,
"file[0].username/passsword in use and unsafe permissions "+
mustNotExist(t, statePath, groupPath, plainPath)
mustBeOld(t, passwdPath)
mustNotExist(t, statePath, groupPath, plainPath)
mustBeOld(t, passwdPath)