)]}'
{"nova/tests/unit/api/openstack/compute/test_serversV21.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"172266da8fb3da8130d5a4eb93990d47233187fc","unresolved":false,"context_lines":[{"line_number":5147,"context_line":""},{"line_number":5148,"context_line":"        rules \u003d {\"os_compute_api:servers:delete\": \"user_id:asdf\"}"},{"line_number":5149,"context_line":"        self.policy.set_rules(rules)"},{"line_number":5150,"context_line":"        self.assertRaises(exception.PolicyNotAuthorized,"},{"line_number":5151,"context_line":"            self.controller.delete,"},{"line_number":5152,"context_line":"            self.admin_req, instance.uuid)"},{"line_number":5153,"context_line":""},{"line_number":5154,"context_line":"    @mock.patch(\"nova.api.openstack.common.get_networks_for_instance\")"},{"line_number":5155,"context_line":"    @mock.patch(\"nova.compute.api.API.update_instance\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_fd6362db","line":5152,"range":{"start_line":5150,"start_character":0,"end_line":5152,"end_character":42},"updated":"2018-09-21 16:18:39.000000000","message":"Thinking about this from a functional test perspective; I was expecting to see something like:\n\n  self.post(\u0027/v2/servers/%s\u0027 % instance_id)\n\nExercising API dispatching and middleware instead of injecting into the controller directly.\n\nI\u0027m not familiar enough with nova\u0027s functional tests to know if that matters though. In my opinion, this is a complicated topic mostly because everyone seems to do it differently. I started working on some documentation in oslo.policy to see if we could clarify how services can reliably test API protection with policies without making things extremely complicated [0]. You\u0027d probably have some great insight on that since you\u0027re familiar with how nova currently works. \n\n[0] https://review.openstack.org/#/c/604192/","commit_id":"e1de82eb8a2e9d75e51867fb82694fb52436078d"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c5f3e74b6d63692904539015e095171eb7d12781","unresolved":false,"context_lines":[{"line_number":5147,"context_line":""},{"line_number":5148,"context_line":"        rules \u003d {\"os_compute_api:servers:delete\": \"user_id:asdf\"}"},{"line_number":5149,"context_line":"        self.policy.set_rules(rules)"},{"line_number":5150,"context_line":"        self.assertRaises(exception.PolicyNotAuthorized,"},{"line_number":5151,"context_line":"            self.controller.delete,"},{"line_number":5152,"context_line":"            self.admin_req, instance.uuid)"},{"line_number":5153,"context_line":""},{"line_number":5154,"context_line":"    @mock.patch(\"nova.api.openstack.common.get_networks_for_instance\")"},{"line_number":5155,"context_line":"    @mock.patch(\"nova.compute.api.API.update_instance\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_4c3975cd","line":5152,"range":{"start_line":5150,"start_character":0,"end_line":5152,"end_character":42},"in_reply_to":"3f79a3b5_fd6362db","updated":"2018-09-24 09:43:29.000000000","message":"Yeah, these are more unit tests on steroids. It was just high enough up to touch the oslo policy calls.\n\nI more chose here as it is the level where we currently test policy.\n\nWe use gabbi for placement, where the direct API testing is much cleaner.\n\nWe do have higher level tests in api_samples:\nhttps://github.com/openstack/nova/blob/792cc425f2dd73dad392a5d0488989e818683047/nova/tests/functional/api_sample_tests/test_servers.py#L102","commit_id":"e1de82eb8a2e9d75e51867fb82694fb52436078d"}]}
