19
19
statetesting "launchpad.net/juju-core/state/testing"
20
20
coretesting "launchpad.net/juju-core/testing"
21
21
"launchpad.net/juju-core/tools"
22
"launchpad.net/juju-core/utils"
22
23
"launchpad.net/juju-core/version"
101
102
s.rawMachine.SetAgentVersion(cur)
102
103
// Upgrader.Tools returns the *desired* set of tools, not the currently
103
104
// running set. We want to be upgraded to cur.Version
104
stateTools, disableSSLHostnameVerification, err := s.st.Tools(s.rawMachine.Tag())
105
stateTools, hostnameVerification, err := s.st.Tools(s.rawMachine.Tag())
105
106
c.Assert(err, gc.IsNil)
106
107
c.Assert(stateTools.Version, gc.Equals, cur)
107
108
c.Assert(stateTools.URL, gc.Not(gc.Equals), "")
108
c.Assert(disableSSLHostnameVerification, jc.IsFalse)
109
c.Assert(hostnameVerification, gc.Equals, utils.VerifySSLHostnames)
110
111
envtesting.SetSSLHostnameVerification(c, s.State, false)
112
stateTools, disableSSLHostnameVerification, err = s.st.Tools(s.rawMachine.Tag())
113
stateTools, hostnameVerification, err = s.st.Tools(s.rawMachine.Tag())
113
114
c.Assert(err, gc.IsNil)
114
115
c.Assert(stateTools.Version, gc.Equals, cur)
115
116
c.Assert(stateTools.URL, gc.Not(gc.Equals), "")
116
c.Assert(disableSSLHostnameVerification, jc.IsTrue)
117
c.Assert(hostnameVerification, gc.Equals, utils.NoVerifySSLHostnames)
119
120
func (s *machineUpgraderSuite) TestWatchAPIVersion(c *gc.C) {