Merge "Simplify zaqar endpoint detection in tests"
This commit is contained in:
@@ -7,6 +7,8 @@
|
|||||||
- opendev.org/openstack/zaqar
|
- opendev.org/openstack/zaqar
|
||||||
- opendev.org/openstack/zaqar-tempest-plugin
|
- opendev.org/openstack/zaqar-tempest-plugin
|
||||||
vars:
|
vars:
|
||||||
|
devstack_localrc:
|
||||||
|
ZAQAR_SERVICE_HOST: localhost
|
||||||
devstack_plugins:
|
devstack_plugins:
|
||||||
zaqar: https://opendev.org/openstack/zaqar
|
zaqar: https://opendev.org/openstack/zaqar
|
||||||
devstack_services:
|
devstack_services:
|
||||||
@@ -24,6 +26,8 @@
|
|||||||
# when they have been enabled again by a native Zuul v3 job.
|
# when they have been enabled again by a native Zuul v3 job.
|
||||||
# The failing job can be checked by removing this filter.
|
# The failing job can be checked by removing this filter.
|
||||||
tox_extra_args: -vv -- tests.functional.queues.v2.test_health
|
tox_extra_args: -vv -- tests.functional.queues.v2.test_health
|
||||||
|
tox_environment:
|
||||||
|
ZAQAR_SERVICE_HOST: localhost
|
||||||
|
|
||||||
- project:
|
- project:
|
||||||
templates:
|
templates:
|
||||||
|
2
tox.ini
2
tox.ini
@@ -35,6 +35,8 @@ setenv =
|
|||||||
OS_TEST_PATH = ./tests/functional
|
OS_TEST_PATH = ./tests/functional
|
||||||
ZAQARCLIENT_AUTH_FUNCTIONAL = 1
|
ZAQARCLIENT_AUTH_FUNCTIONAL = 1
|
||||||
ZAQARCLIENT_TEST_FUNCTIONAL = 1
|
ZAQARCLIENT_TEST_FUNCTIONAL = 1
|
||||||
|
passenv =
|
||||||
|
ZAQAR_SERVICE_HOST
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import subprocess
|
import os
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_utils import netutils
|
from oslo_utils import netutils
|
||||||
@@ -22,18 +22,14 @@ from zaqarclient.queues import client
|
|||||||
from zaqarclient.tests import base
|
from zaqarclient.tests import base
|
||||||
from zaqarclient.tests.transport import dummy
|
from zaqarclient.tests.transport import dummy
|
||||||
|
|
||||||
cmd = 'cat /etc/zaqar/uwsgi.conf | grep http'
|
|
||||||
MY_HOST_IP = subprocess.run(cmd, shell=True, capture_output=True, text=True)
|
MY_IP = os.environ.get('ZAQAR_SERVICE_HOST', netutils.get_my_ipv4())
|
||||||
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):
|
class QueuesTestBase(base.TestBase):
|
||||||
|
|
||||||
transport_cls = dummy.DummyTransport
|
transport_cls = dummy.DummyTransport
|
||||||
url = 'http://%s' % MY_IP
|
url = 'http://%s:8888' % netutils.escape_ipv6(MY_IP)
|
||||||
version = 1
|
version = 1
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
Reference in New Issue
Block a user