コード例 #1
0
ファイル: kvm_test.go プロジェクト: bac/juju
// Test that CreateContainer creates proper startParams.
func (s *KVMSuite) TestCreateContainerUtilizesReleaseSimpleStream(c *gc.C) {

	// Mock machineConfig with a mocked simple stream URL.
	instanceConfig, err := containertesting.MockMachineConfig("1/kvm/0")
	c.Assert(err, jc.ErrorIsNil)

	// CreateContainer sets TestStartParams internally; we call this
	// purely for the side-effect.
	containertesting.CreateContainerWithMachineConfig(c, s.manager, instanceConfig)

	c.Assert(kvm.TestStartParams.ImageDownloadURL, gc.Equals, "")
}
コード例 #2
0
ファイル: kvm_test.go プロジェクト: claudiu-coblis/juju
// Test that CreateContainer creates proper startParams.
func (s *KVMSuite) TestCreateContainerUtilizesDailySimpleStream(c *gc.C) {

	// Mock machineConfig with a mocked simple stream URL.
	instanceConfig, err := containertesting.MockMachineConfig("1/kvm/0")
	c.Assert(err, jc.ErrorIsNil)
	instanceConfig.ImageStream = "daily"

	// CreateContainer sets TestStartParams internally; we call this
	// purely for the side-effect.
	containertesting.CreateContainerWithMachineConfig(c, s.manager, instanceConfig)

	c.Assert(kvm.TestStartParams.ImageDownloadUrl, gc.Equals, "http://cloud-images.ubuntu.com/daily")
}
コード例 #3
0
ファイル: kvm_test.go プロジェクト: claudiu-coblis/juju
// Test that CreateContainer creates proper startParams.
func (s *KVMSuite) TestCreateContainerUtilizesReleaseSimpleStream(c *gc.C) {

	envCfg, err := config.New(
		config.NoDefaults,
		dummy.SampleConfig().Merge(
			coretesting.Attrs{"image-stream": "released"},
		),
	)
	c.Assert(err, jc.ErrorIsNil)

	// Mock machineConfig with a mocked simple stream URL.
	instanceConfig, err := containertesting.MockMachineConfig("1/kvm/0")
	c.Assert(err, jc.ErrorIsNil)
	instanceConfig.Config = envCfg

	// CreateContainer sets TestStartParams internally; we call this
	// purely for the side-effect.
	containertesting.CreateContainerWithMachineConfig(c, s.manager, instanceConfig)

	c.Assert(kvm.TestStartParams.ImageDownloadUrl, gc.Equals, "")
}