Commit Graph

14 Commits

Author SHA1 Message Date
Brian Haley 8126f88894 Complete removal of dependency on the "mock" package
Now that we are python3 only, we should move to using the built
in version of mock that supports all of our testing needs and
remove the dependency on the "mock" package.

This completes removal of all references to "import mock",
changing to "from unittest import mock" in fullstack and
functional tests.

Added a hacking check to enforce it in future patches.

Change-Id: Ifcaf1c21bea0ec3c35278e49cecc90a101a82113
2020-05-01 12:05:34 -04:00
Brian Haley 4f627b4e8d Change ip_lib network namespace code to use pyroute2
Change network namespace add/delete/list code to use
pyroute2 library instead of calling /sbin/ip.

Also changed all in-tree callers to use the new calls.

Closes-bug: #1717582
Related-bug: #1492714

Change-Id: Id802e77543177fbb95ff15c2c7361172e8824633
2017-10-04 21:09:28 +00:00
IWAMOTO Toshihiro 1c6b51259c python3: Do not pass MagicMock as ConfigOpts
Doing so causes a eventlet.sleep(MagicMock()) call, which results
in comparing MagicMock with float and generates a TypeError in python3.

Change-Id: I970c215433fda05fa4570b2250a36aab4c18c616
2017-06-14 08:47:33 +00:00
Hunt Xu a15c849563 ProcessManager: honor run_as_root when stopping process
Without this commit, the run_as_root parameter is always True when
stopping a process, which leads to the usage of unnecessary sudo such as
in some functional tests, like the keepalived ones.

This commit fixes the aforemetioned problem by taking run_as_root into
account when stopping a process. However, run_as_root will still always
be True if the process is spawned in a netns.

Closes-Bug: #1491581

Change-Id: Ib40e1e3357b9a38e760f4e552bf615cdfd54ee5a
Signed-off-by: Hunt Xu <mhuntxu@gmail.com>
2017-04-22 15:23:59 +08:00
Cedric Brandily 23b907bc6e Remove deprecated use_namespaces option
The use_namespaces option has been defined as a workaround to kernels
not properly supporting namespaces. This limitation is behind us, it's
time to remove use_namespaces after its deprecation in Kilo in order to
simplify code and remove a poorly tested case (use_namespaces=False).

This change prepares for removal pullup_route method[1] which was only
used when use_namespaces=False.

[1] neutron.agent.linux.ip_lib

DocImpact
UpgradeImpact
Closes-Bug: #1508188
Related-Bug: #1435382
Depends-On: I303038eec560a6d99421140c2822aed8b518470b
Depends-On: I4feb2a15c7e1e4bfdbed2531b18b8e7d798ab3cc
Change-Id: I2fbf65df1250d9f9f1656b3964ee3b6de1ef1118
2015-11-18 19:17:29 +01:00
Cedric Brandily bd0e8af34c Remove deprecated namespace deletion options
dhcp/router_delete_namespaces[1] options have been defined as a
workaround to an iproute2 limitation[1] corrected 2 years ago.

That's why the change removes these options after their deprecation
in Liberty.

[1] in neutron.agent.dhcp/l3.config

DocImpact
Closes-Bug: #1508189
Related-Bug: #1418079
Change-Id: I2a879213c3b095a007a4531f430a33cea9fdf1bd
2015-10-21 12:53:14 +02:00
Qiaowei Ren 78ff49ecf9 Remove unnecessary executable permission
Bunch of neutron source code files are marked as executable which is not
appropriate, this patch just 'chmod -x' to all of them.

Closes-Bug: #1468564

Change-Id: Idec4ae16501d68e044e103db24ad3be0e0751e9a
2015-08-01 05:16:32 +00:00
Jenkins 7863399d0f Merge "Switch to oslo_utils.uuidutils" 2015-06-25 22:53:39 +00:00
Martin Roy fe6654b250 Use string exception casting everywhere
Instead of the deprecated "message" member access,
casting to a string invokes the __str__ method of the exception
that is wired to return the message

Added a test of the failure cases of IpRouteCommand::delete_gateway
because they were missing

Running unit and functional tests locally no longer shows the warning
reported in the bug.

Change-Id: Ia79f526aa973ece1145615d65349f860aa3fd465
Closes-Bug: #1466542
2015-06-22 09:13:56 -04:00
ChangBo Guo(gcb) c3d65a0ed9 Switch to oslo_utils.uuidutils
Get rid of oslo-incubator uuidutils

Closes-Bug: #1467020
Depends-On: I2df519965883b05d5d58cdc4785c850b0685dc2c
Depends-On: I9f8e98ad9517864a9ffdacf01c0a9a5aab554edb
Depends-On: Ied0faac809a5b72b1cd466c8babc9ca5418692c3
Change-Id: Iebe491b981b4b7c02785412fadd27678bb5e47de
2015-06-22 11:06:18 +00:00
Jenkins cacdf83865 Merge "Fix typo acomplished => accomplished" 2015-06-11 16:01:17 +00:00
Oleg Bondarev b058658780 Cleanup stale metadata processes on l3 agent sync
Currently l3 agent only cleans up stale namespaces.
The fix adds checking and deleting stale metadata processes
to NamespaceManager class responsible for clearing stale
namespaces

Change-Id: I2b081803e312589d3d8a7808d286a6c9827ef53f
Closes-Bug: #1455042
2015-05-29 13:55:55 +03:00
Kawaguchi 407be28936 Fix typo acomplished => accomplished
Change-Id: I73722e9984917a5a8c4e74207cf14d4040a7cf2f
Related-Bug: #1390035
2015-04-22 13:31:06 +09:00
Miguel Lavalle be77b688b9 Add tests for the l3 agent namespaces manager
The following tests are added for the l3 agent namespaces manager:

1) Unit tests
2) Funtional test
3) A test case within the l3 funtional test for periodic_sync_routers_task

Change-Id: Ia26f1ccdc0a6619aa231c8799acc80377f4144f8
Partially-Implements: bp restructure-l3-agent
2015-03-28 17:13:37 -05:00