// addAPIInfo adds information to the agent's configuration // for serving the API. func addAPIInfo(conf *agent.Conf, m *state.Machine) { port := testing.FindTCPPort() conf.APIInfo.Addrs = []string{fmt.Sprintf("localhost:%d", port)} conf.APIInfo.CACert = []byte(testing.CACert) conf.StateServerCert = []byte(testing.ServerCert) conf.StateServerKey = []byte(testing.ServerKey) conf.APIPort = port }