neutron/neutron/tests/unit
Elena Ezhova dd4b77ff53 Forbid regular users to reset admin-only attrs to default values
A regular user can reset an admin-only attribute to its default
value due to the fact that a corresponding policy rule is
enforced only in the case when an attribute is present in the
target AND has a non-default value.

Added a new attribute "attributes_to_update" which contains a list
of all to-be updated attributes to the body of the target that is
passed to policy.enforce.

Changed a check for whether an attribute is explicitly set.
Now, in the case of update, the function should not pay attention
to a default value of an attribute, but check whether it was
explicitly marked as being updated.

Added unit-tests.

Conflicts:
	neutron/common/constants.py

Closes-Bug: #1357379
Related-Bug: #1338880
Change-Id: I6537bb1da5ef0d6899bc71e4e949f2c760c103c2
(cherry picked from commit 74d1093990)
2014-09-25 17:14:33 +02:00
..
agent fixes tests using called_once_ without assert 2014-04-04 19:12:09 -04:00
api Fix misleading error message about failed dhcp notifications 2014-03-17 16:32:44 -07:00
bigswitch Merge "BSN: Add context to backend request for debugging" into stable/icehouse 2014-09-23 09:41:38 +00:00
brocade Neutron network delete fails with brocade plugin 2013-09-24 01:32:00 +00:00
cisco Cisco N1kv plugin to send subtype on network profile creation 2014-09-04 07:58:44 -07:00
db Don't allow user to set firewall rule with port and no protocol 2014-09-17 16:14:22 +02:00
embrane Remove individual cfg.CONF.resets from tests 2014-03-17 12:34:56 -04:00
extensions Fix H102, H103 Apache 2.0 license hacking check error 2013-08-08 12:46:18 +09:00
hyperv Merge "Fixes Hyper-V agent security groups disabling" into stable/icehouse 2014-07-25 22:33:59 +00:00
ibm Remove individual cfg.CONF.resets from tests 2014-03-17 12:34:56 -04:00
linuxbridge Merge "Fix bug:range() is not same in py3.x and py2.x" 2014-03-22 05:22:24 +00:00
metaplugin Add support for multiple RPC workers under Metaplugin 2014-04-24 15:50:53 +09:00
midonet options: consolidate options definitions 2014-02-24 13:25:11 +09:00
ml2 Merge "BSN: Add context to backend request for debugging" into stable/icehouse 2014-09-23 09:41:38 +00:00
mlnx Merge "Fix bug:range() is not same in py3.x and py2.x" 2014-03-22 05:22:24 +00:00
nec Replace HTTPSConnection in NEC plugin 2014-04-04 16:09:14 -04:00
notifiers Replace loopingcall in notifier with a delayed send 2014-05-26 15:40:06 +03:00
nuage UT: do not hide an original error in test resource ctxtmgr 2014-03-28 05:49:13 +00:00
ofagent Merge "OFAgent: Avoid processing ports which are not yet ready" into stable/icehouse 2014-07-09 05:38:14 +00:00
oneconvergence Add enable_security_group option 2014-03-21 00:50:15 +01:00
openvswitch Merge "OVS agent: Correct bridge setup ordering" into stable/icehouse 2014-07-25 22:42:35 +00:00
plumgrid Fixed dhcp & gateway ip conflict in PLUMgrid plugin 2014-06-27 07:48:48 -07:00
ryu Removes calls to mock.patch.stopall in unit tests 2014-03-12 04:17:11 +00:00
services Ensure ip6tables are used only if ipv6 is enabled in kernel 2014-08-22 10:42:07 +02:00
vmware NSX: Correct allowed_address_pair return value on create_port 2014-09-09 10:10:01 -07:00
__init__.py Update lockutils and fixture in openstack.common 2014-01-09 15:59:10 +04:00
_test_extension_portbindings.py ML2 binding:profile port attribute 2014-02-24 12:30:46 -05:00
_test_rootwrap_exec.py Rename Quantum to Neutron 2013-07-06 15:02:43 -04:00
database_stubs.py Use built-in print() instead of print statement 2013-09-21 07:30:33 -07:00
dummy_plugin.py Service Type Framework refactoring 2013-07-25 21:47:30 +04:00
extension_stubs.py Rename Quantum to Neutron 2013-07-06 15:02:43 -04:00
test_agent_config.py Rename Quantum to Neutron 2013-07-06 15:02:43 -04:00
test_agent_ext_plugin.py Remove individual cfg.CONF.resets from tests 2014-03-17 12:34:56 -04:00
test_agent_linux_utils.py Update License Headers to replace Nicira with VMware 2014-02-27 08:11:15 +00:00
test_agent_netns_cleanup.py fixes broken neutron-netns-cleanup 2014-04-04 18:32:55 -04:00
test_agent_ovs_cleanup.py Remove individual cfg.CONF.resets from tests 2014-03-17 12:34:56 -04:00
test_agent_rpc.py Add l2 population base classes 2013-09-12 01:06:51 +02:00
test_api_api_common.py Rename Quantum to Neutron 2013-07-06 15:02:43 -04:00
test_api_v2.py Forbid regular users to reset admin-only attrs to default values 2014-09-25 17:14:33 +02:00
test_api_v2_extension.py Removes calls to mock.patch.stopall in unit tests 2014-03-12 04:17:11 +00:00
test_api_v2_resource.py replace rest of q_exc to n_exc in code base 2014-03-03 17:42:20 -08:00
test_attributes.py Fix _validate_mac_address method 2014-04-08 08:18:16 -04:00
test_auth.py Return request-id in API response 2014-02-10 04:58:38 +09:00
test_common_log.py Make neutron.common.log.log print module path 2013-09-07 02:10:57 +09:00
test_common_utils.py Common decorator for caching methods 2014-05-26 10:02:12 +02:00
test_config.py Utilizes assertIsNone and assertIsNotNone 2013-10-23 10:59:16 +08:00
test_db_migration.py fixes tests using called_once_ without assert 2014-04-04 19:12:09 -04:00
test_db_plugin.py Ensure core plugin deallocation after every test 2014-07-03 13:14:29 -07:00
test_db_plugin_level.py Allow unsharing a network used as gateway/floatingip 2014-08-31 07:55:35 +00:00
test_db_rpc_base.py Avoid long transaction in plugin.delete_ports() 2014-03-16 00:19:51 +09:00
test_debug_commands.py Removes calls to mock.patch.stopall in unit tests 2014-03-12 04:17:11 +00:00
test_dhcp_agent.py Don't spawn metadata-proxy for non-isolated nets 2014-09-22 11:22:31 +03:00
test_dhcp_scheduler.py Fix DetachedInstanceError for Agent instance 2014-02-27 14:48:11 +00:00
test_extension_allowedaddresspairs.py no quota for allowed address pair 2014-07-17 23:33:02 +08:00
test_extension_ext_gw_mode.py Update License Headers to replace Nicira with VMware 2014-02-27 08:11:15 +00:00
test_extension_ext_net.py Remove plugin_name_v2 and extension_manager in test_config 2014-01-06 20:02:00 +09:00
test_extension_extended_attribute.py Remove individual cfg.CONF.resets from tests 2014-03-17 12:34:56 -04:00
test_extension_extradhcpopts.py extra_dhcp_opt add checks for empty strings 2013-12-13 08:40:28 -07:00
test_extension_extraroute.py tests/unit: clean up notification driver 2014-03-20 11:42:59 +09:00
test_extension_firewall.py tests/service: consolidate setUp/tearDown logic 2014-02-25 10:33:56 +09:00
test_extension_pnet.py Remove individual cfg.CONF.resets from tests 2014-03-17 12:34:56 -04:00
test_extension_portsecurity.py Use "!=" instead of "is not" when comparing two values 2014-02-21 21:15:19 +09:00
test_extension_security_group.py Validate CIDR given as ip-prefix in security-group-rule-create 2014-04-18 13:25:47 -07:00
test_extensions.py Added check on plugin.supported_extension_aliases 2013-11-19 12:51:21 -06:00
test_iptables_firewall.py Fix test MAC addresses to be valid 2014-04-04 18:38:49 -04:00
test_iptables_manager.py Ensure ip6tables are used only if ipv6 is enabled in kernel 2014-08-22 10:42:07 +02:00
test_ipv6.py Ensure ip6tables are used only if ipv6 is enabled in kernel 2014-08-22 10:42:07 +02:00
test_l3_agent.py Install SNAT rules for ipv4 only 2014-05-27 15:06:28 -07:00
test_l3_plugin.py Wrong key router.interface reported by ceilometer 2014-05-27 03:52:56 +00:00
test_l3_schedulers.py UT: do not hide an original error in test resource ctxtmgr 2014-03-28 05:49:13 +00:00
test_legacy.py Kill 'Skipping unknown group key: firewall_driver' log trace 2014-03-13 12:46:06 -07:00
test_linux_daemon.py Merge "Change daemon Pidfile class to not use root_helper" 2013-09-19 21:21:12 +00:00
test_linux_dhcp.py Remove RPC to plugin when dhcp sets default route 2014-06-09 13:50:58 +00:00
test_linux_external_process.py Refactor netns.execute so that it is not necessary to check namespace 2014-03-04 16:13:44 +00:00
test_linux_interface.py Removes calls to mock.patch.stopall in unit tests 2014-03-12 04:17:11 +00:00
test_linux_ip_lib.py Add unit test for add_vxlan in test_linux_ip_lib 2014-04-04 18:34:27 -04:00
test_metadata_agent.py Fix metadata agent's auth info caching 2014-09-11 00:26:45 +08:00
test_metadata_namespace_proxy.py Include proper Content-Type in the HTTP response headers 2014-02-25 15:56:43 +05:30
test_neutron_context.py Update License Headers to replace Nicira with VMware 2014-02-27 08:11:15 +00:00
test_neutron_manager.py Remove individual cfg.CONF.resets from tests 2014-03-17 12:34:56 -04:00
test_policy.py Forbid regular users to reset admin-only attrs to default values 2014-09-25 17:14:33 +02:00
test_post_mortem_debug.py fixes tests using called_once_ without assert 2014-04-04 19:12:09 -04:00
test_provider_configuration.py replace rest of q_exc to n_exc in code base 2014-03-03 17:42:20 -08:00
test_quota_ext.py Remove individual cfg.CONF.resets from tests 2014-03-17 12:34:56 -04:00
test_routerserviceinsertion.py Remove individual cfg.CONF.resets from tests 2014-03-17 12:34:56 -04:00
test_security_groups_rpc.py Ensure ip6tables are used only if ipv6 is enabled in kernel 2014-08-22 10:42:07 +02:00
test_servicetype.py Remove individual cfg.CONF.resets from tests 2014-03-17 12:34:56 -04:00
test_wsgi.py wsgi.run_server no longer used 2014-02-20 20:15:21 -08:00
testlib_api.py add portbinding host into vip port 2013-09-25 14:41:31 +08:00