summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Windisch <eric@cloudscaling.com>2012-07-13 20:30:49 -0400
committerEric Windisch <eric@cloudscaling.com>2012-07-20 12:22:24 -0400
commitd9282aa3021d07d7c96351448da69f60b5e2ff51 (patch)
tree17f8fee67470f602dad5d1077197abdd32316cd8
parenta852c832e4576e69eb3b15a5989375c79a3aac46 (diff)
downloadoslo-d9282aa3021d07d7c96351448da69f60b5e2ff51.tar.gz
oslo-d9282aa3021d07d7c96351448da69f60b5e2ff51.tar.xz
oslo-d9282aa3021d07d7c96351448da69f60b5e2ff51.zip
Make test_zmq bind/send to 127.0.0.1
By default, the impl_zmq driver binds to '*' (0.0.0.0); For the purposes of testing, we only need to bind to 127.0.0.1. Binding to all interfaces could be potentially dangerous, may simply not work in some environments, etc. In particular, we do not want our Jenkins slaves to be listening on public interfaces. rpc_zmq_host is set to 127.0.0.1 as well, which avoids hostname resolution. Normally, rpc_zmq_host is set to socket.hostname, which normally should resolve to localhost, but we do not want to test that here. Change-Id: I1224799bb399ceaf79088dd622be4b6823f29a41
-rw-r--r--tests/unit/rpc/test_zmq.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/unit/rpc/test_zmq.py b/tests/unit/rpc/test_zmq.py
index f4da0e1..42105b2 100644
--- a/tests/unit/rpc/test_zmq.py
+++ b/tests/unit/rpc/test_zmq.py
@@ -54,6 +54,9 @@ class _RpcZmqBaseTestCase(common.BaseRpcTestCase):
FLAGS.register_opts(rpc.rpc_opts)
self.rpc = impl_zmq
self.rpc.register_opts(FLAGS)
+
+ FLAGS.set_override('rpc_zmq_bind_address', '127.0.0.1')
+ FLAGS.set_override('rpc_zmq_host', '127.0.0.1')
FLAGS.set_default('rpc_zmq_matchmaker',
'mod_matchmaker.MatchMakerLocalhost')