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

Unified Diff: state/assign_test.go

Issue 76910044: state/api: Add Client.ServiceDeployWithNetworks (Closed)
Patch Set: state/api: Add Client.ServiceDeployWithNetworks Created 11 years ago
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « state/apiserver/client/perm_test.go ('k') | state/unit.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: state/assign_test.go
=== modified file 'state/assign_test.go'
--- state/assign_test.go 2014-03-13 07:54:56 +0000
+++ state/assign_test.go 2014-03-26 10:41:38 +0000
@@ -28,7 +28,13 @@
func (s *AssignSuite) SetUpTest(c *gc.C) {
s.ConnSuite.SetUpTest(c)
- wordpress := s.AddTestingService(c, "wordpress", s.AddTestingCharm(c, "wordpress"))
+ wordpress := s.AddTestingServiceWithNetworks(
+ c,
+ "wordpress",
+ s.AddTestingCharm(c, "wordpress"),
+ []string{"net1", "net2"},
+ []string{"net3", "net4"},
+ )
s.wordpress = wordpress
}
@@ -312,12 +318,21 @@
}
func (s *AssignSuite) assertAssignedUnit(c *gc.C, unit *state.Unit) string {
+ // Get service networks.
+ service, err := unit.Service()
+ c.Assert(err, gc.IsNil)
+ includeNetworks, excludeNetworks, err := service.Networks()
+ c.Assert(err, gc.IsNil)
// Check the machine on the unit is set.
machineId, err := unit.AssignedMachineId()
c.Assert(err, gc.IsNil)
// Check that the principal is set on the machine.
machine, err := s.State.Machine(machineId)
c.Assert(err, gc.IsNil)
+ include, exclude, err := machine.Networks()
+ c.Assert(err, gc.IsNil)
+ c.Assert(include, gc.DeepEquals, includeNetworks)
+ c.Assert(exclude, gc.DeepEquals, excludeNetworks)
machineUnits, err := machine.Units()
c.Assert(err, gc.IsNil)
c.Assert(machineUnits, gc.HasLen, 1)
« no previous file with comments | « state/apiserver/client/perm_test.go ('k') | state/unit.go » ('j') | no next file with comments »

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