From dbc59aad7c0746f46864582a0aa8934fd3d694a3 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Wed, 20 Jul 2016 10:01:08 +0100 Subject: [PATCH 1/2] For e2e_node tests tell etcd to listen on ports 2379 and 4001 This is the default for etcd2, but etcd3 only listens on 2379. Specifying the ports keeps things consistent no matter which version the user has installed. --- test/e2e_node/e2e_service.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/e2e_node/e2e_service.go b/test/e2e_node/e2e_service.go index db56e15cf9a..8f8bf890116 100644 --- a/test/e2e_node/e2e_service.go +++ b/test/e2e_node/e2e_service.go @@ -190,7 +190,9 @@ func (es *e2eService) startEtcd() (*killCmd, error) { } etcdPath = defaultEtcdPath } - cmd := exec.Command(etcdPath) + cmd := exec.Command(etcdPath, + "--listen-client-urls=http://0.0.0.0:2379,http://0.0.0.0:4001", + "--advertise-client-urls=http://0.0.0.0:2379,http://0.0.0.0:4001") // Execute etcd in the data directory instead of using --data-dir because the flag sometimes requires additional // configuration (e.g. --name in version 0.4.9) cmd.Dir = es.etcdDataDir From 1307799a66adff84e7710df4f7792ca35521525e Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 4 Aug 2016 14:36:25 +0100 Subject: [PATCH 2/2] Run 'etcd2' if it exists, in preference to 'etcd' This is to accommodate CoreOS, where 'etcd' is a very old version --- test/e2e_node/e2e_service.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/e2e_node/e2e_service.go b/test/e2e_node/e2e_service.go index 8f8bf890116..7548d3d40cb 100644 --- a/test/e2e_node/e2e_service.go +++ b/test/e2e_node/e2e_service.go @@ -181,7 +181,12 @@ func (es *e2eService) startEtcd() (*killCmd, error) { return nil, err } es.etcdDataDir = dataDir - etcdPath, err := exec.LookPath("etcd") + var etcdPath string + // CoreOS ships a binary named 'etcd' which is really old, so prefer 'etcd2' if it exists + etcdPath, err = exec.LookPath("etcd2") + if err != nil { + etcdPath, err = exec.LookPath("etcd") + } if err != nil { glog.Infof("etcd not found in PATH. Defaulting to %s...", defaultEtcdPath) _, err = os.Stat(defaultEtcdPath)