~ubuntu-branches/ubuntu/saucy/juju-core/saucy

« back to all changes in this revision

Viewing changes to src/launchpad.net/juju-core/worker/deployer/simple_test.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 16:02:16 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20130820160216-5yu1llasa2e2youn
Tags: 1.13.1-0ubuntu1
* New upstream release.
  - Build and install juju metadata plugin.
  - d/NEWS: Add some guidance on upgrading environments from 1.11.x
    to 1.13.x.
* d/NEWS: Add details about lack of upgrade path from juju < 1.11
  and how to interact with older juju environments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
        . "launchpad.net/gocheck"
16
16
 
17
17
        "launchpad.net/juju-core/agent"
 
18
        "launchpad.net/juju-core/agent/tools"
 
19
        "launchpad.net/juju-core/names"
18
20
        "launchpad.net/juju-core/state"
19
21
        "launchpad.net/juju-core/state/api"
20
22
        "launchpad.net/juju-core/testing/checkers"
143
145
        fix.initDir = c.MkDir()
144
146
        fix.logDir = c.MkDir()
145
147
        fix.syslogConfigDir = c.MkDir()
146
 
        toolsDir := agent.SharedToolsDir(fix.dataDir, version.Current)
 
148
        toolsDir := tools.SharedToolsDir(fix.dataDir, version.Current)
147
149
        err := os.MkdirAll(toolsDir, 0755)
148
150
        c.Assert(err, IsNil)
149
151
        jujudPath := filepath.Join(toolsDir, "jujud")
185
187
func (fix *SimpleToolsFixture) paths(tag string) (confPath, agentDir, toolsDir, syslogConfPath string) {
186
188
        confName := fmt.Sprintf("jujud-%s.conf", tag)
187
189
        confPath = filepath.Join(fix.initDir, confName)
188
 
        agentDir = agent.Dir(fix.dataDir, tag)
189
 
        toolsDir = agent.ToolsDir(fix.dataDir, tag)
 
190
        agentDir = tools.Dir(fix.dataDir, tag)
 
191
        toolsDir = tools.ToolsDir(fix.dataDir, tag)
190
192
        syslogConfPath = filepath.Join(fix.syslogConfigDir, fmt.Sprintf("26-juju-%s.conf", tag))
191
193
        return
192
194
}
207
209
`
208
210
 
209
211
func (fix *SimpleToolsFixture) checkUnitInstalled(c *C, name, password string) {
210
 
        tag := state.UnitTag(name)
 
212
        tag := names.UnitTag(name)
211
213
        uconfPath, _, toolsDir, syslogConfPath := fix.paths(tag)
212
214
        uconfData, err := ioutil.ReadFile(uconfPath)
213
215
        c.Assert(err, IsNil)
267
269
}
268
270
 
269
271
func (fix *SimpleToolsFixture) checkUnitRemoved(c *C, name string) {
270
 
        tag := state.UnitTag(name)
 
272
        tag := names.UnitTag(name)
271
273
        confPath, agentDir, toolsDir, syslogConfPath := fix.paths(tag)
272
274
        for _, path := range []string{confPath, agentDir, toolsDir, syslogConfPath} {
273
275
                _, err := ioutil.ReadFile(path)