当前位置: 首页>>代码示例>>Golang>>正文


Golang migration.SourcePrecheck函数代码示例

本文整理汇总了Golang中github.com/juju/juju/migration.SourcePrecheck函数的典型用法代码示例。如果您正苦于以下问题:Golang SourcePrecheck函数的具体用法?Golang SourcePrecheck怎么用?Golang SourcePrecheck使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SourcePrecheck函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: TestControllerAgentVersionError

func (s *SourcePrecheckSuite) TestControllerAgentVersionError(c *gc.C) {
	backend := newFakeBackend()
	backend.controllerBackend.agentVersionErr = errors.New("boom")
	err := migration.SourcePrecheck(backend)
	c.Assert(err, gc.ErrorMatches, "controller: retrieving model version: boom")

}
开发者ID:bac,项目名称:juju,代码行数:7,代码来源:precheck_test.go

示例2: TestDyingControllerMachine

func (s *SourcePrecheckSuite) TestDyingControllerMachine(c *gc.C) {
	backend := &fakeBackend{
		controllerBackend: newBackendWithDyingMachine(),
	}
	err := migration.SourcePrecheck(backend)
	c.Assert(err, gc.ErrorMatches, "controller: machine 0 is dying")
}
开发者ID:bac,项目名称:juju,代码行数:7,代码来源:precheck_test.go

示例3: TestProvisioningControllerMachine

func (s *SourcePrecheckSuite) TestProvisioningControllerMachine(c *gc.C) {
	backend := &fakeBackend{
		controllerBackend: newBackendWithProvisioningMachine(),
	}
	err := migration.SourcePrecheck(backend)
	c.Assert(err.Error(), gc.Equals, "controller: machine 0 not running (allocating)")
}
开发者ID:bac,项目名称:juju,代码行数:7,代码来源:precheck_test.go

示例4: TestNonStartedControllerMachine

func (s *SourcePrecheckSuite) TestNonStartedControllerMachine(c *gc.C) {
	backend := &fakeBackend{
		controllerBackend: newBackendWithDownMachine(),
	}
	err := migration.SourcePrecheck(backend)
	c.Assert(err.Error(), gc.Equals, "controller: machine 0 agent not functioning at this time (down)")
}
开发者ID:bac,项目名称:juju,代码行数:7,代码来源:precheck_test.go

示例5: TestDyingApplication

func (s *SourcePrecheckSuite) TestDyingApplication(c *gc.C) {
	backend := &fakeBackend{
		apps: []migration.PrecheckApplication{
			&fakeApp{
				name: "foo",
				life: state.Dying,
			},
		},
	}
	err := migration.SourcePrecheck(backend)
	c.Assert(err.Error(), gc.Equals, "application foo is dying")
}
开发者ID:bac,项目名称:juju,代码行数:12,代码来源:precheck_test.go

示例6: TestWithPendingMinUnits

func (s *SourcePrecheckSuite) TestWithPendingMinUnits(c *gc.C) {
	backend := &fakeBackend{
		apps: []migration.PrecheckApplication{
			&fakeApp{
				name:     "foo",
				minunits: 2,
				units:    []migration.PrecheckUnit{&fakeUnit{name: "foo/0"}},
			},
		},
	}
	err := migration.SourcePrecheck(backend)
	c.Assert(err.Error(), gc.Equals, "application foo is below its minimum units threshold")
}
开发者ID:bac,项目名称:juju,代码行数:13,代码来源:precheck_test.go

示例7: TestUnitLost

func (s *SourcePrecheckSuite) TestUnitLost(c *gc.C) {
	backend := &fakeBackend{
		apps: []migration.PrecheckApplication{
			&fakeApp{
				name: "foo",
				units: []migration.PrecheckUnit{
					&fakeUnit{name: "foo/0", lost: true},
				},
			},
		},
	}
	err := migration.SourcePrecheck(backend)
	c.Assert(err.Error(), gc.Equals, "unit foo/0 not idle (lost)")
}
开发者ID:bac,项目名称:juju,代码行数:14,代码来源:precheck_test.go

示例8: TestUnitNotIdle

