Commit Graph

101 Commits

Author SHA1 Message Date
Rodolfo Alonso Hernandez f7baab86ac Bump Neutron to 23.0.0.0b3
That syncs the Neutron code with the latest neutron-lib version
released (3.8.0).

This patch also adds the "network.ha" definition extension to
the tests core plugin.

NOTE: both LP bugs must be fixed in one patch to fix the unit
tests CI job.

Closes-Bug: #2033493
Closes-Bug: #2033508
Change-Id: Ie22d9bcb943205e20380b92dc33d48f398a86470
2023-08-31 11:03:14 +00:00
Felix Huettner bf54f03ce5 fix unittest issues caused by neutron rbac changes
neutron recently merged a commit enabling secure rbacs by default [1].
However this commit breaks the unittests of neutron-dynamic-routing.
To fix this we run multiple calls as admin, to allow them to succeed.

[1]: 670cc383e0

Closes-Bug: 2019097
Change-Id: Iadc9b819ce4aaf6029e77f53ce0616aa70119c70
2023-05-17 10:23:32 +02:00
Takashi Natsume 1c15cd1bc5 Fix misuse of assertTrue
Replace assertTrue with assertEqual.

Change-Id: I0f0b6e5a7a4b7799ecda2fcc5b5179c0f97fd44f
Closes-Bug: 1989254
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2022-09-10 22:17:59 +09:00
Zuul be4bf54c30 Merge "Drop dsvm-functional tox env and related files" 2021-09-27 08:44:55 +00:00
Nurmatov Mamatisa cae03eaa49 Use payload style callback
Neutron-lib registry.notify will be removed

Change-Id: I5d773851136759117b048660d34209a601054a69
2021-09-13 12:31:13 +00:00
Manu B 630678b5f9 Payload changes for FLOATING_IP events
Depends-On: https://review.opendev.org/#/c/798009

Signed-off-by: Manu B <manu.b@est.tech>
Change-Id: I4c6e04b82426ebbe41273fbc584ee3e8df70aead
2021-09-06 07:01:24 +00:00
elajkat b8b8788d23 Use payload for PORT and FLOATING_IP events
* Updated callback functions port_callback,
  floatingip_update_callback to include payload
* Fixed unit test cases

Change-Id: I84956d86ea45039a8841b2b1f4f02bf373efcef5
Signed-off-by: Manu B <manu.b@est.tech>
2021-09-02 09:49:30 +00:00
Jens Harbott 03876054ad Drop dsvm-functional tox env and related files
We no longer run any devstack-gate-based jobs, remove the tox env for it
and the auxillary files.

Change-Id: Ide2fe6ca75370c52180795cc2596be482c862523
2021-08-11 09:22:22 +02:00
elajkat c021b106d9 Use bgp api-def from neutron-lib
As neutron-dynamic-routing is a Neutron stadium project the api-def
and the api-ref should be in neutron-lib.

Change-Id: Idccc69f025a0d1ec0453d13a7d81b94e3a15149d
Depends-On: https://review.opendev.org/c/openstack/neutron-lib/+/788322
2021-05-31 12:32:55 +00:00
Aggelos Kolaitis 43f50d5d9b
Fix TypeError when formatting BGP IP address.
floating_ip_address may be a netaddr.IPAddress, and using '+'
to append the /32 suffix raises a TypeError. Explicitly convert to
string before appending the suffix.

Additionally, introduce a unit test case for floatingip_update_callback
to test that the error does not re-appear.

Closes-Bug: #1924237
Signed-off-by: Aggelos Kolaitis <akolaitis@admin.grnet.gr>
Change-Id: I98d266fb986649f1d14969c968baa2f93b469f73
2021-04-15 21:02:15 +03:00
melissaml 6c094dbb3c Switch from unittest2 compat methods to Python 3.x methods
With the removal of Python 2.x we can remove the unittest2 compat
wrappers and switch to assertCountEqual instead of assertItemsEqual

We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.

