commit 25d24f209663c0b35968c48c24120c45f79e2b31
Author: Maciej Józefczyk <email address hidden>
Date: Thu Aug 8 12:25:13 2019 +0000
Do not modify passed by reference variables in mechanism_driver
Test test_update_port_with_empty_data [0] from TestOVNMechanismDriverPortsV2
class in neutron is runned agains:
neutron.tests.unit.plugins.ml2.drivers.mechanism_test.TestMechanismDriver
which in fact during update_port_postcommit() does nothing with
the port, only validates it [1].
In networking-ovn this test is runned against real mechanism driver:
networking_ovn.ml2.mech_driver.OVNMechanismDriver. This ends with
little difference - to port dict 'network' information is added
during call of update_port_postcommit(). The port data itself
remains the same.
We shouldn't modify passed by reference variables there. So doing
deepcopy on all provided data.
Here comes also the question if this test inheritance is the
right way.
Reviewed: https:/ /review. opendev. org/675603 /git.openstack. org/cgit/ openstack/ networking- ovn/commit/ ?id=25d24f20966 3c0b35968c48c24 120c45f79e2b31
Committed: https:/
Submitter: Zuul
Branch: stable/rocky
commit 25d24f209663c0b 35968c48c24120c 45f79e2b31
Author: Maciej Józefczyk <email address hidden>
Date: Thu Aug 8 12:25:13 2019 +0000
Do not modify passed by reference variables in mechanism_driver
Test test_update_ port_with_ empty_data [0] from TestOVNMechanis mDriverPortsV2 tests.unit. plugins. ml2.drivers. mechanism_ test.TestMechan ismDriver port_postcommit () does nothing with
class in neutron is runned agains:
neutron.
which in fact during update_
the port, only validates it [1].
In networking-ovn this test is runned against real mechanism driver: ovn.ml2. mech_driver. OVNMechanismDri ver. This ends with port_postcommit (). The port data itself
networking_
little difference - to port dict 'network' information is added
during call of update_
remains the same.
We shouldn't modify passed by reference variables there. So doing
deepcopy on all provided data.
Here comes also the question if this test inheritance is the
right way.
[0] https:/ /review. opendev. org/#/c/ 673486 /github. com/openstack/ neutron/ blob/master/ neutron/ tests/unit/ plugins/ ml2/drivers/ mechanism_ test.py# L208
[1] https:/
Closes-Bug: #1839434 896f6eb8049a188 d9e82874068 a757c62fc6e3027 7365dae456) 16cc49311099a8d b7fbcbcda3)
Change-Id: I1ad224960173fe
(cherry picked from commit b2b5e89bca25570
(cherry picked from commit 36bd132b409b824