~wallyworld/juju-core/1304742-backport-1.18

« back to all changes in this revision

Viewing changes to state/megawatcher_internal_test.go

Merge prev pipe.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
        . "launchpad.net/gocheck"
11
11
        "launchpad.net/juju-core/charm"
12
12
        "launchpad.net/juju-core/constraints"
 
13
        "launchpad.net/juju-core/instance"
13
14
        "launchpad.net/juju-core/state/api/params"
14
15
        "launchpad.net/juju-core/state/multiwatcher"
15
16
        "launchpad.net/juju-core/state/watcher"
64
65
        m, err := s.State.AddMachine("series", JobManageEnviron)
65
66
        c.Assert(err, IsNil)
66
67
        c.Assert(m.Tag(), Equals, "machine-0")
67
 
        err = m.SetProvisioned(InstanceId("i-"+m.Tag()), "fake_nonce")
 
68
        err = m.SetProvisioned(instance.Id("i-"+m.Tag()), "fake_nonce")
68
69
        c.Assert(err, IsNil)
69
70
        add(&params.MachineInfo{
70
71
                Id:         "0",
129
130
                        Service:   wordpress.Name(),
130
131
                        Series:    m.Series(),
131
132
                        MachineId: m.Id(),
132
 
                        Ports:     []params.Port{},
 
133
                        Ports:     []instance.Port{},
133
134
                        Status:    params.StatusPending,
134
135
                })
135
136
                pairs := map[string]string{"name": fmt.Sprintf("bar %d", i)}
140
141
                        Annotations: pairs,
141
142
                })
142
143
 
143
 
                err = m.SetProvisioned(InstanceId("i-"+m.Tag()), "fake_nonce")
 
144
                err = m.SetProvisioned(instance.Id("i-"+m.Tag()), "fake_nonce")
144
145
                c.Assert(err, IsNil)
145
146
                err = m.SetStatus(params.StatusError, m.Tag())
146
147
                c.Assert(err, IsNil)
175
176
                        Name:    fmt.Sprintf("logging/%d", i),
176
177
                        Service: "logging",
177
178
                        Series:  "series",
178
 
                        Ports:   []params.Port{},
 
179
                        Ports:   []instance.Port{},
179
180
                        Status:  params.StatusPending,
180
181
                })
181
182
        }
339
340
                                PublicAddress:  "public",
340
341
                                PrivateAddress: "private",
341
342
                                MachineId:      "0",
342
 
                                Ports:          []params.Port{{"tcp", 12345}},
 
343
                                Ports:          []instance.Port{{"tcp", 12345}},
343
344
                                Status:         params.StatusError,
344
345
                                StatusInfo:     "failure",
345
346
                        },
371
372
                                Service:       "wordpress",
372
373
                                Series:        "series",
373
374
                                PublicAddress: "public",
374
 
                                Ports:         []params.Port{{"udp", 17070}},
 
375
                                Ports:         []instance.Port{{"udp", 17070}},
375
376
                                Status:        params.StatusError,
376
377
                                StatusInfo:    "another failure",
377
378
                        },