func (s *remoteSuite) TestUsingTCPNoop(c *gc.C) { remote := lxdclient.Remote{ Name: "my-remote", Host: "some-host", Protocol: lxdclient.LXDProtocol, Cert: s.Cert, } nonlocal, err := remote.UsingTCP() c.Assert(err, jc.ErrorIsNil) c.Check(nonlocal, jc.DeepEquals, remote) }
func (s *remoteFunctionalSuite) TestUsingTCP(c *gc.C) { if _, err := net.InterfaceByName(lxdclient.DefaultLXDBridge); err != nil { c.Skip("network bridge interface not found") } lxdclient.PatchGenerateCertificate(&s.CleanupSuite, testingCert, testingKey) remote := lxdclient.Remote{ Name: "my-remote", Host: "", Cert: nil, } nonlocal, err := remote.UsingTCP() c.Assert(err, jc.ErrorIsNil) checkValidRemote(c, &nonlocal) c.Check(nonlocal, jc.DeepEquals, lxdclient.Remote{ Name: "my-remote", Host: nonlocal.Host, Protocol: lxdclient.LXDProtocol, Cert: nonlocal.Cert, }) }