Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1987,7 +1987,7 @@ def update_network(self, context, network, original_network=None):
if any([p for p in lswitch.ports if
p.type == ovn_const.LSP_TYPE_EXTERNAL]):
# Check for changes in the network Availability Zones
ovn_ls_azs = lswitch_name.external_ids.get(
ovn_ls_azs = lswitch.external_ids.get(
ovn_const.OVN_AZ_HINTS_EXT_ID_KEY, '')
neutron_net_azs = lswitch_params['external_ids'].get(
ovn_const.OVN_AZ_HINTS_EXT_ID_KEY, '')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,40 @@ def test_external_port_update_switchdev_vnic_direct_physical(self):
def test_external_port_update_switchdev_vnic_macvtap(self):
self._test_external_port_update_switchdev(portbindings.VNIC_MACVTAP)

def test_external_port_network_update(self):
net_id = self.n1['network']['id']
port_data = {
'port': {'network_id': net_id,
'tenant_id': self._tenant_id,
portbindings.VNIC_TYPE: 'direct'}}

# Create external port
port_req = self.new_create_request('ports', port_data, self.fmt)
port_res = port_req.get_response(self.api)
port = self.deserialize(self.fmt, port_res)['port']
ovn_port = self._find_port_row_by_name(port['id'])
self.assertEqual(ovn_const.LSP_TYPE_EXTERNAL, ovn_port.type)
# Update MTU of network with external port
mtu_value = self.n1['network']['mtu'] - 100
dhcp_options = (
self.mech_driver._ovn_client._nb_idl.get_subnet_dhcp_options(
self.sub['subnet']['id'])
)
self.assertNotEqual(
int(dhcp_options['subnet']['options']['mtu']),
mtu_value)
data = {'network': {'mtu': mtu_value}}
req = self.new_update_request(
'networks', data, self.n1['network']['id'], self.fmt)
req.get_response(self.api)
dhcp_options = (
self.mech_driver._ovn_client._nb_idl.get_subnet_dhcp_options(
self.sub['subnet']['id'])
)
self.assertEqual(
int(dhcp_options['subnet']['options']['mtu']),
mtu_value)


class TestSecurityGroup(base.TestOVNFunctionalBase):

Expand Down
4 changes: 3 additions & 1 deletion playbooks/configure_functional_job.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
- hosts: all
roles:
- ensure-tox
- role: ensure-tox
vars:
ensure_tox_version: "<4"
# TODO(slaweq): remove it when nftables will support syntax for src and
# destination IP addresses in arp tables:
- legacy_ebtables
Expand Down
4 changes: 3 additions & 1 deletion playbooks/run_functional_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
bindep_profile: test
bindep_dir: "{{ zuul_work_dir }}"
- test-setup
- ensure-tox
- role: ensure-tox
vars:
ensure_tox_version: "<4"
- tox
42 changes: 24 additions & 18 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist = docs,py38,pep8
minversion = 3.18.0
skipsdist = True
skipsdist = False
ignore_basepython_conflict = True

[testenv]
Expand All @@ -12,16 +12,24 @@ setenv = VIRTUAL_ENV={envdir}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:180}
PYTHONWARNINGS=default::DeprecationWarning,ignore::DeprecationWarning:distutils,ignore::DeprecationWarning:site
passenv = TRACE_FAILONLY GENERATE_HASHES http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY TOX_ENV_SRC_MODULES
passenv = TRACE_FAILONLY
GENERATE_HASHES
http_proxy
HTTP_PROXY
https_proxy
HTTPS_PROXY
no_proxy
NO_PROXY
TOX_ENV_SRC_MODULES
usedevelop = True
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/yoga}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
hacking>=3.0.1,<3.1.0 # Apache-2.0
allowlist_externals = sh
allowlist_externals = bash
commands =
{toxinidir}/tools/pip_install_src_modules.sh "{toxinidir}"
bash {toxinidir}/tools/pip_install_src_modules.sh "{toxinidir}"
stestr run {posargs}

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

Expand All @@ -80,16 +88,16 @@ setenv = {[testenv]setenv}
deps =
{[testenv:functional]deps}
commands =
{toxinidir}/tools/generate_dhclient_script_for_fullstack.sh {envdir}
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
bash {toxinidir}/tools/generate_dhclient_script_for_fullstack.sh {envdir}
bash {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
stestr run --concurrency 2 {posargs}

[testenv:dsvm-fullstack-gate]
setenv = {[testenv:dsvm-fullstack]setenv}
deps = {[testenv:dsvm-fullstack]deps}
commands =
{toxinidir}/tools/generate_dhclient_script_for_fullstack.sh {envdir}
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
bash {toxinidir}/tools/generate_dhclient_script_for_fullstack.sh {envdir}
bash {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
stestr run --concurrency 2 --black-regex neutron.tests.fullstack.test_securitygroup.TestSecurityGroupsSameNetwork.test_securitygroup {posargs}
stestr run --combine --concurrency 1 neutron.tests.fullstack.test_securitygroup.TestSecurityGroupsSameNetwork.test_securitygroup {posargs}

Expand All @@ -108,20 +116,18 @@ deps =
pylint==2.5.3 # GPLv2
commands=
# If it is easier to add a check via a shell script, consider adding it in this file
sh ./tools/misc-sanity-checks.sh
{toxinidir}/tools/check_unit_test_structure.sh
bash ./tools/misc-sanity-checks.sh
bash {toxinidir}/tools/check_unit_test_structure.sh
# Checks for coding and style guidelines
flake8
sh ./tools/coding-checks.sh --pylint '{posargs}'
bash ./tools/coding-checks.sh --pylint '{posargs}'
neutron-db-manage --config-file neutron/tests/etc/neutron.conf check_migration
python ./tools/list_moved_globals.py
{[testenv:genconfig]commands}
{[testenv:bashate]commands}
{[testenv:bandit]commands}
{[testenv:genpolicy]commands}
allowlist_externals =
sh
bash
allowlist_externals = bash

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

[testenv:genconfig]
envdir = {toxworkdir}/shared
commands = {toxinidir}/tools/generate_config_file_samples.sh
commands = bash {toxinidir}/tools/generate_config_file_samples.sh

[testenv:genpolicy]
envdir = {toxworkdir}/shared
Expand All @@ -257,6 +263,6 @@ commands = bindep test
[testenv:requirements]
deps =
-egit+https://opendev.org/openstack/requirements#egg=openstack-requirements
allowlist_externals = sh
allowlist_externals = bash
commands =
sh -c '{envdir}/src/openstack-requirements/playbooks/files/project-requirements-change.py --req {envdir}/src/openstack-requirements --local {toxinidir} master'
bash -c '{envdir}/src/openstack-requirements/playbooks/files/project-requirements-change.py --req {envdir}/src/openstack-requirements --local {toxinidir} master'