github.com/wallyworld/juju@v0.0.0-20161013125918-6cf1bc9d917a/container/utils_test.go (about)

     1  // Copyright 2016 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package container
     5  
     6  import (
     7  	jc "github.com/juju/testing/checkers"
     8  	gc "gopkg.in/check.v1"
     9  
    10  	"github.com/juju/juju/testing"
    11  )
    12  
    13  var _ = gc.Suite(&UtilsSuite{})
    14  
    15  type UtilsSuite struct {
    16  	testing.BaseSuite
    17  }
    18  
    19  func (s *UtilsSuite) TestIsLXCSupportedOnHost(c *gc.C) {
    20  	s.PatchValue(&RunningInContainer, func() bool {
    21  		return false
    22  	})
    23  	supports := ContainersSupported()
    24  	c.Assert(supports, jc.IsTrue)
    25  }
    26  
    27  func (s *UtilsSuite) TestIsLXCSupportedOnLXCContainer(c *gc.C) {
    28  	s.PatchValue(&RunningInContainer, func() bool {
    29  		return true
    30  	})
    31  	supports := ContainersSupported()
    32  	c.Assert(supports, jc.IsFalse)
    33  }