func (s *SourcePrecheckSuite) TestUnitNotIdle(c *gc.C) {
	backend := &fakeBackend{
		apps: []migration.PrecheckApplication{
			&fakeApp{
				name: "foo",
				units: []migration.PrecheckUnit{
					&fakeUnit{name: "foo/0", agentStatus: status.Failed},
				},
			},
		},
	}
	err := migration.SourcePrecheck(backend)
	c.Assert(err.Error(), gc.Equals, "unit foo/0 not idle (failed)")
}
开发者ID:bac,项目名称:juju,代码行数:14,代码来源:precheck_test.go

示例9: TestDeadUnit

func (s *SourcePrecheckSuite) TestDeadUnit(c *gc.C) {
	backend := &fakeBackend{
		apps: []migration.PrecheckApplication{
			&fakeApp{
				name: "foo",
				units: []migration.PrecheckUnit{
					&fakeUnit{name: "foo/0", life: state.Dead},
				},
			},
		},
	}
	err := migration.SourcePrecheck(backend)
	c.Assert(err.Error(), gc.Equals, "unit foo/0 is dead")
}
开发者ID:bac,项目名称:juju,代码行数:14,代码来源:precheck_test.go

示例10: TestCharmUpgrades

func (*SourcePrecheckSuite) TestCharmUpgrades(c *gc.C) {
	backend := &fakeBackend{
		apps: []migration.PrecheckApplication{
			&fakeApp{
				name:     "spanner",
				charmURL: "cs:spanner-3",
				units: []migration.PrecheckUnit{
					&fakeUnit{name: "spanner/0", charmURL: "cs:spanner-3"},
					&fakeUnit{name: "spanner/1", charmURL: "cs:spanner-2"},
				},
			},
		},
	}
	err := migration.SourcePrecheck(backend)
	c.Assert(err, gc.ErrorMatches, "unit spanner/1 is upgrading")
}
开发者ID:bac,项目名称:juju,代码行数:16,代码来源:precheck_test.go

示例11: TestUnitVersionsDontMatch

func (s *SourcePrecheckSuite) TestUnitVersionsDontMatch(c *gc.C) {
	backend := &fakeBackend{
		apps: []migration.PrecheckApplication{
			&fakeApp{
				name:  "foo",
				units: []migration.PrecheckUnit{&fakeUnit{name: "foo/0"}},
			},
			&fakeApp{
				name: "bar",
				units: []migration.PrecheckUnit{
					&fakeUnit{name: "bar/0"},
					&fakeUnit{name: "bar/1", version: version.MustParseBinary("1.2.4-trusty-ppc64")},
				},
			},
		},
	}
	err := migration.SourcePrecheck(backend)
	c.Assert(err.Error(), gc.Equals, "unit bar/1 tools don't match model (1.2.4 != 1.2.3)")
}
开发者ID:bac,项目名称:juju,代码行数:19,代码来源:precheck_test.go

示例12: sourcePrecheck

func sourcePrecheck(backend migration.PrecheckBackend) error {
	return migration.SourcePrecheck(backend)
}
开发者ID:bac,项目名称:juju,代码行数:3,代码来源:precheck_test.go

示例13: TestNonStartedMachine

func (s *SourcePrecheckSuite) TestNonStartedMachine(c *gc.C) {
	backend := newBackendWithDownMachine()
	err := migration.SourcePrecheck(backend)
	c.Assert(err.Error(), gc.Equals, "machine 0 agent not functioning at this time (down)")
}
开发者ID:bac,项目名称:juju,代码行数:5,代码来源:precheck_test.go

示例14: Prechecks

// Prechecks performs pre-migration checks on the model and
// (source) controller.
func (api *API) Prechecks() error {
	return migration.SourcePrecheck(api.precheckBackend)
}
开发者ID:bac,项目名称:juju,代码行数:5,代码来源:facade.go

示例15: TestDownMachineAgent

func (s *SourcePrecheckSuite) TestDownMachineAgent(c *gc.C) {
	err := migration.SourcePrecheck(newBackendWithDownMachineAgent())
	c.Assert(err.Error(), gc.Equals, "machine 1 agent not functioning at this time (down)")
}
开发者ID:bac,项目名称:juju,代码行数:4,代码来源:precheck_test.go


注:本文中的github.com/juju/juju/migration.SourcePrecheck函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。