Skip to content

Commit d5072e5

Browse files
authored
Merge pull request #21 from stackhpc/upstream/yoga-2023-01-04
Synchronise yoga with upstream
2 parents 0615e11 + 2bf242a commit d5072e5

File tree

5 files changed

+65
-21
lines changed

5 files changed

+65
-21
lines changed

neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1990,7 +1990,7 @@ def update_network(self, context, network, original_network=None):
19901990
if any([p for p in lswitch.ports if
19911991
p.type == ovn_const.LSP_TYPE_EXTERNAL]):
19921992
# Check for changes in the network Availability Zones
1993-
ovn_ls_azs = lswitch_name.external_ids.get(
1993+
ovn_ls_azs = lswitch.external_ids.get(
19941994
ovn_const.OVN_AZ_HINTS_EXT_ID_KEY, '')
19951995
neutron_net_azs = lswitch_params['external_ids'].get(
19961996
ovn_const.OVN_AZ_HINTS_EXT_ID_KEY, '')

neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,40 @@ def test_external_port_update_switchdev_vnic_direct_physical(self):
790790
def test_external_port_update_switchdev_vnic_macvtap(self):
791791
self._test_external_port_update_switchdev(portbindings.VNIC_MACVTAP)
792792

793+
def test_external_port_network_update(self):
794+
net_id = self.n1['network']['id']
795+
port_data = {
796+
'port': {'network_id': net_id,
797+
'tenant_id': self._tenant_id,
798+
portbindings.VNIC_TYPE: 'direct'}}
799+
800+
# Create external port
801+
port_req = self.new_create_request('ports', port_data, self.fmt)
802+
port_res = port_req.get_response(self.api)
803+
port = self.deserialize(self.fmt, port_res)['port']
804+
ovn_port = self._find_port_row_by_name(port['id'])
805+
self.assertEqual(ovn_const.LSP_TYPE_EXTERNAL, ovn_port.type)
806+
# Update MTU of network with external port
807+
mtu_value = self.n1['network']['mtu'] - 100
808+
dhcp_options = (
809+
self.mech_driver._ovn_client._nb_idl.get_subnet_dhcp_options(
810+
self.sub['subnet']['id'])
811+
)
812+
self.assertNotEqual(
813+
int(dhcp_options['subnet']['options']['mtu']),
814+
mtu_value)
815+
data = {'network': {'mtu': mtu_value}}
816+
req = self.new_update_request(
817+
'networks', data, self.n1['network']['id'], self.fmt)
818+
req.get_response(self.api)
819+
dhcp_options = (
820+
self.mech_driver._ovn_client._nb_idl.get_subnet_dhcp_options(
821+
self.sub['subnet']['id'])
822+
)
823+
self.assertEqual(
824+
int(dhcp_options['subnet']['options']['mtu']),
825+
mtu_value)
826+
793827

794828
class TestSecurityGroup(base.TestOVNFunctionalBase):
795829

playbooks/configure_functional_job.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
- hosts: all
22
roles:
3-
- ensure-tox
3+
- role: ensure-tox
4+
vars:
5+
ensure_tox_version: "<4"
46
# TODO(slaweq): remove it when nftables will support syntax for src and
57
# destination IP addresses in arp tables:
68
- legacy_ebtables

playbooks/run_functional_job.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
bindep_profile: test
55
bindep_dir: "{{ zuul_work_dir }}"
66
- test-setup
7-
- ensure-tox
7+
- role: ensure-tox
8+
vars:
9+
ensure_tox_version: "<4"
810
- tox

tox.ini

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
envlist = docs,py38,pep8
33
minversion = 3.18.0
4-
skipsdist = True
4+
skipsdist = False
55
ignore_basepython_conflict = True
66

77
[testenv]
@@ -12,16 +12,24 @@ setenv = VIRTUAL_ENV={envdir}
1212
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
1313
OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:180}
1414
PYTHONWARNINGS=default::DeprecationWarning,ignore::DeprecationWarning:distutils,ignore::DeprecationWarning:site
15-
passenv = TRACE_FAILONLY GENERATE_HASHES http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY TOX_ENV_SRC_MODULES
15+
passenv = TRACE_FAILONLY
16+
GENERATE_HASHES
17+
http_proxy
18+
HTTP_PROXY
19+
https_proxy
20+
HTTPS_PROXY
21+
no_proxy
22+
NO_PROXY
23+
TOX_ENV_SRC_MODULES
1624
usedevelop = True
1725
deps =
1826
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/yoga}
1927
-r{toxinidir}/requirements.txt
2028
-r{toxinidir}/test-requirements.txt
2129
hacking>=3.0.1,<3.1.0 # Apache-2.0
22-
allowlist_externals = sh
30+
allowlist_externals = bash
2331
commands =
24-
{toxinidir}/tools/pip_install_src_modules.sh "{toxinidir}"
32+
bash {toxinidir}/tools/pip_install_src_modules.sh "{toxinidir}"
2533
stestr run {posargs}
2634

