From 35d50a5de755b779d61e04f0624ad8b854d3af00 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Fri, 8 Mar 2013 15:41:17 -0500 Subject: [PATCH] Use a non-standard port for the test server Start the test API server on a non-standard port to avoid conflicting with a server already running due to devstack. Change-Id: I010c76376048e3433301ccc64ce35db11e69a3e7 Signed-off-by: Doug Hellmann --- tests/test_bin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_bin.py b/tests/test_bin.py index 4d6757b88..de7f62f64 100644 --- a/tests/test_bin.py +++ b/tests/test_bin.py @@ -20,6 +20,7 @@ import httplib2 import json import os +import random import socket import subprocess import tempfile @@ -67,11 +68,13 @@ class BinSendCounterTestCase(unittest.TestCase): class BinApiTestCase(unittest.TestCase): def setUp(self): - self.api_port = 8777 + self.api_port = random.randint(10000, 11000) self.http = httplib2.Http() self.tempfile = tempfile.mktemp() with open(self.tempfile, 'w') as tmp: tmp.write("[DEFAULT]\n") + tmp.write( + "metering_api_port=%s\n" % self.api_port) tmp.write( "rpc_backend=ceilometer.openstack.common.rpc.impl_fake\n") tmp.write("database_connection=log://localhost\n")