Change netns tests with oslo.privsep to check netns links
It turns out that pyroute2.netns.setns() changes a network
namespace of a thread instead of that of a process when it is
called in a thread [1].
What we actually would like to check in test_in_namespace test
is whether operations against a network namespace work with
oslo.privsep expectedly. There is no need to check namespace inode.
This commit changes test_in_namespace test to check a list of
network devices in a namespace to check netns operation works
correctly. What the new test does are:
- create a network namespace for testing
- create a veth pair and move one of them to the network namespace
- call oslo.privsep entrypoint function to retrieve a list of
network devices inside the netns
Reviewed: https:/ /review. openstack. org/631654 /git.openstack. org/cgit/ openstack/ neutron- fwaas/commit/ ?id=55874d06b1c e80b44356310c93 0f80e834d83a8a
Committed: https:/
Submitter: Zuul
Branch: master
commit 55874d06b1ce80b 44356310c930f80 e834d83a8a
Author: Akihiro Motoki <email address hidden>
Date: Fri Jan 18 06:29:33 2019 +0900
Change netns tests with oslo.privsep to check netns links
It turns out that pyroute2. netns.setns( ) changes a network
namespace of a thread instead of that of a process when it is
called in a thread [1].
What we actually would like to check in test_in_namespace test
is whether operations against a network namespace work with
oslo.privsep expectedly. There is no need to check namespace inode.
This commit changes test_in_namespace test to check a list of
network devices in a namespace to check netns operation works
correctly. What the new test does are:
- create a network namespace for testing
- create a veth pair and move one of them to the network namespace
- call oslo.privsep entrypoint function to retrieve a list of
network devices inside the netns
[1] http:// lists.openstack .org/pipermail/ openstack- discuss/ 2019-January/ 001761. html
Closes-Bug: #1811506 a3ce50b5711ff79 1bac2681a2f
Change-Id: Ie5b238f1df707e