2735
# there is also secret magic in ostestr which lets you run in a fail only
@@ -63,7 +71,7 @@ setenv = {[testenv:functional]setenv}
6371
deps =
6472
{[testenv:functional]deps}
6573
commands =
66-
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
74+
bash {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
6775
stestr run --exclude-regex (.*MySQL\.|.*PostgreSQL\.) {posargs}
6876
stestr run --combine --concurrency 1 (.*MySQL\.|.*PostgreSQL\.) {posargs}
6977

@@ -80,16 +88,16 @@ setenv = {[testenv]setenv}
8088
deps =
8189
{[testenv:functional]deps}
8290
commands =
83-
{toxinidir}/tools/generate_dhclient_script_for_fullstack.sh {envdir}
84-
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
91+
bash {toxinidir}/tools/generate_dhclient_script_for_fullstack.sh {envdir}
92+
bash {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
8593
stestr run --concurrency 2 {posargs}
8694

8795
[testenv:dsvm-fullstack-gate]
8896
setenv = {[testenv:dsvm-fullstack]setenv}
8997
deps = {[testenv:dsvm-fullstack]deps}
9098
commands =
91-
{toxinidir}/tools/generate_dhclient_script_for_fullstack.sh {envdir}
92-
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
99+
bash {toxinidir}/tools/generate_dhclient_script_for_fullstack.sh {envdir}
100+
bash {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
93101
stestr run --concurrency 2 --black-regex neutron.tests.fullstack.test_securitygroup.TestSecurityGroupsSameNetwork.test_securitygroup {posargs}
94102
stestr run --combine --concurrency 1 neutron.tests.fullstack.test_securitygroup.TestSecurityGroupsSameNetwork.test_securitygroup {posargs}
95103

@@ -108,20 +116,18 @@ deps =
108116
pylint==2.5.3 # GPLv2
109117
commands=
110118
# If it is easier to add a check via a shell script, consider adding it in this file
111-
sh ./tools/misc-sanity-checks.sh
112-
{toxinidir}/tools/check_unit_test_structure.sh
119+
bash ./tools/misc-sanity-checks.sh
120+
bash {toxinidir}/tools/check_unit_test_structure.sh
113121
# Checks for coding and style guidelines
114122
flake8
115-
sh ./tools/coding-checks.sh --pylint '{posargs}'
123+
bash ./tools/coding-checks.sh --pylint '{posargs}'
116124
neutron-db-manage --config-file neutron/tests/etc/neutron.conf check_migration
117125
python ./tools/list_moved_globals.py
118126
{[testenv:genconfig]commands}
119127
{[testenv:bashate]commands}
120128
{[testenv:bandit]commands}
121129
{[testenv:genpolicy]commands}
122-
allowlist_externals =
123-
sh
124-
bash
130+
allowlist_externals = bash
125131

126132
[testenv:cover]
127133
envdir = {toxworkdir}/shared
@@ -238,7 +244,7 @@ commands = bash -c "find {toxinidir} \
238244

239245
[testenv:genconfig]
240246
envdir = {toxworkdir}/shared
241-
commands = {toxinidir}/tools/generate_config_file_samples.sh
247+
commands = bash {toxinidir}/tools/generate_config_file_samples.sh
242248

243249
[testenv:genpolicy]
244250
envdir = {toxworkdir}/shared
@@ -257,6 +263,6 @@ commands = bindep test
257263
[testenv:requirements]
258264
deps =
259265
-egit+https://opendev.org/openstack/requirements#egg=openstack-requirements
260-
allowlist_externals = sh
266+
allowlist_externals = bash
261267
commands =
262-
sh -c '{envdir}/src/openstack-requirements/playbooks/files/project-requirements-change.py --req {envdir}/src/openstack-requirements --local {toxinidir} master'
268+
bash -c '{envdir}/src/openstack-requirements/playbooks/files/project-requirements-change.py --req {envdir}/src/openstack-requirements --local {toxinidir} master'

0 commit comments

Comments
 (0)