Example #1
0
func (s *ManifoldSuite) TestUnit(c *gc.C) {
	config := proxyup.ManifoldConfig(workertesting.PostUpgradeManifoldTestConfig())
	_, err := workertesting.RunPostUpgradeManifold(
		proxyup.Manifold(config),
		&fakeAgent{tag: names.NewUnitTag("foo/0")},
		nil)
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(s.newCalled, jc.IsTrue)
}
Example #2
0
func (s *ManifoldSuite) TestNonAgent(c *gc.C) {
	config := proxyup.ManifoldConfig(workertesting.PostUpgradeManifoldTestConfig())
	_, err := workertesting.RunPostUpgradeManifold(
		proxyup.Manifold(config),
		&fakeAgent{tag: names.NewUserTag("foo")},
		nil)
	c.Assert(err, gc.ErrorMatches, "unknown agent type:.+")
	c.Assert(s.newCalled, jc.IsFalse)
}
Example #3
0
func (s *ManifoldSuite) TestMachineShouldntWrite(c *gc.C) {
	config := proxyup.ManifoldConfig(workertesting.AgentApiManifoldTestConfig())
	_, err := workertesting.RunAgentApiManifold(
		proxyup.Manifold(config),
		&fakeAgent{tag: names.NewMachineTag("42")},
		nil)
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(s.newCalled, jc.IsTrue)
}