예제 #1
0
func (s *S) TestServers(c *check.C) {
	server, err := otesting.NewServer("127.0.0.1:0")
	c.Assert(err, check.IsNil)
	defer server.Stop()
	var p FakeOneProvisioner
	p.servers = append(p.servers, server)
	c.Assert(p.Servers(), check.DeepEquals, p.servers)
}
예제 #2
0
func (s *S) TestNewFakeOneProvisioner(c *check.C) {
	server, err := otesting.NewServer("127.0.0.1:5555")
	c.Assert(err, check.IsNil)
	p, err := NewFakeOneProvisioner(server.URL())
	c.Assert(err, check.IsNil)
	_, err = p.storage.RetrieveNode(server.URL())
	c.Assert(err, check.IsNil)
	defer p.Destroy()
	defer server.Stop()
}
예제 #3
0
func StartMultipleServersCluster() (*FakeOneProvisioner, error) {
	server1, err := testing.NewServer("127.0.0.1:5555")
	if err != nil {
		return nil, err
	}
	p, err := NewFakeOneProvisioner(server1.URL())
	if err != nil {
		return nil, err
	}
	p.servers = []*testing.OneServer{server1}
	return p, nil
}