Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(301)

Side by Side Diff: state/api/upgrader/upgrader_test.go

Issue 13380043: upgrader: add Upgrader.DesiredVersion
Patch Set: upgrader: add Upgrader.DesiredVersion Created 11 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « state/api/upgrader/upgrader.go ('k') | state/apiserver/upgrader/upgrader.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012, 2013 Canonical Ltd. 1 // Copyright 2012, 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package upgrader_test 4 package upgrader_test
5 5
6 import ( 6 import (
7 stdtesting "testing" 7 stdtesting "testing"
8 8
9 gc "launchpad.net/gocheck" 9 gc "launchpad.net/gocheck"
10 10
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 err = statetesting.SetAgentVersion(s.BackingState, vers) 135 err = statetesting.SetAgentVersion(s.BackingState, vers)
136 c.Assert(err, gc.IsNil) 136 c.Assert(err, gc.IsNil)
137 wc.AssertNoChange() 137 wc.AssertNoChange()
138 vers = version.MustParse("10.20.35") 138 vers = version.MustParse("10.20.35")
139 err = statetesting.SetAgentVersion(s.BackingState, vers) 139 err = statetesting.SetAgentVersion(s.BackingState, vers)
140 c.Assert(err, gc.IsNil) 140 c.Assert(err, gc.IsNil)
141 wc.AssertOneChange() 141 wc.AssertOneChange()
142 statetesting.AssertStop(c, w) 142 statetesting.AssertStop(c, w)
143 wc.AssertClosed() 143 wc.AssertClosed()
144 } 144 }
145
146 func (s *upgraderSuite) TestDesiredVersion(c *gc.C) {
147 cur := version.Current
148 curTools := &tools.Tools{Version: cur, URL: ""}
149 curTools.Version.Minor++
150 s.rawMachine.SetAgentTools(curTools)
151 // Upgrader.DesiredVersion returns the *desired* set of tools, not the
152 // currently running set. We want to be upgraded to cur.Version
153 stateVersion, err := s.st.DesiredVersion(s.rawMachine.Tag())
154 c.Assert(err, gc.IsNil)
155 c.Assert(stateVersion, gc.Equals, cur.Number)
156 }
OLDNEW
« no previous file with comments | « state/api/upgrader/upgrader.go ('k') | state/apiserver/upgrader/upgrader.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b