)]}'
{"patrole_tempest_plugin/tests/api/network/test_auto_allocated_topology_rbac.py":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"dae02c201f3ed37259d6530545e479a5db672953","unresolved":false,"context_lines":[{"line_number":35,"context_line":"                                 rules\u003d[\"get_auto_allocated_topology\"],"},{"line_number":36,"context_line":"                                 expected_error_codes\u003d[404])"},{"line_number":37,"context_line":"    def test_show_auto_allocated_topology(self):"},{"line_number":38,"context_line":"        \"\"\"Show auto_allocated_topology."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        RBAC test for the neutron \"get_auto_allocated_topology\" policy"},{"line_number":41,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_7586c915","line":38,"range":{"start_line":38,"start_character":16,"end_line":38,"end_character":30},"updated":"2018-08-13 22:23:51.000000000","message":"auto-allocated, though unrelated","commit_id":"582b32698f8d743dcfff1a86a286f247e95c5cba"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"dae02c201f3ed37259d6530545e479a5db672953","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                                 rules\u003d[\"delete_auto_allocated_topology\"],"},{"line_number":49,"context_line":"                                 expected_error_codes\u003d[404])"},{"line_number":50,"context_line":"    def test_delete_auto_allocated_topology(self):"},{"line_number":51,"context_line":"        \"\"\"Show delete_allocated_topology."},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        RBAC test for the neutron \"delete_auto_allocated_topology\" policy"},{"line_number":54,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_b590e14b","line":51,"range":{"start_line":51,"start_character":11,"end_line":51,"end_character":42},"updated":"2018-08-13 22:23:51.000000000","message":"This description should be:\n\n\"Delete auto-allocated topology.\"","commit_id":"582b32698f8d743dcfff1a86a286f247e95c5cba"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"dae02c201f3ed37259d6530545e479a5db672953","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        \"\"\""},{"line_number":55,"context_line":"        with self.rbac_utils.override_role(self):"},{"line_number":56,"context_line":"            self.ntp_client.delete_auto_allocated_topology("},{"line_number":57,"context_line":"                tenant_id\u003dself.os_primary.credentials.tenant_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_15a435a5","line":57,"range":{"start_line":57,"start_character":25,"end_line":57,"end_character":63},"updated":"2018-08-13 22:23:51.000000000","message":"This isn\u0027t safe to do for the default project. We should dynamically create a project here using self.os_primary.projects_client.create_project() and pass that ID here. Not sure if anything else needs to be done to \"auto-allocate\" a topology for that project: I\u0027m assuming Neutron doesn\u0027t it automatically (as implied by the name of the extension).","commit_id":"582b32698f8d743dcfff1a86a286f247e95c5cba"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"5c87c8e4d1676d0671949b2377f8ca58fea9bb6b","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    @decorators.idempotent_id(\u0027A0606AFE-065E-4C09-8E51-58EE7FBA30A9\u0027)"},{"line_number":48,"context_line":"    @rbac_rule_validation.action(service\u003d\"neutron\","},{"line_number":49,"context_line":"                                 rules\u003d[\"delete_auto_allocated_topology\"],"},{"line_number":50,"context_line":"                                 expected_error_codes\u003d[404])"},{"line_number":51,"context_line":"    def test_delete_auto_allocated_topology(self):"},{"line_number":52,"context_line":"        \"\"\"Show delete auto-allocated topology."},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_e85bc6f2","line":50,"range":{"start_line":49,"start_character":33,"end_line":50,"end_character":60},"updated":"2018-08-15 05:29:34.000000000","message":"As per usual, I would imagine this is a get_* followed by a delete_* leading to expected_error_codes\u003d[404, 403]","commit_id":"c905743670fae9cd57b9557f4b5d1cde8b597c41"},{"author":{"_account_id":16274,"name":"Mykola Yakovliev","email":"VegasQ@gmail.com","username":"vegasq"},"change_message_id":"758144c566de26abfb7eaa5c57dd33c8d5eb2184","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        RBAC test for the neutron \"delete_auto_allocated_topology\" policy"},{"line_number":73,"context_line":"        \"\"\""},{"line_number":74,"context_line":"        # For this test we need replace project patrole operates in."},{"line_number":75,"context_line":"        with self.override_project():"},{"line_number":76,"context_line":"            with self.rbac_utils.override_role(self):"},{"line_number":77,"context_line":"                self.ntp_client.delete_auto_allocated_topology("},{"line_number":78,"context_line":"                    self.os_primary.credentials.project_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_01712944","line":75,"range":{"start_line":75,"start_character":8,"end_line":75,"end_character":37},"updated":"2018-08-15 21:38:08.000000000","message":"If we just create the new project, validation will fail for members, since patrole will validate rules against the wrong project.","commit_id":"a394762e1128db927c028aed7239ea1f272690de"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"eeb685113f4a083ed21f9b41793a9c0f6c9dd4ed","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    @classmethod"},{"line_number":37,"context_line":"    def create_project(cls):"},{"line_number":38,"context_line":"        name \u003d data_utils.rand_name(cls.__name__ + \u0027-Project\u0027)"},{"line_number":39,"context_line":"        project \u003d cls.os_primary.projects_client.create_project(name)"},{"line_number":40,"context_line":"        return project[\"project\"][\"id\"]"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    @contextmanager"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_80dbd31f","line":39,"updated":"2018-08-17 03:08:47.000000000","message":"Need add cleanup (without call_and_ignore_notfound_exc callback).","commit_id":"0d76cbfd14bcee35b0073deddf37b4ac565a283a"},{"author":{"_account_id":16274,"name":"Mykola Yakovliev","email":"VegasQ@gmail.com","username":"vegasq"},"change_message_id":"25b02e196e39ea47388fdfba63caf1ea4473d293","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    @classmethod"},{"line_number":37,"context_line":"    def create_project(cls):"},{"line_number":38,"context_line":"        name \u003d data_utils.rand_name(cls.__name__ + \u0027-Project\u0027)"},{"line_number":39,"context_line":"        project \u003d cls.os_primary.projects_client.create_project(name)"},{"line_number":40,"context_line":"        return project[\"project\"][\"id\"]"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    @contextmanager"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_27e1a0d1","line":39,"in_reply_to":"3f79a3b5_80dbd31f","updated":"2018-08-17 18:26:49.000000000","message":"Done","commit_id":"0d76cbfd14bcee35b0073deddf37b4ac565a283a"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d1eab151ea130545a1d03ab3e6c59d9e95e95fd7","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        RBAC test for the neutron \"delete_auto_allocated_topology\" policy"},{"line_number":71,"context_line":"        \"\"\""},{"line_number":72,"context_line":"        # For this test we need replace project patrole operates in."},{"line_number":73,"context_line":"        with self.override_project():"},{"line_number":74,"context_line":"            with self.rbac_utils.override_role(self):"},{"line_number":75,"context_line":"                self.ntp_client.delete_auto_allocated_topology("},{"line_number":76,"context_line":"                    self.os_primary.credentials.project_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_40829b02","line":73,"range":{"start_line":73,"start_character":8,"end_line":73,"end_character":37},"updated":"2018-08-17 03:07:29.000000000","message":"This is a hack and should be avoided. Maybe this is possible instead:\n\n    def _override_role(self, test_obj, toggle_rbac_role\u003dFalse, user_id\u003dNone, project_id\u003dNone):\n        [...]\n        self.user_id \u003d user_id or test_obj.os_primary.credentials.user_id\n        self.project_id \u003d project_id or test_obj.os_primary.credentials.tenant_id\n\n    def test_delete_auto_allocated_topology(self):\n        project_id \u003d self.create_project()\n        # Call https://developer.openstack.org/api-ref/identity/v3/#assign-role-to-user-on-project\n        self.os_primary.projects_client.create_user_role_on_project(\n            project_id, self.os_primary.credentials.user_id, CONF.patrole.rbac_role)\n        with self.rbac_utils.override_role(self, project_id\u003dproject_id):\n            [...]","commit_id":"0d76cbfd14bcee35b0073deddf37b4ac565a283a"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"74a7b3979061c1c18e3ff5a78688622c462502f7","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        RBAC test for the neutron \"delete_auto_allocated_topology\" policy"},{"line_number":71,"context_line":"        \"\"\""},{"line_number":72,"context_line":"        # For this test we need replace project patrole operates in."},{"line_number":73,"context_line":"        with self.override_project():"},{"line_number":74,"context_line":"            with self.rbac_utils.override_role(self):"},{"line_number":75,"context_line":"                self.ntp_client.delete_auto_allocated_topology("},{"line_number":76,"context_line":"                    self.os_primary.credentials.project_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_c0d8eb1f","line":73,"range":{"start_line":73,"start_character":8,"end_line":73,"end_character":37},"in_reply_to":"3f79a3b5_40829b02","updated":"2018-08-17 03:10:14.000000000","message":"Actually the create_user_role_on_project call is done automatically by rbac_utils so is probably not necessary","commit_id":"0d76cbfd14bcee35b0073deddf37b4ac565a283a"},{"author":{"_account_id":16274,"name":"Mykola Yakovliev","email":"VegasQ@gmail.com","username":"vegasq"},"change_message_id":"25b02e196e39ea47388fdfba63caf1ea4473d293","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        RBAC test for the neutron \"delete_auto_allocated_topology\" policy"},{"line_number":71,"context_line":"        \"\"\""},{"line_number":72,"context_line":"        # For this test we need replace project patrole operates in."},{"line_number":73,"context_line":"        with self.override_project():"},{"line_number":74,"context_line":"            with self.rbac_utils.override_role(self):"},{"line_number":75,"context_line":"                self.ntp_client.delete_auto_allocated_topology("},{"line_number":76,"context_line":"                    self.os_primary.credentials.project_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_d2caef18","line":73,"range":{"start_line":73,"start_character":8,"end_line":73,"end_character":37},"in_reply_to":"3f79a3b5_40829b02","updated":"2018-08-17 18:26:49.000000000","message":"Done","commit_id":"0d76cbfd14bcee35b0073deddf37b4ac565a283a"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"109652a2db1debd517b80086bfce146852832207","unresolved":false,"context_lines":[{"line_number":35,"context_line":"                                 rules\u003d[\"get_auto_allocated_topology\"],"},{"line_number":36,"context_line":"                                 expected_error_codes\u003d[404])"},{"line_number":37,"context_line":"    def test_show_auto_allocated_topology(self):"},{"line_number":38,"context_line":"        \"\"\"Show auto_allocated_topology."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        RBAC test for the neutron \"get_auto_allocated_topology\" policy"},{"line_number":41,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_96bfb6ce","line":38,"range":{"start_line":38,"start_character":11,"end_line":38,"end_character":15},"updated":"2018-09-09 02:34:55.000000000","message":"Test show","commit_id":"8d0dd6bf95d5a006e09902da84128e4cbd400c3e"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"109652a2db1debd517b80086bfce146852832207","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                                        \"delete_auto_allocated_topology\"],"},{"line_number":50,"context_line":"                                 expected_error_codes\u003d[404, 403])"},{"line_number":51,"context_line":"    def test_delete_auto_allocated_topology(self):"},{"line_number":52,"context_line":"        \"\"\"Show delete_allocated_topology."},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        RBAC test for the neutron \"delete_auto_allocated_topology\" policy"},{"line_number":55,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_36b26207","line":52,"range":{"start_line":52,"start_character":11,"end_line":52,"end_character":42},"updated":"2018-09-09 02:34:55.000000000","message":"Test delete auto_allocated_topology.","commit_id":"8d0dd6bf95d5a006e09902da84128e4cbd400c3e"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"09bff4a061f730b00bf57763a16b8dd77cda3c4f","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        RBAC test for the neutron \"delete_auto_allocated_topology\" policy"},{"line_number":55,"context_line":"        \"\"\""},{"line_number":56,"context_line":"        with self.rbac_utils.override_role(self):"},{"line_number":57,"context_line":"            self.ntp_client.delete_auto_allocated_topology("},{"line_number":58,"context_line":"                tenant_id\u003dself.os_primary.credentials.tenant_id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_513d93db","line":57,"updated":"2018-08-28 20:18:04.000000000","message":"I still need to test whether this deletion of the auto-allocated topology is re-allocated following delete and what the side effects of that are on the network.","commit_id":"8d0dd6bf95d5a006e09902da84128e4cbd400c3e"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"07db5ee1a554d9db9cddb8187abd79de6e33b2f3","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        RBAC test for the neutron \"delete_auto_allocated_topology\" policy"},{"line_number":55,"context_line":"        \"\"\""},{"line_number":56,"context_line":"        with self.rbac_utils.override_role(self):"},{"line_number":57,"context_line":"            self.ntp_client.delete_auto_allocated_topology("},{"line_number":58,"context_line":"                tenant_id\u003dself.os_primary.credentials.tenant_id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_ac3142ef","line":57,"in_reply_to":"3f79a3b5_46e82215","updated":"2018-09-09 16:01:06.000000000","message":"My concern is hinted at by the following: https://github.com/openstack/neutron/blob/eaff4be1c12393545147aa1c18880cf90bd7e8a4/neutron/services/auto_allocate/db.py#L105\n\nIf the a user under the tenant modifies a resource belonging to the auto-allocated topology, then deleting it with this test might lead to the case where the new resources that are created are different from the previous resources. Also, I would imagine the IDs of the resources would also differ, IDs upon which yet other resources may depend.","commit_id":"8d0dd6bf95d5a006e09902da84128e4cbd400c3e"},{"author":{"_account_id":16274,"name":"Mykola Yakovliev","email":"VegasQ@gmail.com","username":"vegasq"},"change_message_id":"4f01f2eace211744e1468740bf5b080babf7b95c","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        RBAC test for the neutron \"delete_auto_allocated_topology\" policy"},{"line_number":55,"context_line":"        \"\"\""},{"line_number":56,"context_line":"        with self.rbac_utils.override_role(self):"},{"line_number":57,"context_line":"            self.ntp_client.delete_auto_allocated_topology("},{"line_number":58,"context_line":"                tenant_id\u003dself.os_primary.credentials.tenant_id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_46e82215","line":57,"in_reply_to":"3f79a3b5_513d93db","updated":"2018-08-31 20:05:47.000000000","message":"On get_auto_allocated_topology [0] it checks if network is allocated. If it is not, it will create a new one [1][2][3]\n\nIn other words, the only thing that happens is the network id returned on `get_auto_allocated_topology` will automatically change after each `delete`.\n\n[0] https://github.com/openstack/neutron/blob/master/neutron/services/auto_allocate/db.py#L152\n[1] https://github.com/openstack/neutron/blob/master/neutron/services/auto_allocate/db.py#L160\n[2] https://github.com/openstack/neutron/blob/master/neutron/services/auto_allocate/db.py#L179\n[3] https://github.com/openstack/neutron/blob/master/neutron/services/auto_allocate/db.py#L279","commit_id":"8d0dd6bf95d5a006e09902da84128e4cbd400c3e"},{"author":{"_account_id":27078,"name":"Manik Bindlish","email":"manikbindlish19@gmail.com","username":"manik"},"change_message_id":"f2758aefa0b7a6fdf0e303d02119c283ccaa0b0d","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    def _ensure_network_not_in_use(cls, network_id):"},{"line_number":47,"context_line":"        ports \u003d cls.ntp_client.list_ports(network_id\u003dnetwork_id)[\"ports\"]"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        expected_ports_count \u003d 0"},{"line_number":50,"context_line":"        # Every subnet within network should have a router interface"},{"line_number":51,"context_line":"        expected_ports_count +\u003d len("},{"line_number":52,"context_line":"            cls.ntp_client.show_network(network_id)[\"network\"][\"subnets\"])"},{"line_number":53,"context_line":"        # Every network should have a single dhcp interface"},{"line_number":54,"context_line":"        expected_ports_count +\u003d 1"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        if len(ports) !\u003d expected_ports_count:"},{"line_number":57,"context_line":"            msg \u003d \"Auto Allocated Topology in use.\""}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_0c07161f","line":54,"range":{"start_line":49,"start_character":8,"end_line":54,"end_character":33},"updated":"2018-10-04 11:47:14.000000000","message":"Can\u0027t we optimize it like:\n\n        expected_ports_count \u003d len(\n            cls.ntp_client.show_network(network_id)[\"network\"][\"subnets\"])\n        # Every network should have a single dhcp interface\n        expected_ports_count +\u003d 1\n\nI didn\u0027t understand the reason of using extra: \"expected_ports_count \u003d 0\"","commit_id":"4d597ccb0d362665104dca3ee10adec9a8cfda98"},{"author":{"_account_id":16274,"name":"Mykola Yakovliev","email":"VegasQ@gmail.com","username":"vegasq"},"change_message_id":"dc01952121513ced7fec40ac965272a3e8b2a0aa","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    def _ensure_network_not_in_use(cls, network_id):"},{"line_number":47,"context_line":"        ports \u003d cls.ntp_client.list_ports(network_id\u003dnetwork_id)[\"ports\"]"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        expected_ports_count \u003d 0"},{"line_number":50,"context_line":"        # Every subnet within network should have a router interface"},{"line_number":51,"context_line":"        expected_ports_count +\u003d len("},{"line_number":52,"context_line":"            cls.ntp_client.show_network(network_id)[\"network\"][\"subnets\"])"},{"line_number":53,"context_line":"        # Every network should have a single dhcp interface"},{"line_number":54,"context_line":"        expected_ports_count +\u003d 1"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        if len(ports) !\u003d expected_ports_count:"},{"line_number":57,"context_line":"            msg \u003d \"Auto Allocated Topology in use.\""}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_aeba92b6","line":54,"range":{"start_line":49,"start_character":8,"end_line":54,"end_character":33},"in_reply_to":"3f79a3b5_0c07161f","updated":"2018-10-04 14:39:25.000000000","message":"It feels more explicit, but I\u0027m fine with either way.\nDone","commit_id":"4d597ccb0d362665104dca3ee10adec9a8cfda98"}]}
