)]}'
{"neutron/tests/api/test_network_ip_availability.py":[{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"e97c9edc53f35e26dd25ce8e138bf7ec34f561b9","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        self, expected_used, expected_total, network):"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        def assert_usage():"},{"line_number":77,"context_line":"            availabilities \u003d self.admin_client.list_network_ip_availabilities()"},{"line_number":78,"context_line":"            for availability in availabilities[\u0027network_ip_availabilities\u0027]:"},{"line_number":79,"context_line":"                if availability[\u0027network_id\u0027] \u003d\u003d network[\u0027id\u0027]:"},{"line_number":80,"context_line":"                    return (expected_total \u003d\u003d availability[\u0027total_ips\u0027] and"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba0121b8_eb5d2048","line":77,"range":{"start_line":77,"start_character":29,"end_line":77,"end_character":79},"updated":"2016-03-31 04:51:20.000000000","message":"Armando ! I feel we should test show as well. I realized for these kinds of tests show would work. will add david on this. I tried self.admin_client_show_network_ip_availabilities() it did not work like. it is in client https://github.com/openstack/python-neutronclient/blob/master/neutronclient/v2_0/client.py#L1765","commit_id":"708b04476d599586b72fd2884e002e697fa369f1"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"53b0fc66a8e712e4c8a1395a45c192e55d6ceff8","unresolved":false,"context_lines":[{"line_number":33,"context_line":"# broadcast address"},{"line_number":34,"context_line":"DEFAULT_IP6_RESERVED \u003d 2"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"TIMEOUT \u003d 10"},{"line_number":37,"context_line":"SLEEP \u003d 2"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba0121b8_1334b047","line":36,"range":{"start_line":36,"start_character":0,"end_line":36,"end_character":12},"updated":"2016-04-01 15:41:00.000000000","message":"It looks like this test needs to increase the value. In my env, \"TIMEOUT \u003d 10\" always fails but \"TIMEOUT \u003d 15\" always successes. It depends on the env so I cannot point out appropriate value but I hope it will be helpful to you.","commit_id":"6aaea664f33ec410a194ac58db46897e6fa6d64c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ac7c9865c803c09cccc65dd7913feb6e28c26b96","unresolved":false,"context_lines":[{"line_number":33,"context_line":"# broadcast address"},{"line_number":34,"context_line":"DEFAULT_IP6_RESERVED \u003d 2"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"TIMEOUT \u003d 10"},{"line_number":37,"context_line":"SLEEP \u003d 2"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba0121b8_db0fe786","line":36,"range":{"start_line":36,"start_character":0,"end_line":36,"end_character":12},"in_reply_to":"ba0121b8_1334b047","updated":"2016-04-01 19:10:27.000000000","message":"it looks like a timeout of 10 seconds should suffice but on a busy system I wonder why it would be taking so long. I\u0027ll try to bump it up just in case.","commit_id":"6aaea664f33ec410a194ac58db46897e6fa6d64c"},{"author":{"_account_id":10962,"name":"David Bingham","email":"dbingham@godaddy.com","username":"wwriverrat"},"change_message_id":"928601a9f9e80301dec7e3bc1658d07bc120748f","unresolved":false,"context_lines":[{"line_number":62,"context_line":"                if availability[\u0027network_id\u0027] \u003d\u003d network[\u0027id\u0027]:"},{"line_number":63,"context_line":"                    return availability[\u0027used_ips\u0027]"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _cleanUp_port(self, port_id):"},{"line_number":66,"context_line":"        # delete port, any way to avoid race"},{"line_number":67,"context_line":"        try:"},{"line_number":68,"context_line":"            self.client.delete_port(port_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba0121b8_0dc83ea5","line":65,"updated":"2016-03-31 20:02:16.000000000","message":"I would refactor this method to let us know the cleanup occurred. Something like this:\n\n    def _cleanup_port(self, port_id):\n        def fully_delete_port():\n            try:\n                self.client.delete_port(port_id)\n            except lib_exc.NotFound:\n                return True\n            return False\n\n        test.call_until_true(fully_delete_port, TIMEOUT, SLEEP)\n\n\n    # Later in your test code when you delete the port do...\n    test.call_until_true(_cleanup_port, TIMEOUT, SLEEP)\n    # Then do tests/assertions for IP availability\n    ... code to fetch ip availability and assertions ...\n\nThis way you can take all of the port-gone polling out of the availability calls. Also, if the test fails due to the test.call_until_true above, it\u0027s because the port failed to delete (code outside our control) and not because the IP availability code.","commit_id":"6aaea664f33ec410a194ac58db46897e6fa6d64c"},{"author":{"_account_id":10962,"name":"David Bingham","email":"dbingham@godaddy.com","username":"wwriverrat"},"change_message_id":"da0da9db9961b7d23cf657bcc6dafdb2a65da62d","unresolved":false,"context_lines":[{"line_number":62,"context_line":"                if availability[\u0027network_id\u0027] \u003d\u003d network[\u0027id\u0027]:"},{"line_number":63,"context_line":"                    return availability[\u0027used_ips\u0027]"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _cleanUp_port(self, port_id):"},{"line_number":66,"context_line":"        # delete port, any way to avoid race"},{"line_number":67,"context_line":"        try:"},{"line_number":68,"context_line":"            self.client.delete_port(port_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba0121b8_26171f49","line":65,"in_reply_to":"ba0121b8_0dc83ea5","updated":"2016-03-31 20:12:06.000000000","message":"Restating to fix error in my comment:\n\n    def _cleanup_port(self, port_id):\n        def fully_delete_port():\n            try:\n                self.client.delete_port(port_id)\n            except lib_exc.NotFound:\n                return True\n            return False\n        test.call_until_true(fully_delete_port, TIMEOUT, SLEEP)\n\n    # Later in your test code when you delete the port do...\n    self._cleanup_port(port[\u0027port\u0027][\u0027id\u0027])\n    # Then do tests/assertions for IP availability\n    ... code to fetch ip availability and assertions ...","commit_id":"6aaea664f33ec410a194ac58db46897e6fa6d64c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ac7c9865c803c09cccc65dd7913feb6e28c26b96","unresolved":false,"context_lines":[{"line_number":62,"context_line":"                if availability[\u0027network_id\u0027] \u003d\u003d network[\u0027id\u0027]:"},{"line_number":63,"context_line":"                    return availability[\u0027used_ips\u0027]"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _cleanUp_port(self, port_id):"},{"line_number":66,"context_line":"        # delete port, any way to avoid race"},{"line_number":67,"context_line":"        try:"},{"line_number":68,"context_line":"            self.client.delete_port(port_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba0121b8_fb33cb60","line":65,"in_reply_to":"ba0121b8_26171f49","updated":"2016-04-01 19:10:27.000000000","message":"@David: the way the Neutron API works is that the delete transaction is committed before the response is returned, therefore polling on port delete is not the fix.","commit_id":"6aaea664f33ec410a194ac58db46897e6fa6d64c"},{"author":{"_account_id":10962,"name":"David Bingham","email":"dbingham@godaddy.com","username":"wwriverrat"},"change_message_id":"53dc9b3a00915e264fad86783818dbe73e870e39","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        self.assertTrue("},{"line_number":107,"context_line":"            test.call_until_true("},{"line_number":108,"context_line":"                get_used_ip, TIMEOUT, SLEEP),"},{"line_number":109,"context_line":"            msg\u003d\"IP address did not become used after subnet create\")"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        return subnet, prefix_len"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba0121b8_a2fbdf46","line":109,"updated":"2016-04-01 23:07:19.000000000","message":"As far as I know: Creating a subnet alone does not consume an IP. You have to reserve a IP from within that subnet for one to be consumed. The API is implemented to derive \"used\" count from ip_allocations and the \"total\" comes from ranges (first_ip to last_ip) in ip_allocation_pools.\n\nTherefore this test doesn\u0027t seem it should ever pass.","commit_id":"74fa98880e6474aca551cbfe7c5754d1d266b320"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"172ebf50b3083c6924945ab290ac8816a19a7a07","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        self.assertTrue("},{"line_number":107,"context_line":"            test.call_until_true("},{"line_number":108,"context_line":"                get_used_ip, TIMEOUT, SLEEP),"},{"line_number":109,"context_line":"            msg\u003d\"IP address did not become used after subnet create\")"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        return subnet, prefix_len"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9a061dce_611cce12","line":109,"in_reply_to":"9a061dce_a41b991a","updated":"2016-04-05 17:54:26.000000000","message":"the problem I am seeing is this: on line 82 (coming from line 149) the number of total IP\u0027s computed (in the v4 case) is 3 whereas the test expects only 2. Sometimes, _get_used_ips() returns 1, making the test pass. As far as I can tell, there\u0027s no delete involved at this point yet, so something is not accounted correctly. I have a theory, but I have been pulled into different directions lately and I have been able to focus on this long enough to nail it down.","commit_id":"74fa98880e6474aca551cbfe7c5754d1d266b320"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"563e838d61e1d6e68465948108ba929cce1018c7","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        self.assertTrue("},{"line_number":107,"context_line":"            test.call_until_true("},{"line_number":108,"context_line":"                get_used_ip, TIMEOUT, SLEEP),"},{"line_number":109,"context_line":"            msg\u003d\"IP address did not become used after subnet create\")"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        return subnet, prefix_len"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9a061dce_a41b991a","line":109,"in_reply_to":"ba0121b8_55e6fb16","updated":"2016-04-05 16:48:10.000000000","message":"gateway and dhcp are accounted differently.  The gateway ip is exactly one IP that is reserved from the subnet and is *not* contained in the allocation ranges for the subnet.  So, its consumption shouldn\u0027t count against the total available.\n\nThe DHCP ports *do* come from the allocation ranges.  So, they should count against the total.  However, there may be some delay between the subnet create and the consumption of DHCP ip addresses because the DHCP address are consumed when the DHCP port is created by the DHCP agent.\n\nSo, I agree it makes sense to count only consumable IPs, those from the subnet\u0027s allocation pool.  But, I disagree that DHCP ports don\u0027t count against the consumable IPs.","commit_id":"74fa98880e6474aca551cbfe7c5754d1d266b320"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fb613be770403c399b9f94afdd0944255ffddf64","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        self.assertTrue("},{"line_number":107,"context_line":"            test.call_until_true("},{"line_number":108,"context_line":"                get_used_ip, TIMEOUT, SLEEP),"},{"line_number":109,"context_line":"            msg\u003d\"IP address did not become used after subnet create\")"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        return subnet, prefix_len"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba0121b8_b52f973d","line":109,"in_reply_to":"ba0121b8_a2fbdf46","updated":"2016-04-01 23:34:34.000000000","message":"what about the IP from the DHCP port?","commit_id":"74fa98880e6474aca551cbfe7c5754d1d266b320"},{"author":{"_account_id":10962,"name":"David Bingham","email":"dbingham@godaddy.com","username":"wwriverrat"},"change_message_id":"672249e1a3a1d9f6b58f7abe250cde73523ed08c","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        self.assertTrue("},{"line_number":107,"context_line":"            test.call_until_true("},{"line_number":108,"context_line":"                get_used_ip, TIMEOUT, SLEEP),"},{"line_number":109,"context_line":"            msg\u003d\"IP address did not become used after subnet create\")"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        return subnet, prefix_len"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba0121b8_55e6fb16","line":109,"in_reply_to":"ba0121b8_b52f973d","updated":"2016-04-01 23:38:47.000000000","message":"More clarification: There are \"reserved\" or \"management\" IPs used when creating a subnet but these are not part of the \"used\" count of this API.\n\n\nRead the \"Important Note\" paragraph here about what is \"used\" and what is \"total\": https://github.com/openstack/neutron/blob/master/doc/source/devref/network_ip_availability.rst#network-ip-availability-extension\n\n\nThis code queries and counts the number of allocations from the allocation pools of a subnet. Management IPs such as gateway_ip/dhcp do not become a part of the allocations. Ref: https://github.com/openstack/neutron/blob/master/neutron/db/network_ip_availability_db.py#L91-L100","commit_id":"74fa98880e6474aca551cbfe7c5754d1d266b320"}]}
