github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/container/kvm/containerfactory_test.go (about)

     1  // Copyright 2022 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package kvm
     5  
     6  import (
     7  	"github.com/juju/testing"
     8  	jc "github.com/juju/testing/checkers"
     9  	gc "gopkg.in/check.v1"
    10  )
    11  
    12  type containerFactorySuite struct {
    13  	testing.IsolationSuite
    14  }
    15  
    16  var _ = gc.Suite(&containerFactorySuite{})
    17  
    18  func (containerFactorySuite) TestNewContainerStartedIsNil(c *gc.C) {
    19  	vm := new(containerFactory).New("some-kvm")
    20  
    21  	raw, ok := vm.(*kvmContainer)
    22  	c.Assert(ok, jc.IsTrue)
    23  
    24  	// A new container instantiated in this way must have an "unknown"
    25  	// started state, which will get queried and set at need.
    26  	c.Assert(raw.started, gc.IsNil)
    27  }