~smoser/ubuntu/precise/juju-core/cloud-tools

« back to all changes in this revision

Viewing changes to src/launchpad.net/juju-core/cmd/jujud/main_test.go

  • Committer: Scott Moser
  • Date: 2014-02-26 16:17:47 UTC
  • mfrom: (24.1.5 trusty-proposed)
  • Revision ID: smoser@ubuntu.com-20140226161747-dk6h7wp288370ave
* New upstream point release (LP: #1271941, #834930, #1240667, #1274210):
  - https://launchpad.net/juju-core/trunk/1.17.3
* No change rebuild with gccgo-4.9 as default gccgo. 
* d/control,rules,juju-core.{postinst,prerm}.in: Drop build of gccgo built
  binaries for architectures supported by golang gc.
* d/juju-core.postinst.in: Drop --force option when installing alternatives.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
        "launchpad.net/juju-core/cmd"
21
21
        "launchpad.net/juju-core/environs"
22
22
        "launchpad.net/juju-core/testing"
 
23
        "launchpad.net/juju-core/testing/testbase"
 
24
        "launchpad.net/juju-core/worker/deployer"
23
25
        "launchpad.net/juju-core/worker/uniter/jujuc"
24
26
)
25
27
 
26
28
var caCertFile string
27
29
 
 
30
func mkdtemp(prefix string) string {
 
31
        d, err := ioutil.TempDir("", prefix)
 
32
        if err != nil {
 
33
                panic(err)
 
34
        }
 
35
        return d
 
36
}
 
37
 
28
38
func mktemp(prefix string, content string) string {
29
39
        f, err := ioutil.TempFile("", prefix)
30
40
        if err != nil {
39
49
}
40
50
 
41
51
func TestPackage(t *stdtesting.T) {
 
52
        // Change the default init dir in worker/deployer,
 
53
        // so the deployer doesn't try to remove upstart
 
54
        // jobs from tests.
 
55
        restore := testbase.PatchValue(&deployer.InitDir, mkdtemp("juju-worker-deployer"))
 
56
        defer restore()
 
57
 
42
58
        // Change the path to "juju-run", so that the
43
59
        // tests don't try to write to /usr/local/bin.
44
60
        jujuRun = mktemp("juju-run", "")