From 9c939d3055d25e7bb0c6433b9bab431831f8427b Mon Sep 17 00:00:00 2001 From: Matt Wheeler Date: Wed, 6 Nov 2019 09:59:12 +0000 Subject: [PATCH 1/4] shorten etcd wait_for_line (~3.4 compatibility) Starting at ~3.4 the output is now `embed: serving insecure client requests on 127.0.0.1:2379, this is strongly discouraged!` so `client requests on` still matches both --- pifpaf/drivers/etcd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pifpaf/drivers/etcd.py b/pifpaf/drivers/etcd.py index 8d5f556..bda95b6 100644 --- a/pifpaf/drivers/etcd.py +++ b/pifpaf/drivers/etcd.py @@ -69,7 +69,7 @@ def _setUp(self): for i, (peer_url, client_url) in enumerate(http_urls)), "--initial-cluster-state", "new", - ], wait_for_line="listening for client requests on") + ], wait_for_line="client requests on") endpoints = ",".join(client_url for peer_url, client_url in http_urls) @@ -81,7 +81,7 @@ def _setUp(self): "--listen-peer-urls", peer_url, "--listen-client-urls", client_url, "--advertise-client-urls", client_url], - wait_for_line="listening for client requests on") + wait_for_line="client requests on") endpoints = client_url self.putenv("ETCD_PORT", str(self.port)) From 696a3b3b16ba26921bcccc30480a1c6e13960e50 Mon Sep 17 00:00:00 2001 From: Matt Wheeler Date: Wed, 6 Nov 2019 11:13:28 +0000 Subject: [PATCH 2/4] fetch etcd 3.4.3 --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index c583d1b..58da326 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,10 @@ before_install: - wget https://archive.apache.org/dist/kafka/2.6.0/kafka_2.12-2.6.0.tgz -O /opt/kafka.tar.gz - tar -xzf /opt/kafka.tar.gz -C /opt - ln -s /opt/kafka_2.12-2.6.0 /opt/kafka + - wget https://github.com/etcd-io/etcd/releases/download/v3.4.3/etcd-v3.4.3-linux-amd64.tar.gz -O /opt/etcd.tar.gz + - sudo tar -zxf /opt/etcd.tar.gz -C /opt + - sudo ln -s /opt/etcd-v3.4.3-linux-amd64/etcd /usr/local/bin/etcd + - sudo ln -s /opt/etcd-v3.4.3-linux-amd64/etcdctl /usr/local/bin/etcdctl install: # The install requirements in travis virtualenv that will be cached - pip install tox-travis .[test,ceph] From ae6b1b882706d1af75122b9651d238185c441b72 Mon Sep 17 00:00:00 2001 From: Matt Wheeler Date: Wed, 6 Nov 2019 12:26:52 +0000 Subject: [PATCH 3/4] don't hide output in `_run()` --- pifpaf/tests/test_drivers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pifpaf/tests/test_drivers.py b/pifpaf/tests/test_drivers.py index d78d8da..870b3e8 100644 --- a/pifpaf/tests/test_drivers.py +++ b/pifpaf/tests/test_drivers.py @@ -79,7 +79,7 @@ def setUp(self): ) def _run(self, cmd): - self.assertEqual(0, os.system(cmd + " >/dev/null 2>&1")) + self.assertEqual(0, os.system(cmd)) def _do_test_stuck(self, cmd): d = drivers.Driver(debug=True) From 9ee14bc100c88c64cf86e17ef4a104619c5d1578 Mon Sep 17 00:00:00 2001 From: Matt Wheeler Date: Wed, 6 Nov 2019 12:40:55 +0000 Subject: [PATCH 4/4] ETCDCTL_API=3 is the default from v3.4 --- pifpaf/tests/test_drivers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pifpaf/tests/test_drivers.py b/pifpaf/tests/test_drivers.py index 870b3e8..32aae20 100644 --- a/pifpaf/tests/test_drivers.py +++ b/pifpaf/tests/test_drivers.py @@ -129,7 +129,7 @@ def test_etcd(self): self.assertEqual(str(port), os.getenv("PIFPAF_ETCD_PORT")) r = requests.get("http://localhost:%d/version" % port) self.assertEqual(200, r.status_code) - self._run("etcdctl cluster-health") + self._run("etcdctl endpoint health") @testtools.skipUnless(spawn.find_executable("etcd"), "etcd not found") @@ -143,7 +143,7 @@ def test_etcd_cluster(self): self.assertEqual(str(port), os.getenv("PIFPAF_ETCD_PORT")) r = requests.get("http://localhost:%d/version" % port) self.assertEqual(200, r.status_code) - self._run("etcdctl cluster-health") + self._run("etcdctl endpoint health") @testtools.skipUnless(spawn.find_executable("consul"), "consul not found")