1555e14677a85b76291bcf79a2af7135a1fbfa30
Exisitng tests didn't mock "get_network" function properly thus
there was no "network:tenant_id" field in the target object set and
OwnerCheck check was failing for the "net_owner".
Unit tests were green because they badly expected e.g. for the
ProjectMember that e.g. port with given fixed_ip or mac_address will not
be allowed (exception was raised because net_owner check failed) even
thoug it should be possible through the net_owner rule in policy.
This patch fixes mocking get_network function in unit tests module for
the port RBAC policies and it also updates unit tests accordingly to
make them pass.
Change-Id: I4c26403e237afdb8934dda65fef3b12c99a5f689
Signed-off-by: Slawek Kaplonski <skaplons@redhat.com>
(cherry picked from commit a48b715e8b)
OpenStack Neutron
Neutron is an OpenStack project to provide "network connectivity as a service" between interface devices (e.g., vNICs) managed by other OpenStack services (e.g., Nova).
To learn more about neutron:
- Documentation: https://docs.openstack.org/neutron/latest/
- Features: https://specs.openstack.org/openstack/neutron-specs
- Defects: https://launchpad.net/neutron
- Release notes: https://docs.openstack.org/releasenotes/neutron/index.html
- Source: https://opendev.org/openstack/neutron
If you would like to contribute to Neutron, please read the file CONTRIBUTING.rst or see the Neutron contributor guide:
https://docs.openstack.org/neutron/latest/contributor/contributing.html
Get in touch via email. Use [Neutron] in your subject.
Description
Languages
Python
99.7%
Shell
0.3%