Browse Source

Convert CI jobs to python 3

This change ensures all CI jobs run against neutron-dynamic-routing
run with python 3 and all test code is compatible with python 3.

Change-Id: I77f940dca9239d710bb146e8cdf1d6058f2fbdd4
changes/09/657409/8
Ryan Tidwell 2 years ago
parent
commit
a32c6f8c23
No known key found for this signature in database GPG Key ID: A1C63854C1CDF372
  1. 4
      neutron_dynamic_routing/tests/tempest/scenario/base.py
  2. 10
      neutron_dynamic_routing/tests/tempest/scenario/base_test_proto.py
  3. 6
      neutron_dynamic_routing/tests/tempest/scenario/basic/test_basic.py
  4. 1
      playbooks/neutron-dynamic-routing-dsvm-functional/run.yaml
  5. 1
      playbooks/neutron-dynamic-routing-dsvm-tempest-api/run.yaml
  6. 1
      playbooks/neutron-dynamic-routing-dsvm-tempest-scenario-basic/run.yaml
  7. 1
      playbooks/neutron-dynamic-routing-dsvm-tempest-scenario-ipv4/run.yaml
  8. 1
      playbooks/neutron-dynamic-routing-dsvm-tempest-scenario-ipv6/run.yaml
  9. 1
      playbooks/neutron-dynamic-routing-dsvm-tempest-with-os-ken-master-scenario-ipv4/run.yaml
  10. 3
      tox.ini

4
neutron_dynamic_routing/tests/tempest/scenario/base.py

@ -124,10 +124,10 @@ class BgpSpeakerScenarioTestJSONBase(base.BaseAdminNetworkTest):
while True:
with self.lock:
try:
yield (i, str(subnet_gen.next()))
yield (i, str(next(subnet_gen)))
except StopIteration:
subnet_gen = netaddr.iter_iprange(start, end, step=step)
yield (i, str(subnet_gen.next()))
yield (i, str(next(subnet_gen)))
i += 1
def net_resource_cleanup(self):

10
neutron_dynamic_routing/tests/tempest/scenario/base_test_proto.py

@ -27,7 +27,7 @@ class BgpSpeakerProtoTestBase(base.BgpSpeakerScenarioTestJSONBase):
def _test_check_neighbor_established(self, ip_version):
self.bgp_peer_args[0]['peer_ip'] = self.r_as_ip[0].split('/')[0]
num, subnet = self.tnet_gen.next()
num, subnet = next(self.tnet_gen)
mask = '/' + str(self.TPool.prefixlen)
TNet = base.Net(name='', net=subnet, mask=self.TPool.prefixlen,
cidr=subnet + mask, router=None)
@ -46,7 +46,7 @@ class BgpSpeakerProtoTestBase(base.BgpSpeakerScenarioTestJSONBase):
def _test_check_advertised_tenant_network(self, ip_version):
self.bgp_peer_args[0]['peer_ip'] = self.r_as_ip[0].split('/')[0]
num, subnet = self.tnet_gen.next()
num, subnet = next(self.tnet_gen)
mask = '/' + str(self.TPool.prefixlen)
TNet = base.Net(name='', net=subnet, mask=self.TPool.prefixlen,
cidr=subnet + mask, router=None)
@ -72,7 +72,7 @@ class BgpSpeakerProtoTestBase(base.BgpSpeakerScenarioTestJSONBase):
tnets = []
tnets_cidr = []
for i in range(0, 3):
num, subnet = self.tnet_gen.next()
num, subnet = next(self.tnet_gen)
mask = '/' + str(self.TPool.prefixlen)
TNet = base.Net(name='', net=subnet, mask=self.TPool.prefixlen,
cidr=subnet + mask, router=None)
@ -101,7 +101,7 @@ class BgpSpeakerProtoTestBase(base.BgpSpeakerScenarioTestJSONBase):
for (bgp_peer_args, r_as_ip) in zip(self.bgp_peer_args,
self.r_as_ip):
bgp_peer_args['peer_ip'] = r_as_ip.split('/')[0]
num, subnet = self.tnet_gen.next()
num, subnet = next(self.tnet_gen)
mask = '/' + str(self.TPool.prefixlen)
TNet = base.Net(name='', net=subnet, mask=self.TPool.prefixlen,
cidr=subnet + mask, router=None)
@ -123,7 +123,7 @@ class BgpSpeakerProtoTestBase(base.BgpSpeakerScenarioTestJSONBase):
for (bgp_peer_args, r_as_ip) in zip(self.bgp_peer_args,
self.r_as_ip):
bgp_peer_args['peer_ip'] = r_as_ip.split('/')[0]
num, subnet = self.tnet_gen.next()
num, subnet = next(self.tnet_gen)
mask = '/' + str(self.TPool.prefixlen)
TNet = base.Net(name='', net=subnet, mask=self.TPool.prefixlen,
cidr=subnet + mask, router=None)

6
neutron_dynamic_routing/tests/tempest/scenario/basic/test_basic.py

