diff --git a/zaqarclient/tests/queues/base.py b/zaqarclient/tests/queues/base.py index 08a0d9f4..dc654398 100644 --- a/zaqarclient/tests/queues/base.py +++ b/zaqarclient/tests/queues/base.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import subprocess from unittest import mock from oslo_utils import netutils @@ -21,14 +22,18 @@ from zaqarclient.queues import client from zaqarclient.tests import base from zaqarclient.tests.transport import dummy - -MY_IP = netutils.get_my_ipv4() +cmd = 'cat /etc/zaqar/uwsgi.conf | grep http' +MY_HOST_IP = subprocess.run(cmd, shell=True, capture_output=True, text=True) +if len(MY_HOST_IP.stdout.split("= ")) < 2: + MY_IP = netutils.get_my_ipv4() + ':8888' +else: + MY_IP = MY_HOST_IP.stdout.split("= ")[1] class QueuesTestBase(base.TestBase): transport_cls = dummy.DummyTransport - url = 'http://%s:8888' % MY_IP + url = 'http://%s' % MY_IP version = 1 def setUp(self):