mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 19:05:42 +03:00
fix up test for file content changes
This commit is contained in:
@@ -982,10 +982,22 @@ func TestServer_ShouldReload_ReturnTrueForFileChanges(t *testing.T) {
|
||||
-----END CERTIFICATE-----
|
||||
`
|
||||
|
||||
err = ioutil.WriteFile(tmpfn, []byte(newCertificate), 0644)
|
||||
os.Remove(tmpfn)
|
||||
err = ioutil.WriteFile(tmpfn, []byte(newCertificate), 0666)
|
||||
require.Nil(err)
|
||||
|
||||
shouldReloadAgent, shouldReloadHTTP, shouldReloadRPC = agent.ShouldReload(agentConfig)
|
||||
newAgentConfig := &Config{
|
||||
TLSConfig: &sconfig.TLSConfig{
|
||||
EnableHTTP: true,
|
||||
EnableRPC: true,
|
||||
VerifyServerHostname: true,
|
||||
CAFile: cafile,
|
||||
CertFile: tmpfn,
|
||||
KeyFile: key,
|
||||
},
|
||||
}
|
||||
|
||||
shouldReloadAgent, shouldReloadHTTP, shouldReloadRPC = agent.ShouldReload(newAgentConfig)
|
||||
require.True(shouldReloadAgent)
|
||||
require.True(shouldReloadHTTP)
|
||||
require.True(shouldReloadRPC)
|
||||
|
||||
Reference in New Issue
Block a user