Fix v2 API policy checks when keystone is in use.
bug
1022032. There were significant errors in how
the policy framework was being invoked, but existing
tests did now show them, since they always invoked the
API with no keystone context. This patch fixes those
issues and add a significant amount of test coverage
simulating API calls with keystone enabled.
As part of this patch, we also needed to add a tenant-id
attribute to the subnet object. Furthermore, we
changed the API validation code to prevent tenant-id from
being changed with a PUT, since changing it after creation
could invalidate some of the create checks we're planning
on adding (e.g., that a port is being created on a network
owned by the same tenant).
Change-Id: I6da61f0d4ac3b259aa0afcd42cfa8e6ec1a9b035