Exemplo n.º 1
0
func (s *migrateLocalProviderAgentConfigSuite) TestIdempotent(c *gc.C) {
	s.primeConfig(c, s.State, state.JobManageEnviron, "machine-0")
	err := upgrades.MigrateLocalProviderAgentConfig(s.ctx)
	c.Assert(err, gc.IsNil)
	err = s.config.Write()
	c.Assert(err, gc.IsNil)
	s.assertConfigProcessed(c)

	err = upgrades.MigrateLocalProviderAgentConfig(s.ctx)
	c.Assert(err, gc.IsNil)
	err = s.config.Write()
	c.Assert(err, gc.IsNil)
	s.assertConfigProcessed(c)
}
Exemplo n.º 2
0
func (s *migrateLocalProviderAgentConfigSuite) TestMigrateWithoutStateConnectionNotDone(c *gc.C) {
	s.primeConfig(c, nil, state.JobManageEnviron, "machine-0")
	err := upgrades.MigrateLocalProviderAgentConfig(s.ctx)
	c.Assert(err, gc.IsNil)
	err = s.config.Write()
	c.Assert(err, gc.IsNil)
	s.assertConfigNotProcessed(c)
}
Exemplo n.º 3
0
func (s *migrateLocalProviderAgentConfigSuite) TestMigrateNonLocalEnvNotDone(c *gc.C) {
	s.PatchValue(upgrades.IsLocalEnviron, func(_ *config.Config) bool { return false })
	s.primeConfig(c, s.State, state.JobManageEnviron, "machine-0")
	err := upgrades.MigrateLocalProviderAgentConfig(s.ctx)
	c.Assert(err, gc.IsNil)
	err = s.config.Write()
	c.Assert(err, gc.IsNil)
	s.assertConfigNotProcessed(c)
}