github.com/mwhudson/juju@v0.0.0-20160512215208-90ff01f3497f/container/utils_test.go (about) 1 package container 2 3 import ( 4 jc "github.com/juju/testing/checkers" 5 gc "gopkg.in/check.v1" 6 7 "github.com/juju/juju/testing" 8 ) 9 10 var _ = gc.Suite(&UtilsSuite{}) 11 12 type UtilsSuite struct { 13 testing.BaseSuite 14 } 15 16 func (s *UtilsSuite) TestIsLXCSupportedOnHost(c *gc.C) { 17 s.PatchValue(&RunningInContainer, func() bool { 18 return false 19 }) 20 supports := ContainersSupported() 21 c.Assert(supports, jc.IsTrue) 22 } 23 24 func (s *UtilsSuite) TestIsLXCSupportedOnLXCContainer(c *gc.C) { 25 s.PatchValue(&RunningInContainer, func() bool { 26 return true 27 }) 28 supports := ContainersSupported() 29 c.Assert(supports, jc.IsFalse) 30 }