~landscape/fake-juju/trunk-old

« back to all changes in this revision

Viewing changes to 1.25.3/fake-juju.go

  • Committer: Chad Smith
  • Date: 2016-05-17 18:29:45 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: chad.smith@canonical.com-20160517182945-lkv7id3dk8it2sj0
bump fake-juju rev. Log fake-juju and real juju revs for faked 1.25.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
        "testing"
6
6
        gc "gopkg.in/check.v1"
7
7
        "os"
8
 
        "os/exec"
9
8
        "bufio"
10
9
        "time"
11
10
        "path/filepath"
12
11
        "syscall"
13
12
        "io"
14
13
        "io/ioutil"
 
14
        "os/exec"
15
15
        "errors"
16
16
        "log"
17
17
        "encoding/json"
 
18
        "strings"
18
19
 
19
20
        "github.com/juju/juju/environs"
20
21
        "github.com/juju/juju/environs/config"
312
313
var _ = gc.Suite(&FakeJujuSuite{})
313
314
 
314
315
func (s *FakeJujuSuite) SetUpTest(c *gc.C) {
 
316
        var CommandOutput = (*exec.Cmd).CombinedOutput
315
317
        s.JujuConnSuite.SetUpTest(c)
316
318
 
317
319
        ports := s.APIState.APIHostPorts()
383
385
        s.logFile, err = os.OpenFile(logPath, os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666)
384
386
        c.Assert(err, gc.IsNil)
385
387
 
 
388
        dpkgCmd := exec.Command(
 
389
            "dpkg-query", "--showformat='${Version}'", "--show", "fake-juju")
 
390
        out, err := CommandOutput(dpkgCmd)
386
391
        log.SetOutput(s.logFile)
387
 
        log.Println("Started fake-juju at", jujuHome)
388
 
 
 
392
        fakeJujuDebVersion := strings.Trim(string(out), "'")
 
393
        log.Printf("Started fake-juju-%s for %s\nJUJU_HOME=%s", fakeJujuDebVersion, version.Current, jujuHome)
389
394
}
390
395
 
391
396
func (s *FakeJujuSuite) TearDownTest(c *gc.C) {