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


Golang series.LatestLts函数代码示例

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


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

示例1: TestPrecheckInstanceUnsupportedArch

func (s *environPolSuite) TestPrecheckInstanceUnsupportedArch(c *gc.C) {
	cons := constraints.MustParse("instance-type=n1-standard-1 arch=i386")
	placement := ""
	err := s.Env.PrecheckInstance(series.LatestLts(), cons, placement)

	c.Check(err, jc.ErrorIsNil)
}
开发者ID:xushiwei,项目名称:juju,代码行数:7,代码来源:environ_policy_test.go

示例2: TestPrecheckInstanceInvalidInstanceType

func (s *environPolSuite) TestPrecheckInstanceInvalidInstanceType(c *gc.C) {
	cons := constraints.MustParse("instance-type=n1-standard-1.invalid")
	placement := ""
	err := s.Env.PrecheckInstance(series.LatestLts(), cons, placement)

	c.Check(err, gc.ErrorMatches, `.*invalid GCE instance type.*`)
}
开发者ID:xushiwei,项目名称:juju,代码行数:7,代码来源:environ_policy_test.go

示例3: TestDefaultMTUPropagatedToNewLXCBroker

func (s *LXCDefaultMTUSuite) TestDefaultMTUPropagatedToNewLXCBroker(c *gc.C) {
	// create a machine to host the container.
	m, err := s.BackingState.AddOneMachine(state.MachineTemplate{
		Series:      series.LatestLts(),
		Jobs:        []state.MachineJob{state.JobHostUnits},
		Constraints: s.defaultConstraints,
	})
	c.Assert(err, jc.ErrorIsNil)
	err = m.SetSupportedContainers([]instance.ContainerType{instance.LXC, instance.KVM})
	c.Assert(err, jc.ErrorIsNil)
	current := version.Binary{
		Number: jujuversion.Current,
		Arch:   arch.HostArch(),
		Series: series.HostSeries(),
	}
	err = m.SetAgentVersion(current)
	c.Assert(err, jc.ErrorIsNil)

	brokerCalled := false
	newlxcbroker := func(api provisioner.APICalls, agentConfig agent.Config, managerConfig container.ManagerConfig, imageURLGetter container.ImageURLGetter, enableNAT bool, defaultMTU int) (environs.InstanceBroker, error) {
		brokerCalled = true
		c.Assert(defaultMTU, gc.Equals, 9000)
		return nil, fmt.Errorf("lxc broker error")
	}
	s.PatchValue(&provisioner.NewLxcBroker, newlxcbroker)
	s.createContainer(c, m, instance.LXC)
	c.Assert(brokerCalled, jc.IsTrue)
}
开发者ID:xushiwei,项目名称:juju,代码行数:28,代码来源:container_initialisation_test.go

示例4: TestContainerInitLockError

func (s *ContainerSetupSuite) TestContainerInitLockError(c *gc.C) {
	m, err := s.BackingState.AddOneMachine(state.MachineTemplate{
		Series:      series.LatestLts(),
		Jobs:        []state.MachineJob{state.JobHostUnits},
		Constraints: s.defaultConstraints,
	})
	c.Assert(err, jc.ErrorIsNil)
	current := version.Binary{
		Number: jujuversion.Current,
		Arch:   arch.HostArch(),
		Series: series.HostSeries(),
	}
	err = m.SetAgentVersion(current)
	c.Assert(err, jc.ErrorIsNil)

	err = os.RemoveAll(s.initLockDir)
	c.Assert(err, jc.ErrorIsNil)
	handler, runner := s.setupContainerWorker(c, m.Tag().(names.MachineTag))
	runner.Kill()
	err = runner.Wait()
	c.Assert(err, jc.ErrorIsNil)

	_, err = handler.SetUp()
	c.Assert(err, jc.ErrorIsNil)
	err = handler.Handle(nil, []string{"0/lxc/0"})
	c.Assert(err, gc.ErrorMatches, ".*failed to acquire initialization lock:.*")

}
开发者ID:xushiwei,项目名称:juju,代码行数:28,代码来源:container_initialisation_test.go

示例5: TestProvisioningDoesNotOccurForKVM

