Exemple #1
0
func (s *configFunctionalSuite) TestUsingTCPRemote(c *gc.C) {
	if s.client == nil {
		c.Skip("LXD not running locally")
	}

	cfg := lxdclient.Config{
		Namespace: "my-ns",
		Dirname:   "some-dir",
		Remote:    lxdclient.Local,
	}
	nonlocal, err := cfg.UsingTCPRemote()
	c.Assert(err, jc.ErrorIsNil)

	checkValidRemote(c, &nonlocal.Remote)
	c.Check(nonlocal, jc.DeepEquals, lxdclient.Config{
		Namespace: "my-ns",
		Dirname:   "some-dir",
		Remote: lxdclient.Remote{
			Name: lxdclient.Local.Name,
			Host: nonlocal.Remote.Host,
			Cert: nonlocal.Remote.Cert,
		},
	})
	// TODO(ericsnow) Check that the server has the certs.
}
Exemple #2
0
func (s *configSuite) TestUsingTCPRemoteNoop(c *gc.C) {
	cfg := lxdclient.Config{
		Namespace: "my-ns",
		Dirname:   "some-dir",
		Remote:    s.remote,
	}
	nonlocal, err := cfg.UsingTCPRemote()
	c.Assert(err, jc.ErrorIsNil)

	c.Check(nonlocal, jc.DeepEquals, cfg)
}