def test_etcd(self): port = 4005 self.useFixture(etcd.EtcdDriver(port=port)) self.assertEqual("etcd://localhost:%d" % port, os.getenv("PIFPAF_URL")) self.assertEqual(str(port), os.getenv("PIFPAF_ETCD_PORT")) r = requests.get("http://localhost:%d/version" % port) self.assertEqual(200, r.status_code)
def test_etcd_cluster(self): port = 4007 peer_port = 4008 self.useFixture( etcd.EtcdDriver(port=port, peer_port=peer_port, cluster=True)) self.assertEqual("etcd://localhost:%d" % port, os.getenv("PIFPAF_URL")) 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")