[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277

Change-Id: If5dc6ebffc7b4f031b0350a4fe77a660a1e7becf
2020-07-05 19:38:34 +08:00
zhanghao f8f9463cf7 Remove usage of six
With python3.x, classes can use 'metaclass=' instead of
'six.add_metaclass', 'six.integer_type' can be replaced
by 'int', 'six.string_type' and 'six.text_type' are just
'str'.

Change-Id: I40a020aa4a8e69a8dd7e800352dc54a9e694d500
2020-05-27 06:58:27 -04:00
Sean McGinnis 95cdf705a1
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: Ic767e59531bc2515cc1c20675792fe88300e3f30
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-05-13 07:02:49 -05:00
Bernard Cafarelli fd72823d20
Switch functional job to Zuulv3 syntax
This patch switches from legacy job to a Zuul v3 job inheriting from
neutron-functional job definition.

Also cleaning up relevant files for legacy job

Change-Id: I419c98d58637d57c3a2436630dd787b17f9027d5
2020-01-21 11:50:43 +01:00
Nate Johnston e760a49f67 Remove tempest tests that have moved to neutron-tempest-plugin
This patch removes all tempest tests from neutron-dynamic-routing
repository as all of them are now moved to neutron-tempest-plugin repo.
It also removes all tempest job definitions which are now replaced by
job neutron-tempest-plugin-dynamic-routing defined in
neutron-tempest-plugin repo directly.

Change-Id: I94a443c92fe2317ba2591ae3a227ec8df82ec294
2019-11-19 10:24:16 -05:00
Ryan Tidwell a32c6f8c23
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
2019-05-21 13:58:53 -05:00
gujin dace47cc07 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: Ied57440e9e9f918ca685bd3738716cd52f7719b2
2019-05-13 21:09:03 +08:00
Zuul d81049babb Merge "Ignore DrAgentAssociationError in test_remove_add_speaker_agent" 2019-05-06 10:23:31 +00:00
zhulingjie bb7a0fb1cb Update hacking version
Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: Iaeebe7f3f76339f0c34c9e0f4db838ec192dbd83
2019-04-29 13:50:34 +08:00
Boden R ec6bfd4f6c stop using common_db_mixin
This patch removes all use of common_db_mixin. All methods of that
class are available in some form from neutron-lib and we are removing
the mixing from neutron soon.

Change-Id: I80d17a491d4468a94f4ae184f1b453f41cdf92a2
2019-03-28 11:47:38 -06:00
Ryan Tidwell efaf23a962 Ignore DrAgentAssociationError in test_remove_add_speaker_agent
The BGP service plugin will automatically re-schedule BGP speakers
that are unscheduled with a periodic job. This introduces a race
condition that the basic scenario test job needs to account for. This
change causes the test_remove_add_speaker_agent() test to ignore
any DrAgentAssociationError when attempting to explicitly reschedule
a BGP speaker that has just unscheduled. Since the content of the
test is not affected by catching and ignoring these errors, we can
safely ignore the error while enabling the test to pass consistently.

Change-Id: I10b11ae52b36552d448cecaea03cfa1baaca026a
Closes-Bug: #1820293
2019-03-15 21:35:08 +00:00
Slawek Kaplonski c27bb1f190 Fix installation of docker when docker-engine is not available
In such case docker.io should be installed. It happens e.g. on
Ubuntu 18.04.
In gate_hook script there was code to handle such case when
docker-engine isn't available but grep used there wasn't
very strict and it was passing because package
"golang-github-docker-engine-api-dev" matched results.

Now it will look only for "docker-engine" package and if it will
not be available, "docker.io" will be installed.

Change-Id: I805761ba4523e71a5aa06f6f6667e801184824df
Closes-Bug: #1818628
2019-03-11 13:04:27 +00:00
Ryan Tidwell 69e9888b01
Implement DVR-aware fixed IP lookups
This change adds DVR-aware announcements for routable fixed IP's
to be sent, thereby routing traffic directly to the appropriate
compute node instead of the centralized router on the network node.

Change-Id: I3aecdd7979dba97dab12a6550655c90a57f56cb3
Partial-Bug: #1775250
2019-03-03 10:00:06 -06:00
Ryan Tidwell fc2dae7c93
Enable MP-BGP capabilities in Ryu BGP driver
This change enables all capabilties regardless of peer address
family, thereby enabling announcement of IPv6 prefixes over IPv4
sessions and vice-versa. Peers can opt in/out with capabilities
configured on the remote end of the session.

Change-Id: I7b241cdfddcecbdd8cdde2e88de35b9be6982451
Closes-Bug: #1784590
2019-02-28 08:20:39 -06:00
Boden R 19aed83ff1
Fix gate issues on master
We recently removed nenutron.common.rpc [1] as the rpc module lives in
neutron-lib now. This project was missed because I didn't find
neutron.common.rpc as an import. This patch switches rpc uses over to
neutron-lib.

This also addresses an issue where toxenv fails when it encounters a
non-empty __pycache__ directory. This adjusts the options passed to
find so that it is tolerant of this scenario and allows tox runs to
proceed.

[1] https://review.openstack.org/#/c/634790/

Change-Id: Ice83f7574f146436e3db045693b530f0cfeda049
2019-02-13 14:31:31 -06:00
Zuul 571e2e3f0e Merge "Add agent_updated to BgpDrAgentNotifyApi notifier" 2019-01-17 11:50:48 +00:00
Zuul a997500d07 Merge "Improve patching of sys.argv" 2019-01-15 13:42:02 +00:00
Tobias Urdin a861327795 Add agent_updated to BgpDrAgentNotifyApi notifier
When a bgp-dragent is deployed with enable_new_services
set to False so that the agent is disabled upon creation
the first attempt to enable it again throws an error but
the second time works, see the bug report.

Change-Id: If77e2035d0c12d0391ab9c38054bf2e0d24dac4a
Closes-Bug: 1799455
2019-01-11 14:54:00 +01:00
Ryan Tidwell 34655a8e6e
Migrate neutron-dynamic-routing from Ryu to os-ken
This change causes neutron-dynamic-routing to stop consuming Ryu
in favor of os-ken. os-ken becomes the reference implementation
for BGP services and neutron-dynamic-routing no longer has a
dependency on Ryu.

Partially-Implements: blueprint ryu-framework-maintenace-transition
Change-Id: I4a68440809cad5de2d6d191f7211d68b542672e5
2018-12-18 14:03:13 -06:00
YAMAMOTO Takashi 7f82a19155 Remove unnecessary mocking of get_admin_context
Because:
- They are not necessary.
- Neutron agent scheduler code (reschedule_resources_from_down_agents)
  seems to (correctly) assume each get_admin_context() call returns
  a fresh context.  This mocking breaks it.
- Right now, Neutron agentdb uses the new engine facade [1] and
  Neutron agent scheduler doesn't. It causes caching issue in our
  unit tests. (See the Related-Bug)  Stopping reusing contexts
  (thus sessions) would prevent the issue.

[1] https://review.openstack.org/#/c/611462/

Related-Bug: #1803745
Change-Id: Ia986f98f8bda9c7cde33af3dfdf2e45a2685fd6d
2018-11-28 19:54:50 +09:00
Zuul 17e823e33a Merge "Move 4byte_asn scenario test to basic dir" 2018-11-01 06:06:28 +00:00
Chuck Short de57190bca Fix unit tests with py3.6
In python3.6 the path used by os.path.join can be either
a string or bytes, so mock the neutron.common.config.init
to return a string so the tests pass with python3.6.

Change-Id: I10b399edb76b2ed3a2a235f9f4ec278ef94c4251
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-09-22 13:09:43 +02:00
James Page bd61eadba2 Improve patching of sys.argv
More in-depth type checking of args in Python 3.6 causes issues
with the current approach to patching sys.argv for agent unit
tests;  Directly patch argv with the required test arguments
rather than using return_value (which does not really do what
the test assumes it does).

Change-Id: I8966323e3f0853351fe27207ae63901c2f9f351a
2018-06-15 14:26:11 +01:00
Federico Ressi 26bfa08b23 Disable subnet CIDR reservation
Reserving subnet CIDR make impossible to reuse the same
CIDR for a subnet twice for the test case class.

Change-Id: Ia32f0e3fea509d1eb0074f5d4bdaf5b02b6dcae0
Depends-On: I421dd28999086ee0af9246121f4f033291e341b4
Closes-Bug: #1766702
2018-05-11 07:13:55 +02:00
Boden R 78d68a18ba use rpc Connection rather than create_connection
The create_connection function in neutron.common.rpc is just an alias to
Connection. This patch switches to the later so we can remove the former
in: https://review.openstack.org/#/c/560130

Change-Id: Ie8eaca442fa2872fe061f997898d9cd7d9195c9d
2018-04-12 14:03:01 -06:00
Zuul 008517ea02 Merge "Switch to neutron-tempest-plugin for tempest tests" 2018-03-26 22:03:45 +00:00
Jens Harbott 4808c72a39 Move 4byte_asn scenario test to basic dir
Since a separate job has not been created [0], move the scenario test
into the basic directory so that it will be executed there.

Set TEMPEST_CONCURRENCY=1 for the basic scenario job in order to avoid
resource collisions.

[0] https://review.openstack.org/529256

Change-Id: Idbf2739a585473fdf1d364ad1ee263ad359fd750
2018-03-26 07:12:45 +00:00
Jens Harbott fd497a491a Fix failure when adding a speaker to an agent
When get_bgp_speaker_with_advertised_routes() collects the data for BGP
peers, it needs to include the auth_type field, otherwise adding the
speaker to an agent will fail.

Change-Id: I668397be4a531ba5c0628eb23df9a84d0de8c28c
Closes-Bug: 1750121
2018-02-20 11:01:30 +00:00
Gary Kotton 9a6fcb6205 Fix unit tests for floating IP creation
Remove unnecessary settings of None in the floating IP
creation.

This is now dealt correctly with by neutron.

Change-Id: Ifa7195bc0c58eca077579039705bb1738f3d362e
2018-02-11 09:29:52 +00:00
Gary Kotton 3562fb4305 Fix broken unit tests
DB validations need to make sure that the value is True or False.
'0' was causing the unit tests to fail.

Change-Id: I0af74c88ce4c4e9d117ea5ff3394eec5be27ecf7
2018-02-08 22:44:30 +02:00
Chandan Kumar ad52025727 Switch to neutron-tempest-plugin for tempest tests
* https://review.openstack.org/519310 syncs the code from neutron
  project to neutron-tempest-plugin repo and it is better to
  depend on new one in order to avoid the breakage.

Depends-On: I9962fd5aa9a13f315208255e2cc5f599871a6f53
Change-Id: I34efe893b93240c4689de1dda978209926022dfd
2018-01-24 10:16:27 +00:00
Gary Kotton db343c12b1 Address breakage from upstream change
Commit 088e317cd2dd8488feb29a4fa6600227d1810479 broke the plugin.
This addresses that change.

Change-Id: Ie7118a089e2c3fe058f90bd8d1e5a979ed9bf105
2017-12-17 01:17:25 -08:00
YAMAMOTO Takashi 78ae7cb8f5 Update after agent extension rehome
After the recent Neutron change. [1]

[1] I18aebec1e2b5b361d9b96192d4a59e5424c6a80b

Closes-Bug: #1734265
Change-Id: I2d4624013e0df9670b17d73a89d17f8e2b5bdb0a
2017-11-24 18:08:58 +09:00
Hirofumi Ichihara 972756f603 Support 4-Byte AS Numbers
Now neutron_dynamic_routing supports 2 byte AS numbers only.
This patch expands AS numbers constraint so that it supports
4 byte AS numbers. It expects that operators use asplain
notation to set AS numbers[1]. That's backward compatible with
existing 2 byte AS numbers.

[1]: https://tools.ietf.org/html/rfc5396

Change-Id: I06ae0c42d983e88e1f38c501d5c85a7956f195ad
Closes-Bug: #1573092
2017-11-06 09:39:34 +00:00
Adit Sarfaty 229beac198 use external net api def from lib
The external network extension's API definition was rehomed into
neutron-lib with I9933b91d1e82db3891b3b72f06e94316e56a4f15 and
broke our unittests.

Change-Id: Ib184871ac7ec5cd09cfb26d911cec8d9ae6fca7e
2017-11-02 10:09:06 +02:00
Hirofumi Ichihara 95d2bdfde1 Switch to tempest.common.utils.is_extension_enabled
The tempest.test.is_extension_enabled() has moved to
tempest.common.utils.is_extension_enabled() in Pike.

Change-Id: I8fb12f913f187e4f0208438e7f39b2691f0dd4f3
2017-10-04 08:02:00 +00:00
Hirofumi Ichihara 1bcaad970b Fix checking extension in api test
API test checks nonexistent extension "bgp_speaker".
This changes it into proper extension "bgp".

Change-Id: Iba927bacc35c8ff107a9b1636c775f3caf95e704
2017-09-14 04:11:10 +00:00
Brian Haley d13fdaef43 Fix unit tests and test configuration
A recent change in the neutron repository changed the
import statements for external_process, fixing fallout.

Fix post gate hook to accommodate for new os-testr.
New versions now use .stestr instead of previous .testrepository
directory.

Related-bug: #1716746
Change-Id: Iba7579f8de63c6ce87d95167918fc46979702a35
2017-09-13 14:08:41 -06:00
Jenkins 3e10853df1 Merge "Give docker bridges test-specific names" 2017-09-06 21:18:19 +00:00
Omer Anson f505a0b7f7 Give docker bridges test-specific names
We have seen in Dragonflow tempest tests that docker bridges do not
always clean-up correctly, and this causes false-positive errors.

This change modifies the name of the bridge to be unique for each test.
This way, if a test fails to clean up, it will not affect the other
tests.

Change-Id: I869c6dc798cd1cc20376023481518e7a03b71fde
2017-09-03 15:45:20 +03:00