func (s *ProvisionerSuite) TestProvisioningDoesNotOccurForKVM(c *gc.C) {
	p := s.newEnvironProvisioner(c)
	defer stop(c, p)

	// create a machine to host the container.
	m, err := s.addMachine()
	c.Assert(err, jc.ErrorIsNil)
	inst := s.checkStartInstance(c, m)

	// make a container on the machine we just created
	template := state.MachineTemplate{
		Series: series.LatestLts(),
		Jobs:   []state.MachineJob{state.JobHostUnits},
	}
	container, err := s.State.AddMachineInsideMachine(template, m.Id(), instance.KVM)
	c.Assert(err, jc.ErrorIsNil)

	// the PA should not attempt to create it
	s.checkNoOperations(c)

	// cleanup
	c.Assert(container.EnsureDead(), gc.IsNil)
	c.Assert(container.Remove(), gc.IsNil)
	c.Assert(m.EnsureDead(), gc.IsNil)
	s.checkStopInstances(c, inst)
	s.waitForRemovalMark(c, m)
}
开发者ID:bac,项目名称:juju,代码行数:27,代码来源:provisioner_test.go

示例6: TestPrecheckInstanceAvailZone

func (s *environPolSuite) TestPrecheckInstanceAvailZone(c *gc.C) {
	cons := constraints.Value{}
	placement := "zone=a-zone"
	err := s.Env.PrecheckInstance(series.LatestLts(), cons, placement)

	c.Check(err, gc.ErrorMatches, `unknown placement directive: .*`)
}
开发者ID:xushiwei,项目名称:juju,代码行数:7,代码来源:environ_policy_test.go

示例7: TestPrecheckInstanceDiskSize

func (s *environPolSuite) TestPrecheckInstanceDiskSize(c *gc.C) {
	cons := constraints.MustParse("root-disk=1G")
	placement := ""
	err := s.Env.PrecheckInstance(series.LatestLts(), cons, placement)

	c.Check(err, jc.ErrorIsNil)
}
开发者ID:xushiwei,项目名称:juju,代码行数:7,代码来源:environ_policy_test.go

示例8: TestPrecheckInstanceOkay

func (s *environPolSuite) TestPrecheckInstanceOkay(c *gc.C) {
	cons := constraints.Value{}
	placement := ""
	err := s.Env.PrecheckInstance(series.LatestLts(), cons, placement)

	c.Check(err, jc.ErrorIsNil)
}
开发者ID:xushiwei,项目名称:juju,代码行数:7,代码来源:environ_policy_test.go

示例9: TestPrecheckInstanceHasInstanceType

func (s *environPolSuite) TestPrecheckInstanceHasInstanceType(c *gc.C) {
	cons := constraints.MustParse("instance-type=some-instance-type")
	placement := ""
	err := s.Env.PrecheckInstance(series.LatestLts(), cons, placement)

	c.Check(err, gc.ErrorMatches, `LXD does not support instance types.*`)
}
开发者ID:xushiwei,项目名称:juju,代码行数:7,代码来源:environ_policy_test.go

示例10: TestPrecheckInstanceAvailZone

func (s *environSuite) TestPrecheckInstanceAvailZone(c *gc.C) {
	s.testMAASObject.TestServer.AddZone("zone1", "the grass is greener in zone1")
	env := s.makeEnviron()
	placement := "zone=zone1"
	err := env.PrecheckInstance(series.LatestLts(), constraints.Value{}, placement)
	c.Assert(err, jc.ErrorIsNil)
}
开发者ID:bac,项目名称:juju,代码行数:7,代码来源:environ_whitebox_test.go

示例11: TestPrecheckInstanceAvailZoneUnknown

func (s *environSuite) TestPrecheckInstanceAvailZoneUnknown(c *gc.C) {
	s.testMAASObject.TestServer.AddZone("zone1", "the grass is greener in zone1")
	env := s.makeEnviron()
	placement := "zone=zone2"
	err := env.PrecheckInstance(series.LatestLts(), constraints.Value{}, placement)
	c.Assert(err, gc.ErrorMatches, `invalid availability zone "zone2"`)
}
开发者ID:bac,项目名称:juju,代码行数:7,代码来源:environ_whitebox_test.go

