Exemple #1
0
func (t *lxcTest) TestUseFastLXC(c *gc.C) {
	for i, test := range []struct {
		message        string
		releaseVersion string
		expected       bool
	}{{
		message: "missing release file",
	}, {
		message:        "precise release",
		releaseVersion: "12.04",
	}, {
		message:        "trusty release",
		releaseVersion: "14.04",
		expected:       true,
	}, {
		message:        "unstable unicorn",
		releaseVersion: "14.10",
		expected:       true,
	}, {
		message:        "jaunty",
		releaseVersion: "9.10",
	}} {
		c.Logf("%v: %v", i, test.message)
		t.PatchValue(local.ReleaseVersion, func() string { return test.releaseVersion })
		value := local.UseFastLXC(instance.LXC)
		c.Assert(value, gc.Equals, test.expected)
	}
}
Exemple #2
0
func (*lxcTest) TestUseFastLXCForContainer(c *gc.C) {
	c.Assert(local.UseFastLXC(instance.ContainerType("")), jc.IsFalse)
	c.Assert(local.UseFastLXC(instance.KVM), jc.IsFalse)
}