@ -31,7 +31,7 @@ class BgpSpeakerBasicTest(base.BgpSpeakerBasicTestJSONBase):
@decorators.idempotent_id('cc615252-c6cb-4d75-a70e-608fb2c3736a')
def test_schedule_added_speaker(self):
self.bgp_peer_args[0]['peer_ip'] = self.r_as_ip[0].split('/')[0]
num, subnet = self.tnet_gen.next()
num, subnet = next(self.tnet_gen)
mask = '/' + str(self.TPool.prefixlen)
TNet = s_base.Net(name='', net=subnet, mask=self.TPool.prefixlen,
cidr=subnet + mask, router=None)
@ -51,7 +51,7 @@ class BgpSpeakerBasicTest(base.BgpSpeakerBasicTestJSONBase):
@decorators.idempotent_id('ce98c33c-0ffa-49ae-b365-da836406793b')
def test_unschedule_deleted_speaker(self):
self.bgp_peer_args[0]['peer_ip'] = self.r_as_ip[0].split('/')[0]
num, subnet = self.tnet_gen.next()
num, subnet = next(self.tnet_gen)
mask = '/' + str(self.TPool.prefixlen)
TNet = s_base.Net(name='', net=subnet, mask=self.TPool.prefixlen,
cidr=subnet + mask, router=None)
@ -77,7 +77,7 @@ class BgpSpeakerBasicTest(base.BgpSpeakerBasicTestJSONBase):
@decorators.idempotent_id('aa6c565c-ded3-413b-8dc9-3928b3b0e38f')
def test_remove_add_speaker_agent(self):
self.bgp_peer_args[0]['peer_ip'] = self.r_as_ip[0].split('/')[0]
num, subnet = self.tnet_gen.next()
num, subnet = next(self.tnet_gen)
mask = '/' + str(self.TPool.prefixlen)
TNet = s_base.Net(name='', net=subnet, mask=self.TPool.prefixlen,
cidr=subnet + mask, router=None)

1
playbooks/neutron-dynamic-routing-dsvm-functional/run.yaml

@ -28,6 +28,7 @@
cmd: |
set -e
set -x
export DEVSTACK_GATE_USE_PYTHON3=True
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_UNSTACK=1
export DEVSTACK_GATE_TEMPEST=0

1
playbooks/neutron-dynamic-routing-dsvm-tempest-api/run.yaml

@ -42,6 +42,7 @@
cmd: |
set -e
set -x
export DEVSTACK_GATE_USE_PYTHON3=True
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_TEMPEST=1
if [ "ZUUL_BRANCH" == "stable/newton" ]; then

1
playbooks/neutron-dynamic-routing-dsvm-tempest-scenario-basic/run.yaml

@ -28,6 +28,7 @@
cmd: |
set -e
set -x
export DEVSTACK_GATE_USE_PYTHON3=True
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_TEMPEST=1
export DEVSTACK_GATE_TEMPEST_REGEX="^neutron_dynamic_routing.tests.tempest.scenario.basic\."

1
playbooks/neutron-dynamic-routing-dsvm-tempest-scenario-ipv4/run.yaml

@ -28,6 +28,7 @@
cmd: |
set -e
set -x
export DEVSTACK_GATE_USE_PYTHON3=True
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_TEMPEST=1
export DEVSTACK_GATE_TEMPEST_REGEX="^neutron_dynamic_routing.tests.tempest.scenario.ipv4\."

1
playbooks/neutron-dynamic-routing-dsvm-tempest-scenario-ipv6/run.yaml

@ -28,6 +28,7 @@
cmd: |
set -e
set -x
export DEVSTACK_GATE_USE_PYTHON3=True
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_TEMPEST=1
export DEVSTACK_GATE_TEMPEST_REGEX="^neutron_dynamic_routing.tests.tempest.scenario.ipv6\."

1
playbooks/neutron-dynamic-routing-dsvm-tempest-with-os-ken-master-scenario-ipv4/run.yaml

@ -28,6 +28,7 @@
cmd: |
set -e
set -x
export DEVSTACK_GATE_USE_PYTHON3=True
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_TEMPEST=1
export DEVSTACK_GATE_TEMPEST_REGEX="^neutron_dynamic_routing.tests.tempest.scenario.ipv4\."

3
tox.ini

@ -26,12 +26,14 @@ commands =
# mode. To do this define the TRACE_FAILONLY environmental variable.
[testenv:functional]
basepython = python3
setenv = OS_TEST_PATH=./neutron_dynamic_routing/tests/functional
commands =
stestr run {posargs}
stestr slowest
[testenv:api]
basepython = python3
sitepackages=True
setenv =
OS_TEST_PATH=./neutron_dynamic_routing/tests/tempest/api/
@ -42,6 +44,7 @@ commands =
stestr slowest
[testenv:dsvm-functional]
basepython = python3
setenv =
OS_TEST_PATH=./neutron_dynamic_routing/tests/functional
OS_SUDO_TESTING=1

Loading…
Cancel
Save