1
// Copyright 2014 Canonical Ltd.
2
// Licensed under the AGPLv3, see LICENCE file for details.
11
"github.com/juju/testing"
12
jc "github.com/juju/testing/checkers"
13
gc "gopkg.in/check.v1"
15
"github.com/juju/juju/container/kvm"
16
coretesting "github.com/juju/juju/testing"
19
type LibVertSuite struct {
25
var _ = gc.Suite(&LibVertSuite{})
27
func (s *LibVertSuite) SetUpTest(c *gc.C) {
28
s.BaseSuite.SetUpTest(c)
30
if runtime.GOOS != "linux" {
31
c.Skip("not running linux")
35
// Test that the call to SyncImages utilizes the defined source
36
func (s *LibVertSuite) TestSyncImagesUtilizesSimpleStreamsSource(c *gc.C) {
38
const simpStreamsBinName = "uvt-simplestreams-libvirt"
39
testing.PatchExecutableAsEchoArgs(c, s, simpStreamsBinName)
42
series = "mocked-series"
46
err := kvm.SyncImages(series, arch, source)
47
c.Assert(err, jc.ErrorIsNil)
49
expectedArgs := strings.Split(
51
"sync arch=%s release=%s --source=%s",
59
testing.AssertEchoArgs(c, simpStreamsBinName, expectedArgs...)