~ps-jenkins/ubuntu-push/ubuntu-vivid-proposed

« back to all changes in this revision

Viewing changes to server/runner_test.go

  • Committer: Roberto Alsina
  • Date: 2014-10-24 14:05:51 UTC
  • mfrom: (91.179.41 automatic)
  • mto: This revision was merged to the branch mainline in revision 136.
  • Revision ID: roberto.alsina@canonical.com-20141024140551-tsdz3xggo2rbwlqj
MergeĀ fromĀ automatic

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
        . "launchpad.net/gocheck"
28
28
 
29
29
        "launchpad.net/ubuntu-push/config"
 
30
        "launchpad.net/ubuntu-push/server/listener"
30
31
        helpers "launchpad.net/ubuntu-push/testing"
31
32
)
32
33
 
111
112
        },
112
113
}
113
114
 
 
115
var resource = &listener.NopSessionResourceManager{}
 
116
 
114
117
func (s *runnerSuite) TestDevicesRunner(c *C) {
115
118
        prevBootLogger := BootLogger
116
119
        testlog := helpers.NewTestLogger(c, "debug")
118
121
        defer func() {
119
122
                BootLogger = prevBootLogger
120
123
        }()
121
 
        runner := DevicesRunner(nil, func(conn net.Conn) error { return nil }, BootLogger, &testDevicesParsedConfig)
 
124
        runner := DevicesRunner(nil, func(conn net.Conn) error { return nil }, BootLogger, resource, &testDevicesParsedConfig)
122
125
        c.Assert(s.lst, Not(IsNil))
123
126
        s.lst.Close()
124
127
        c.Check(s.kind, Equals, "devices")
135
138
        lst0, err := net.Listen("tcp", "127.0.0.1:0")
136
139
        c.Assert(err, IsNil)
137
140
        defer lst0.Close()
138
 
        DevicesRunner(lst0, func(conn net.Conn) error { return nil }, BootLogger, &testDevicesParsedConfig)
 
141
        DevicesRunner(lst0, func(conn net.Conn) error { return nil }, BootLogger, resource, &testDevicesParsedConfig)
139
142
        c.Assert(s.lst, Not(IsNil))
140
143
        c.Check(s.lst.Addr().String(), Equals, lst0.Addr().String())
141
144
        s.lst.Close()