示例12: SetUpTest

func (s *baseProviderSuite) SetUpTest(c *gc.C) {
	s.FakeJujuXDGDataHomeSuite.SetUpTest(c)
	s.ToolsFixture.SetUpTest(c)
	s.PatchValue(&jujuversion.Current, coretesting.FakeVersionNumber)
	s.PatchValue(&arch.HostArch, func() string { return arch.AMD64 })
	s.PatchValue(&series.HostSeries, func() string { return series.LatestLts() })
}
开发者ID:bac,项目名称:juju,代码行数:7,代码来源:maas_test.go

示例13: TestClientAddMachinesWithInstanceIdSomeErrors

func (s *clientSuite) TestClientAddMachinesWithInstanceIdSomeErrors(c *gc.C) {
	apiParams := make([]params.AddMachineParams, 3)
	addrs := network.NewAddresses("1.2.3.4")
	hc := instance.MustParseHardware("mem=4G")
	for i := 0; i < 3; i++ {
		apiParams[i] = params.AddMachineParams{
			Jobs:       []multiwatcher.MachineJob{multiwatcher.JobHostUnits},
			InstanceId: instance.Id(fmt.Sprintf("1234-%d", i)),
			Nonce:      "foo",
			HardwareCharacteristics: hc,
			Addrs: params.FromNetworkAddresses(addrs...),
		}
	}
	// This will cause the last add-machine to fail.
	apiParams[2].Nonce = ""
	machines, err := s.APIState.Client().AddMachines(apiParams)
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(len(machines), gc.Equals, 3)
	for i, machineResult := range machines {
		if i == 2 {
			c.Assert(machineResult.Error, gc.NotNil)
			c.Assert(machineResult.Error, gc.ErrorMatches, "cannot add a new machine: cannot add a machine with an instance id and no nonce")
		} else {
			c.Assert(machineResult.Machine, gc.DeepEquals, strconv.Itoa(i))
			s.checkMachine(c, machineResult.Machine, series.LatestLts(), apiParams[i].Constraints.String())
			instanceId := fmt.Sprintf("1234-%d", i)
			s.checkInstance(c, machineResult.Machine, instanceId, "foo", hc, addrs)
		}
	}
}
开发者ID:bac,项目名称:juju,代码行数:30,代码来源:client_test.go

示例14: SetUpTest

func (s *rebootSuite) SetUpTest(c *gc.C) {
	var err error
	template := state.MachineTemplate{
		Series: series.LatestLts(),
		Jobs:   []state.MachineJob{state.JobHostUnits},
	}
	s.JujuConnSuite.SetUpTest(c)

	s.stateAPI, s.machine = s.OpenAPIAsNewMachine(c)
	s.rebootState, err = s.stateAPI.Reboot()
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(s.rebootState, gc.NotNil)

	//Add container
	s.ct, err = s.State.AddMachineInsideMachine(template, s.machine.Id(), instance.KVM)
	c.Assert(err, jc.ErrorIsNil)
	password, err := utils.RandomPassword()
	c.Assert(err, jc.ErrorIsNil)
	err = s.ct.SetPassword(password)
	c.Assert(err, jc.ErrorIsNil)
	err = s.ct.SetProvisioned("foo", "fake_nonce", nil)
	c.Assert(err, jc.ErrorIsNil)

	// Open api as container
	ctState := s.OpenAPIAsMachine(c, s.ct.Tag(), password, "fake_nonce")
	s.ctRebootState, err = ctState.Reboot()
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(s.ctRebootState, gc.NotNil)

	s.clock = &fakeClock{delay: time.Millisecond}
}
开发者ID:bac,项目名称:juju,代码行数:31,代码来源:reboot_test.go

示例15: addMachineWithConstraints

func (s *CommonProvisionerSuite) addMachineWithConstraints(cons constraints.Value) (*state.Machine, error) {
	return s.BackingState.AddOneMachine(state.MachineTemplate{
		Series:      series.LatestLts(),
		Jobs:        []state.MachineJob{state.JobHostUnits},
		Constraints: cons,
	})
}
开发者ID:bac,项目名称:juju,代码行数:7,代码来源:provisioner_test.go


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