)]}'
{"neutron/tests/functional/agent/linux/helpers.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"94b68b94acdb6ad5cbbaed17d9d8d21518dab68e","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        self.port \u003d str(port)"},{"line_number":59,"context_line":"        self.root_helper \u003d root_helper"},{"line_number":60,"context_line":"        self.udp \u003d udp"},{"line_number":61,"context_line":"        self._strace_processes \u003d list()"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def send_data(self, data):"},{"line_number":64,"context_line":"        dst_nc \u003d self._spawn_nc_in_namespace(self.dst_ns.namespace,"}],"source_content_type":"text/x-python","patch_set":6,"id":"da9df570_45b06ef4","line":61,"updated":"2014-09-24 11:29:01.000000000","message":"Ooops","commit_id":"da38518634c7e42a3a0ccf248c6d6ca0440bdcc4"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"e38ed550f25fa26374806326359beccbe9a9b07f","unresolved":false,"context_lines":[{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def _wait_for_nc(self, nc):"},{"line_number":78,"context_line":"        ip_wrapper \u003d ip_lib.IPWrapper(root_helper\u003dnc.root_helper,"},{"line_number":79,"context_line":"                                      namespace\u003dnc.namespace)"},{"line_number":80,"context_line":"        with eventlet.timeout.Timeout(PROCESS_SPAWN_TIMEOUT):"},{"line_number":81,"context_line":"            while True:"},{"line_number":82,"context_line":"                netstat_cmd \u003d [\u0027netstat\u0027, \u0027-putna\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"baa201ad_cbe68616","line":79,"updated":"2014-09-29 13:23:15.000000000","message":"I\u0027m guessing that this timeout isn\u0027t being respected and that the while True is running forever, at the gate. Could this happen somewhere else in this patch?\n\nTo troubleshoot I\u0027d try changing the implementation of this method to a flat sleep of 10 seconds and see if the job still hangs, and if it passes.","commit_id":"2329a85df23658d38311e55c4da7cecbcc3acff1"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f2fd2a28ebc9b5c819bf2055faa21dbd59f93c67","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        self.port \u003d str(port)"},{"line_number":138,"context_line":"        self.root_helper \u003d root_helper"},{"line_number":139,"context_line":"        self.udp \u003d udp"},{"line_number":140,"context_line":"        self._spawn_processes()"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def _spawn_processes(self):"},{"line_number":143,"context_line":"        self.dst_nc \u003d self._spawn_nc_in_namespace(self.dst_ns.namespace,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9aa7fdbe_1861f704","line":140,"updated":"2014-10-27 17:48:44.000000000","message":"Is there a reason to spawn at init rather than lazily when test_connectivity is called?  I\u0027m pretty sure doing potentially costly operations on object creation is an anti-pattern.","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dd93e37d86a7f0f3dc9b55f679a35fafda764509","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        self.port \u003d str(port)"},{"line_number":138,"context_line":"        self.root_helper \u003d root_helper"},{"line_number":139,"context_line":"        self.udp \u003d udp"},{"line_number":140,"context_line":"        self._spawn_processes()"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def _spawn_processes(self):"},{"line_number":143,"context_line":"        self.dst_nc \u003d self._spawn_nc_in_namespace(self.dst_ns.namespace,"}],"source_content_type":"text/x-python","patch_set":17,"id":"5a890539_6bdc4b13","line":140,"in_reply_to":"9aa7fdbe_1861f704","updated":"2014-11-13 13:42:20.000000000","message":"Done","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f2fd2a28ebc9b5c819bf2055faa21dbd59f93c67","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        self.src_nc \u003d self._spawn_nc_in_namespace(self.src_ns.namespace)"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def test_connectivity(self):"},{"line_number":148,"context_line":"        if self.src_nc.poll() is not None:"},{"line_number":149,"context_line":"            self.dst_nc.kill()"},{"line_number":150,"context_line":"            self.dst_nc.wait()"},{"line_number":151,"context_line":"            self._spawn_processes()"}],"source_content_type":"text/x-python","patch_set":17,"id":"9aa7fdbe_2375b063","line":148,"updated":"2014-10-27 17:48:44.000000000","message":"It looks like you\u0027re respawning the processes if the source one is dead.  Why is that expected to occur?","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dd93e37d86a7f0f3dc9b55f679a35fafda764509","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        self.src_nc \u003d self._spawn_nc_in_namespace(self.src_ns.namespace)"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def test_connectivity(self):"},{"line_number":148,"context_line":"        if self.src_nc.poll() is not None:"},{"line_number":149,"context_line":"            self.dst_nc.kill()"},{"line_number":150,"context_line":"            self.dst_nc.wait()"},{"line_number":151,"context_line":"            self._spawn_processes()"}],"source_content_type":"text/x-python","patch_set":17,"id":"5a890539_ab00f301","line":148,"in_reply_to":"9aa7fdbe_2375b063","updated":"2014-11-13 13:42:20.000000000","message":"Because of stateless attribute of UDP. If you have client connected to server and break the connection then client won\u0027t recognize it connection was broken and after you allow connection again it fails anyway due to broken pipe.\n\nIn case I just renew client process I can\u0027t see the messages on the server side.","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f2fd2a28ebc9b5c819bf2055faa21dbd59f93c67","unresolved":false,"context_lines":[{"line_number":151,"context_line":"            self._spawn_processes()"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"        self.src_nc.write(self.TESTING_STRING)"},{"line_number":154,"context_line":"        message \u003d self.dst_nc.read_stdout(READ_TIMEOUT).strip()"},{"line_number":155,"context_line":"        self.dst_nc.write(message)"},{"line_number":156,"context_line":"        message \u003d self.src_nc.read_stdout(READ_TIMEOUT).strip()"},{"line_number":157,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9aa7fdbe_03126c08","line":154,"updated":"2014-10-27 17:48:44.000000000","message":"Again, this timeout should probably be configurable via environment variables in the gate hook script to account for variability in the gate.","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dd93e37d86a7f0f3dc9b55f679a35fafda764509","unresolved":false,"context_lines":[{"line_number":151,"context_line":"            self._spawn_processes()"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"        self.src_nc.write(self.TESTING_STRING)"},{"line_number":154,"context_line":"        message \u003d self.dst_nc.read_stdout(READ_TIMEOUT).strip()"},{"line_number":155,"context_line":"        self.dst_nc.write(message)"},{"line_number":156,"context_line":"        message \u003d self.src_nc.read_stdout(READ_TIMEOUT).strip()"},{"line_number":157,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"5a890539_abc8f322","line":154,"in_reply_to":"9aa7fdbe_03126c08","updated":"2014-11-13 13:42:20.000000000","message":"Will do.","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"f05b47f27c09406c7078fb39b7afb5a161eb5f17","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        if self.udp:"},{"line_number":163,"context_line":"            cmd.append(\u0027-u\u0027)"},{"line_number":164,"context_line":"        if listen:"},{"line_number":165,"context_line":"            cmd.extend([\u0027-l\u0027, \u0027-k\u0027])"},{"line_number":166,"context_line":"        else:"},{"line_number":167,"context_line":"            cmd.extend([\u0027-w\u0027, \u002720\u0027])"},{"line_number":168,"context_line":"        proc \u003d Process(cmd, namespace\u003dnamespace,"}],"source_content_type":"text/x-python","patch_set":17,"id":"5a890539_921ac315","line":165,"updated":"2014-11-11 23:12:58.000000000","message":"When I try to run tests on my platform (f20), I get the following error:\n\nRuntimeError: Process [\u0027nc\u0027, \u0027192.168.0.2\u0027, \u002712345\u0027, \u0027-u\u0027, \u0027-l\u0027, \u0027-k\u0027] hasn\u0027t been spawned in 5 seconds\n\nI\u0027ve tried to manually execute nc inside the namespace, and I get the following:\n\nNcat: UDP mode does not support the -k or --keep-open options, except with --exec or --sh-exec. QUITTING.\n\nI think we should not use -k if self.udp \u003d\u003d True.\n\nMy netcat is: nmap-ncat-6.45-1.fc20.x86_64","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dd93e37d86a7f0f3dc9b55f679a35fafda764509","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        if self.udp:"},{"line_number":163,"context_line":"            cmd.append(\u0027-u\u0027)"},{"line_number":164,"context_line":"        if listen:"},{"line_number":165,"context_line":"            cmd.extend([\u0027-l\u0027, \u0027-k\u0027])"},{"line_number":166,"context_line":"        else:"},{"line_number":167,"context_line":"            cmd.extend([\u0027-w\u0027, \u002720\u0027])"},{"line_number":168,"context_line":"        proc \u003d Process(cmd, namespace\u003dnamespace,"}],"source_content_type":"text/x-python","patch_set":17,"id":"5a890539_cb2ffff4","line":165,"in_reply_to":"5a890539_921ac315","updated":"2014-11-13 13:42:20.000000000","message":"Done","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"0badb83d373d9c3d82ad059364560f3c13730681","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    def client_process(self):"},{"line_number":153,"context_line":"        if not hasattr(self, \u0027_client_process\u0027):"},{"line_number":154,"context_line":"            if not hasattr(self, \u0027_server_process\u0027):"},{"line_number":155,"context_line":"                self._spawn_server_process()"},{"line_number":156,"context_line":"            self._spawn_client_process()"},{"line_number":157,"context_line":"        return self._client_process"},{"line_number":158,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"5a890539_50f17200","line":155,"updated":"2014-11-26 16:17:07.000000000","message":"Why are you (possibly) spawning the server from the client startup?  Seems like this should be done in test_connectivity() below?","commit_id":"e62bd9eb16399e91e0d41d9649c08547d1017c04"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"eb1e2e7ae1803816b9f7dc4ff20a8adf782e5d0e","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    def client_process(self):"},{"line_number":153,"context_line":"        if not hasattr(self, \u0027_client_process\u0027):"},{"line_number":154,"context_line":"            if not hasattr(self, \u0027_server_process\u0027):"},{"line_number":155,"context_line":"                self._spawn_server_process()"},{"line_number":156,"context_line":"            self._spawn_client_process()"},{"line_number":157,"context_line":"        return self._client_process"},{"line_number":158,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"5a890539_27802649","line":155,"in_reply_to":"5a890539_50f17200","updated":"2014-11-26 17:59:21.000000000","message":"client demands server to be running otherwise client will fail to start. Server is spawned only in case it hasn\u0027t been spawned yet. Spawning happens in this case on L184.(lazy spawn)","commit_id":"e62bd9eb16399e91e0d41d9649c08547d1017c04"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"82da07d3bfc5cb01f31ce39b0c51b819c98e3cc8","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    try:"},{"line_number":33,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":34,"context_line":"        port \u003d sock.getsockname()[1]"},{"line_number":35,"context_line":"        sock.close()"},{"line_number":36,"context_line":"    except socket.error:"},{"line_number":37,"context_line":"        port \u003d os.environ.get(\u0027OS_TEST_PORT\u0027, 12345)"},{"line_number":38,"context_line":"    return port"}],"source_content_type":"text/x-python","patch_set":25,"id":"3a961159_d4bf545f","line":35,"updated":"2014-12-12 13:07:53.000000000","message":"should we ensure sock.close is called if bind succeed?","commit_id":"3ad19854d0c1e1fdc9afc6fa2377b35b8928da8f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"4c4a77672ceaef3281f33c27ab27b3f95559047f","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    try:"},{"line_number":33,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":34,"context_line":"        port \u003d sock.getsockname()[1]"},{"line_number":35,"context_line":"        sock.close()"},{"line_number":36,"context_line":"    except socket.error:"},{"line_number":37,"context_line":"        port \u003d os.environ.get(\u0027OS_TEST_PORT\u0027, 12345)"},{"line_number":38,"context_line":"    return port"}],"source_content_type":"text/x-python","patch_set":25,"id":"3a961159_b1548fca","line":35,"in_reply_to":"3a961159_d4bf545f","updated":"2014-12-12 17:47:11.000000000","message":"Done","commit_id":"3ad19854d0c1e1fdc9afc6fa2377b35b8928da8f"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"494a16ce093595557991873a7f97294005a891fb","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        self._spawn_client_process()"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    def test_connectivity(self, respawn\u003dFalse):"},{"line_number":184,"context_line":"        if (respawn and hasattr(self, \u0027_client_process\u0027) and"},{"line_number":185,"context_line":"                self._client_process.poll() is not None):"},{"line_number":186,"context_line":"            self._respawn_processes()"},{"line_number":187,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"3a961159_b2d74a4a","line":184,"updated":"2014-12-12 00:59:07.000000000","message":"Given that self.{client,server}_process will spawn when the attribute does not exist on the instance, consider modifying the cleanup() method to remove the attributes after killing the processes and calling that instead of _respawn_processes().","commit_id":"3ad19854d0c1e1fdc9afc6fa2377b35b8928da8f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"4c4a77672ceaef3281f33c27ab27b3f95559047f","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        self._spawn_client_process()"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    def test_connectivity(self, respawn\u003dFalse):"},{"line_number":184,"context_line":"        if (respawn and hasattr(self, \u0027_client_process\u0027) and"},{"line_number":185,"context_line":"                self._client_process.poll() is not None):"},{"line_number":186,"context_line":"            self._respawn_processes()"},{"line_number":187,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"3a961159_b1756f33","line":184,"in_reply_to":"3a961159_b2d74a4a","updated":"2014-12-12 17:47:11.000000000","message":"Done","commit_id":"3ad19854d0c1e1fdc9afc6fa2377b35b8928da8f"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"a369022b0500091f5fedc390fc5ab2e1b5094511","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        proc_attr_name \u003d \u0027_%s_process\u0027"},{"line_number":204,"context_line":"        for proc_side in (\u0027client\u0027, \u0027server\u0027):"},{"line_number":205,"context_line":"            proc \u003d getattr(self, proc_attr_name % proc_side)"},{"line_number":206,"context_line":"            if proc.poll() is None:"},{"line_number":207,"context_line":"                proc.kill()"},{"line_number":208,"context_line":"                proc.wait()"},{"line_number":209,"context_line":"            delattr(self, proc_attr_name % proc_side)"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a961159_83c3bb36","line":206,"updated":"2014-12-13 04:43:41.000000000","message":"Would it make sense to check if \u0027proc\u0027 is not None as part of this conditional?","commit_id":"b0b790bba09f9dbbd27d46d1dd3aae6e9ce3ce46"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"47a7c55f6581829a67c43d089a41be8f58ec923f","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        proc_attr_name \u003d \u0027_%s_process\u0027"},{"line_number":204,"context_line":"        for proc_side in (\u0027client\u0027, \u0027server\u0027):"},{"line_number":205,"context_line":"            proc \u003d getattr(self, proc_attr_name % proc_side)"},{"line_number":206,"context_line":"            if proc.poll() is None:"},{"line_number":207,"context_line":"                proc.kill()"},{"line_number":208,"context_line":"                proc.wait()"},{"line_number":209,"context_line":"            delattr(self, proc_attr_name % proc_side)"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a961159_e460f302","line":206,"in_reply_to":"3a961159_83c3bb36","updated":"2014-12-15 09:40:19.000000000","message":"Done","commit_id":"b0b790bba09f9dbbd27d46d1dd3aae6e9ce3ce46"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"209c1a3c551d7c190b94363c6de4bbbba2af64bd","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        self._server_process \u003d self._spawn_nc_in_namespace("},{"line_number":170,"context_line":"            self.server_namespace.namespace, listen\u003dTrue)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def _spawn_client_process(self):"},{"line_number":173,"context_line":"        self._client_process \u003d self._spawn_nc_in_namespace("},{"line_number":174,"context_line":"            self.client_namespace.namespace)"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"3a961159_e0744a38","line":172,"updated":"2014-12-15 18:49:27.000000000","message":"(No action required) Not sure why this needs to be a function given that it is only used once.","commit_id":"e47949713b77f3be90ce6b19df3d5c1379018b3b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"01c043aefe84d8edc5659a4d3d29bb5cd8e120fe","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        self._server_process \u003d self._spawn_nc_in_namespace("},{"line_number":170,"context_line":"            self.server_namespace.namespace, listen\u003dTrue)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def _spawn_client_process(self):"},{"line_number":173,"context_line":"        self._client_process \u003d self._spawn_nc_in_namespace("},{"line_number":174,"context_line":"            self.client_namespace.namespace)"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"3a961159_c5082b2b","line":172,"in_reply_to":"3a961159_e0744a38","updated":"2014-12-16 09:48:31.000000000","message":"Done","commit_id":"e47949713b77f3be90ce6b19df3d5c1379018b3b"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"209c1a3c551d7c190b94363c6de4bbbba2af64bd","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        return proc"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"    def stop_processes(self):"},{"line_number":203,"context_line":"        proc_attr_name \u003d \u0027_%s_process\u0027"},{"line_number":204,"context_line":"        for proc_side in (\u0027client\u0027, \u0027server\u0027):"},{"line_number":205,"context_line":"            try:"},{"line_number":206,"context_line":"                proc \u003d getattr(self, proc_attr_name % proc_side)"}],"source_content_type":"text/x-python","patch_set":27,"id":"3a961159_c09e6e54","line":203,"updated":"2014-12-15 18:49:27.000000000","message":"(No action required) Dynamically composing the attribute names seems like more trouble than it\u0027s worth.  Consider defining them statically.","commit_id":"e47949713b77f3be90ce6b19df3d5c1379018b3b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"01c043aefe84d8edc5659a4d3d29bb5cd8e120fe","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        return proc"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"    def stop_processes(self):"},{"line_number":203,"context_line":"        proc_attr_name \u003d \u0027_%s_process\u0027"},{"line_number":204,"context_line":"        for proc_side in (\u0027client\u0027, \u0027server\u0027):"},{"line_number":205,"context_line":"            try:"},{"line_number":206,"context_line":"                proc \u003d getattr(self, proc_attr_name % proc_side)"}],"source_content_type":"text/x-python","patch_set":27,"id":"3a961159_0594f342","line":203,"in_reply_to":"3a961159_c09e6e54","updated":"2014-12-16 09:48:31.000000000","message":"Done","commit_id":"e47949713b77f3be90ce6b19df3d5c1379018b3b"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"887b3d85111c93d54ab9f99ea27e250e864dd1db","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":34,"context_line":"        port \u003d sock.getsockname()[1]"},{"line_number":35,"context_line":"    except socket.error:"},{"line_number":36,"context_line":"        port \u003d os.environ.get(\u0027OS_TEST_PORT\u0027, 12345)"},{"line_number":37,"context_line":"    finally:"},{"line_number":38,"context_line":"        sock.close()"},{"line_number":39,"context_line":"    return port"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_96ae22e6","line":36,"updated":"2014-12-17 17:07:28.000000000","message":"We shouldn\u0027t do the following?\n\n if \u0027OS_TEST_PORT\u0027 in os.environ:\n   return os.environ[...]\n try:\n   ...\n except socket.error:\n   return 12345\n finally:\n   sock.close()","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dce141e5959e048f2be96fd93323e9f17e9e8009","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":34,"context_line":"        port \u003d sock.getsockname()[1]"},{"line_number":35,"context_line":"    except socket.error:"},{"line_number":36,"context_line":"        port \u003d os.environ.get(\u0027OS_TEST_PORT\u0027, 12345)"},{"line_number":37,"context_line":"    finally:"},{"line_number":38,"context_line":"        sock.close()"},{"line_number":39,"context_line":"    return port"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_c349aa8f","line":36,"in_reply_to":"3a961159_441bfd1b","updated":"2015-01-05 14:07:50.000000000","message":"@Cedric: Definitely! I don\u0027t know what the hell was I thinking when I wrote that :-/\n\n@Maru: I\u0027m thinking whether it\u0027s better to let exception fly away cause if there is no free port on machine then something is wrong. I believe this case is not handled anywhere, right?","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7405c702c35e79a62b78b66e3185edaeac05fdef","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":34,"context_line":"        port \u003d sock.getsockname()[1]"},{"line_number":35,"context_line":"    except socket.error:"},{"line_number":36,"context_line":"        port \u003d os.environ.get(\u0027OS_TEST_PORT\u0027, 12345)"},{"line_number":37,"context_line":"    finally:"},{"line_number":38,"context_line":"        sock.close()"},{"line_number":39,"context_line":"    return port"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_b563b4af","line":36,"in_reply_to":"3a961159_57ac8d8c","updated":"2015-01-07 01:02:46.000000000","message":"There is nothing stopping something from grabbing the port once the socket is closed and before we attempt to use it, and it is not impossible for this to happen in an environment with a lot going on, so why exactly wouldn\u0027t we want to retry if we get a port-in-use error?  The example I provided is not exactly complicated to implement.","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0f6e26ba89dbaaee37d985c69d90ec5630f428d9","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":34,"context_line":"        port \u003d sock.getsockname()[1]"},{"line_number":35,"context_line":"    except socket.error:"},{"line_number":36,"context_line":"        port \u003d os.environ.get(\u0027OS_TEST_PORT\u0027, 12345)"},{"line_number":37,"context_line":"    finally:"},{"line_number":38,"context_line":"        sock.close()"},{"line_number":39,"context_line":"    return port"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_441bfd1b","line":36,"in_reply_to":"3a961159_96ae22e6","updated":"2014-12-18 17:14:07.000000000","message":"I was the one that suggested randomizing the port that was used to avoid errors during concurrent test execution, but I\u0027m afraid I didn\u0027t look at the resulting solution very carefully.  I don\u0027t think returning an environment-supplied port number is a good idea (especially in preference to a random port), since returning a consistent value pretty much guarantees port-in-use errors once we have enough tests using this mechanism.  Instead, I would like to see the port selection to be performed in concert with server spawn so that we effectively eliminate the possibility of port conflict entirely, e.g.\n\n\ndef spawn_server():\n  cmd \u003d ...\n  while True:\n    port \u003d get_free_port()\n    try:\n      proc \u003d exec_cmd(cmd, port)\n    except [port-in-use]:\n      continue\n    else:\n       return proc","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"d25476dc339e4de814e5701ccd8c5928e5c44a3c","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":34,"context_line":"        port \u003d sock.getsockname()[1]"},{"line_number":35,"context_line":"    except socket.error:"},{"line_number":36,"context_line":"        port \u003d os.environ.get(\u0027OS_TEST_PORT\u0027, 12345)"},{"line_number":37,"context_line":"    finally:"},{"line_number":38,"context_line":"        sock.close()"},{"line_number":39,"context_line":"    return port"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_dc278461","line":36,"in_reply_to":"3a961159_b563b4af","updated":"2015-01-07 09:58:05.000000000","message":"IIUC your idea was that we will handle port-in-use in case we\u0027re spawning a process and it collides (process fails to spawn). That means this function get_free_network_port() is now ok, right? \n\nGiven that in test is only a single process spawned in isolated namespace there is no chance there will be any other port opened. Or am I missing something?","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"429da47b2914e03dfdbb772aa328932d6caf5121","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":34,"context_line":"        port \u003d sock.getsockname()[1]"},{"line_number":35,"context_line":"    except socket.error:"},{"line_number":36,"context_line":"        port \u003d os.environ.get(\u0027OS_TEST_PORT\u0027, 12345)"},{"line_number":37,"context_line":"    finally:"},{"line_number":38,"context_line":"        sock.close()"},{"line_number":39,"context_line":"    return port"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_57ac8d8c","line":36,"in_reply_to":"3a961159_c349aa8f","updated":"2015-01-05 14:51:25.000000000","message":"Turns out I wrote a similar function just today for the full-stack framework.\n\nI agree with Kuba here - letting the OS choose the port also makes sure that the port is free, and is therefor safe to use. If there are no free ports then something has opened some (65536-1024) sockets... It is in my eyes equivalent to having no more PIDs (\"fork bomb\") which isn\u0027t handled in Neutron either.\n\nSeems like get_free_port() should indeed be used right before exec_cmd() (like Maru said).","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"887b3d85111c93d54ab9f99ea27e250e864dd1db","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    @property"},{"line_number":155,"context_line":"    def client_process(self):"},{"line_number":156,"context_line":"        if not hasattr(self, \u0027_client_process\u0027):"},{"line_number":157,"context_line":"            if not hasattr(self, \u0027_server_process\u0027):"},{"line_number":158,"context_line":"                self._spawn_server_process()"},{"line_number":159,"context_line":"            self._client_process \u003d self._spawn_nc_in_namespace("}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_1605d2c1","line":156,"updated":"2014-12-17 17:07:28.000000000","message":"It\u0027s really unelegant to create/delete _.*_process attributes, why not setting them to None before spawn and after stop?","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0f6e26ba89dbaaee37d985c69d90ec5630f428d9","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    @property"},{"line_number":155,"context_line":"    def client_process(self):"},{"line_number":156,"context_line":"        if not hasattr(self, \u0027_client_process\u0027):"},{"line_number":157,"context_line":"            if not hasattr(self, \u0027_server_process\u0027):"},{"line_number":158,"context_line":"                self._spawn_server_process()"},{"line_number":159,"context_line":"            self._client_process \u003d self._spawn_nc_in_namespace("}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_a10573c3","line":156,"in_reply_to":"3a961159_1605d2c1","updated":"2014-12-18 17:14:07.000000000","message":"You\u0027re right, it would be cleaner to set to None instead.  I don\u0027t think it\u0027s something that should block a merge, but given the need to fix the port selection, it\u0027s fair game.","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dce141e5959e048f2be96fd93323e9f17e9e8009","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    @property"},{"line_number":155,"context_line":"    def client_process(self):"},{"line_number":156,"context_line":"        if not hasattr(self, \u0027_client_process\u0027):"},{"line_number":157,"context_line":"            if not hasattr(self, \u0027_server_process\u0027):"},{"line_number":158,"context_line":"                self._spawn_server_process()"},{"line_number":159,"context_line":"            self._client_process \u003d self._spawn_nc_in_namespace("}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_4e3b21c8","line":156,"in_reply_to":"3a961159_a10573c3","updated":"2015-01-05 14:07:50.000000000","message":"Done","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"887b3d85111c93d54ab9f99ea27e250e864dd1db","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    def test_connectivity(self, respawn\u003dFalse):"},{"line_number":174,"context_line":"        if (respawn and hasattr(self, \u0027_client_process\u0027) and"},{"line_number":175,"context_line":"                self._client_process.poll() is not None):"},{"line_number":176,"context_line":"            self.stop_processes()"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        self.client_process.writeline(self.TESTING_STRING)"},{"line_number":179,"context_line":"        message \u003d self.server_process.read_stdout(READ_TIMEOUT).strip()"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_769c565e","line":176,"updated":"2014-12-17 17:07:28.000000000","message":"stop_processes should be called at the end of the method otherwise an addCleanup(netcat.stop_processes) is required in the test class.","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7405c702c35e79a62b78b66e3185edaeac05fdef","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    def test_connectivity(self, respawn\u003dFalse):"},{"line_number":174,"context_line":"        if (respawn and hasattr(self, \u0027_client_process\u0027) and"},{"line_number":175,"context_line":"                self._client_process.poll() is not None):"},{"line_number":176,"context_line":"            self.stop_processes()"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        self.client_process.writeline(self.TESTING_STRING)"},{"line_number":179,"context_line":"        message \u003d self.server_process.read_stdout(READ_TIMEOUT).strip()"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_75b78c21","line":176,"in_reply_to":"3a961159_17a2059a","updated":"2015-01-07 01:02:46.000000000","message":"I think you\u0027re trying entirely too hard.  This is a test, not production code.  addCleanup is fine, and I really don\u0027t think it matters whether addCleanup is called before any resources are created.","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"f7006d0246cb3092312d35a422f37a8e5a594e33","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    def test_connectivity(self, respawn\u003dFalse):"},{"line_number":174,"context_line":"        if (respawn and hasattr(self, \u0027_client_process\u0027) and"},{"line_number":175,"context_line":"                self._client_process.poll() is not None):"},{"line_number":176,"context_line":"            self.stop_processes()"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        self.client_process.writeline(self.TESTING_STRING)"},{"line_number":179,"context_line":"        message \u003d self.server_process.read_stdout(READ_TIMEOUT).strip()"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_97497c33","line":176,"in_reply_to":"3a961159_214b432c","updated":"2014-12-19 11:09:11.000000000","message":"it seems a wrong pattern to cleanup resources before recreating them ... instead of the opposite ... it implies the first cleanup is useless and the last one is missing.","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b4f08e8f8b65dd61d922d971cba68ce862043a00","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    def test_connectivity(self, respawn\u003dFalse):"},{"line_number":174,"context_line":"        if (respawn and hasattr(self, \u0027_client_process\u0027) and"},{"line_number":175,"context_line":"                self._client_process.poll() is not None):"},{"line_number":176,"context_line":"            self.stop_processes()"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        self.client_process.writeline(self.TESTING_STRING)"},{"line_number":179,"context_line":"        message \u003d self.server_process.read_stdout(READ_TIMEOUT).strip()"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_449dbd56","line":176,"in_reply_to":"3a961159_448f7d2e","updated":"2015-01-05 14:25:37.000000000","message":"I\u0027m open to better ways but I don\u0027t see how to achieve it. How would you make sure that process hasn\u0027t ended by using context?","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"1d0e0c2e30af86197b6470bfa8876a440bee758d","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    def test_connectivity(self, respawn\u003dFalse):"},{"line_number":174,"context_line":"        if (respawn and hasattr(self, \u0027_client_process\u0027) and"},{"line_number":175,"context_line":"                self._client_process.poll() is not None):"},{"line_number":176,"context_line":"            self.stop_processes()"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        self.client_process.writeline(self.TESTING_STRING)"},{"line_number":179,"context_line":"        message \u003d self.server_process.read_stdout(READ_TIMEOUT).strip()"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_17a2059a","line":176,"in_reply_to":"3a961159_449dbd56","updated":"2015-01-05 14:58:26.000000000","message":"a first proposal:\n\n  @contextlib.contextmanager\n  def with_connectivity(self):\n     client_process \u003d self.client_process\n     server_process \u003d self.server_process\n     try:\n      yield client_process, server_process\n     finally:\n      self.stop_processes()\n\n  def test_connectivity(self):\n     with self.with_connectivity(self) as (client_process, server_process):\n       client_process.writeline(self.TESTING_STRING)\n       message \u003d server_process.read_stdout(READ_TIMEOUT).strip()\n       server_process.writeline(message)\n       message \u003d client_process.read_stdout(READ_TIMEOUT).strip()\n       return message \u003d\u003d self.TESTING_STRING\n\nbut it\u0027s really unelegant as nothing ensures tests won\u0027t use self.client/server_process directly. replacing the 2 properties by _create_client/server_process and with_connectivity becomes:\n\n  @contextlib.contextmanager\n  def with_connectivity(self):\n     client_process \u003d self._create_client_process()\n     server_process \u003d self._create_server_process()\n     try:\n      yield client_process, server_process\n     finally:\n      self.stop_process(client_process)\n      self.stop_process(server_process)","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0f6e26ba89dbaaee37d985c69d90ec5630f428d9","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    def test_connectivity(self, respawn\u003dFalse):"},{"line_number":174,"context_line":"        if (respawn and hasattr(self, \u0027_client_process\u0027) and"},{"line_number":175,"context_line":"                self._client_process.poll() is not None):"},{"line_number":176,"context_line":"            self.stop_processes()"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        self.client_process.writeline(self.TESTING_STRING)"},{"line_number":179,"context_line":"        message \u003d self.server_process.read_stdout(READ_TIMEOUT).strip()"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_214b432c","line":176,"in_reply_to":"3a961159_769c565e","updated":"2014-12-18 17:14:07.000000000","message":"stop_processes is being called here to ensure a respawn occurs, and  addCleanup is required in the test class regardless.  Would a self-documenting conditional might make this more clear? e.g.\n\nstop_required \u003d (respawn and ...)\nif stop_required:\n  self.stop_processes()","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dce141e5959e048f2be96fd93323e9f17e9e8009","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    def test_connectivity(self, respawn\u003dFalse):"},{"line_number":174,"context_line":"        if (respawn and hasattr(self, \u0027_client_process\u0027) and"},{"line_number":175,"context_line":"                self._client_process.poll() is not None):"},{"line_number":176,"context_line":"            self.stop_processes()"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        self.client_process.writeline(self.TESTING_STRING)"},{"line_number":179,"context_line":"        message \u003d self.server_process.read_stdout(READ_TIMEOUT).strip()"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_ee7bed78","line":176,"in_reply_to":"3a961159_97497c33","updated":"2015-01-05 14:07:50.000000000","message":"The reason of not having stop_process() at the end is to keep open connection. This is handy when testing that creating firewall rule to block connection will actually break the connection. Respawn here is to test the connection if one process was already terminated.","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"5cb381aab0f36c5968661adabfde3befbc3c5e84","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    def test_connectivity(self, respawn\u003dFalse):"},{"line_number":174,"context_line":"        if (respawn and hasattr(self, \u0027_client_process\u0027) and"},{"line_number":175,"context_line":"                self._client_process.poll() is not None):"},{"line_number":176,"context_line":"            self.stop_processes()"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        self.client_process.writeline(self.TESTING_STRING)"},{"line_number":179,"context_line":"        message \u003d self.server_process.read_stdout(READ_TIMEOUT).strip()"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_448f7d2e","line":176,"in_reply_to":"3a961159_ee7bed78","updated":"2015-01-05 14:23:13.000000000","message":"A context would support such case","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"1c300e2bb80089c1ecf7aa06b68ec7d35869d886","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    sock \u003d socket.socket()"},{"line_number":35,"context_line":"    try:"},{"line_number":36,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":37,"context_line":"        return sock.getsockname()[1]"},{"line_number":38,"context_line":"    finally:"},{"line_number":39,"context_line":"        sock.close()"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"3a961159_86885023","line":37,"updated":"2015-01-07 04:47:07.000000000","message":"+1, you might hit a race here. better to handle it now than trying to track down one-off gate failures down the road.","commit_id":"0872c401fc88adf00094c9165e7f8af212e63eec"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"b71021e55a85ca0c9f86c26a3b93f6f63746d7a4","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    sock \u003d socket.socket()"},{"line_number":35,"context_line":"    try:"},{"line_number":36,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":37,"context_line":"        return sock.getsockname()[1]"},{"line_number":38,"context_line":"    finally:"},{"line_number":39,"context_line":"        sock.close()"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"3a961159_b5d81454","line":37,"updated":"2015-01-07 01:07:27.000000000","message":"Please see my comment from the previous patchset.","commit_id":"0872c401fc88adf00094c9165e7f8af212e63eec"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"e55db568aed7a3dfb773a4083b2f69f647575e56","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    sock \u003d socket.socket()"},{"line_number":35,"context_line":"    try:"},{"line_number":36,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":37,"context_line":"        return sock.getsockname()[1]"},{"line_number":38,"context_line":"    finally:"},{"line_number":39,"context_line":"        sock.close()"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"3a961159_4433fdf6","line":37,"in_reply_to":"3a961159_1278e8c2","updated":"2015-01-14 10:01:13.000000000","message":"I completely missed how I\u0027m using it. It must be used as an external process if we want to use it in namespace. This way it returned free port from system which could potentially be used in the namespace...","commit_id":"0872c401fc88adf00094c9165e7f8af212e63eec"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"3e66bafc9762de80412dcc78aa758cac8ce7b7f4","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    sock \u003d socket.socket()"},{"line_number":35,"context_line":"    try:"},{"line_number":36,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":37,"context_line":"        return sock.getsockname()[1]"},{"line_number":38,"context_line":"    finally:"},{"line_number":39,"context_line":"        sock.close()"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"3a961159_1278e8c2","line":37,"in_reply_to":"3a961159_21c0387b","updated":"2015-01-08 16:13:03.000000000","message":"Uh, ignore me.  Documentation is the way to go...","commit_id":"0872c401fc88adf00094c9165e7f8af212e63eec"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"e56dd717319a9fbd0efed110f2d6ff4682941250","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    sock \u003d socket.socket()"},{"line_number":35,"context_line":"    try:"},{"line_number":36,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":37,"context_line":"        return sock.getsockname()[1]"},{"line_number":38,"context_line":"    finally:"},{"line_number":39,"context_line":"        sock.close()"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"3a961159_21c0387b","line":37,"in_reply_to":"3a961159_4f42f8ab","updated":"2015-01-08 14:27:41.000000000","message":"Doh!  I somehow missed the point about spawning a single process in an isolated namespace.  Considering that, it\u0027s pretty unlikely that we\u0027re going to see a collision.  That said, I wouldn\u0027t want to see someone use this function in ignorance of the potential for collision and introduce weird races into the tests, so at the minimum I would expect this function\u0027s limitations to be documented (e.g. \u0027This function provides no strong guarantee of port uniqueness when the port will not be opened on an isolated namespace\u0027).  Given how trivial it is to implement my suggestion, though, I\u0027m not sure why it wouldn\u0027t be preferable to documentation.","commit_id":"0872c401fc88adf00094c9165e7f8af212e63eec"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"e0f3f5259867316fe29407eda005c280b290f6bc","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    sock \u003d socket.socket()"},{"line_number":35,"context_line":"    try:"},{"line_number":36,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":37,"context_line":"        return sock.getsockname()[1]"},{"line_number":38,"context_line":"    finally:"},{"line_number":39,"context_line":"        sock.close()"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"3a961159_bc955833","line":37,"in_reply_to":"3a961159_86885023","updated":"2015-01-07 10:04:35.000000000","message":"Copying here from previous PS:\n\nIIUC your idea was that we will handle port-in-use in case we\u0027re spawning a process and it collides (process fails to spawn). That means this function get_free_network_port() is now ok, right?\n\nGiven that in test is only a single process spawned in isolated namespace there is no chance there will be any other port opened. Or am I missing something?","commit_id":"0872c401fc88adf00094c9165e7f8af212e63eec"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"f6b8fb1a810e097222190c80adb00c8110b1feae","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    sock \u003d socket.socket()"},{"line_number":35,"context_line":"    try:"},{"line_number":36,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":37,"context_line":"        return sock.getsockname()[1]"},{"line_number":38,"context_line":"    finally:"},{"line_number":39,"context_line":"        sock.close()"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"3a961159_4f42f8ab","line":37,"in_reply_to":"3a961159_9c9a5c12","updated":"2015-01-07 10:43:22.000000000","message":"you should add \"based on current NetcatTester use\" ... i would prefer like maru/kevin that we address it to avoid potential (painful) race condition troubles in the future.","commit_id":"0872c401fc88adf00094c9165e7f8af212e63eec"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"6aec20530ce831d6f92d2031d38861e9575e11a6","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    sock \u003d socket.socket()"},{"line_number":35,"context_line":"    try:"},{"line_number":36,"context_line":"        sock.bind((\u0027\u0027, 0))"},{"line_number":37,"context_line":"        return sock.getsockname()[1]"},{"line_number":38,"context_line":"    finally:"},{"line_number":39,"context_line":"        sock.close()"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"3a961159_9c9a5c12","line":37,"in_reply_to":"3a961159_bc955833","updated":"2015-01-07 10:37:45.000000000","message":"Since the same port can be safely associated to 2 different interfaces on 2 different namespaces, and since the ports are associated to temporary interfaces which are created for this test (and deleted afterwards), I don\u0027t believe what Maru and Kevin are proposing is needed.\n\nIn fact, I\u0027m not sure why setting some hard-coded port won\u0027t work here. The chances of some other test/process using the exact same namespaces and interfaces at the exact same time...","commit_id":"0872c401fc88adf00094c9165e7f8af212e63eec"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"376e3336535a1edcf2973a7c75db3d17c7bc4279","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from neutron.agent.linux import utils"},{"line_number":27,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"CHILD_PROCESS_TIMEOUT \u003d os.environ.get(\u0027OS_TEST_CHILD_PROCESS_TIMEOUT\u0027, 20)"},{"line_number":32,"context_line":"CHILD_PROCESS_SLEEP \u003d os.environ.get(\u0027OS_TEST_CHILD_PROCESS_SLEEP\u0027, 0.5)"}],"source_content_type":"text/x-python","patch_set":33,"id":"3a961159_8fde3c0f","line":29,"updated":"2015-01-20 04:38:55.000000000","message":"This appears unused?","commit_id":"688f86efa4c7f3d33d406f0997a106bbdf39c097"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"5e676d9cf48e4462ceff89185b9ac4fe317efedc","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from neutron.agent.linux import utils"},{"line_number":27,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"CHILD_PROCESS_TIMEOUT \u003d os.environ.get(\u0027OS_TEST_CHILD_PROCESS_TIMEOUT\u0027, 20)"},{"line_number":32,"context_line":"CHILD_PROCESS_SLEEP \u003d os.environ.get(\u0027OS_TEST_CHILD_PROCESS_SLEEP\u0027, 0.5)"}],"source_content_type":"text/x-python","patch_set":33,"id":"1a930d6b_4b9d8f65","line":29,"in_reply_to":"3a961159_8fde3c0f","updated":"2015-01-26 17:49:28.000000000","message":"Done","commit_id":"688f86efa4c7f3d33d406f0997a106bbdf39c097"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f55d7282ea2bdbdf57b96e83fde5b8d5d9bcf1ea","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    r\u0027^.*\\s+\\d+\\s+.*:(?P\u003cport\u003e\\d+)\\s+[0-9:].*\u0027)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def get_free_namespace_port(tcp\u003dTrue, root_helper\u003dNone, namespace\u003dNone):"},{"line_number":40,"context_line":"    \"\"\"Return an unused port from given namespace"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    WARNING: This function returns a port that is free at the execution time of"}],"source_content_type":"text/x-python","patch_set":33,"id":"3a961159_436765ea","line":39,"updated":"2015-01-14 16:46:05.000000000","message":"I was thinking about alternative: having simple script with function from previous PS that will print to stdout the port. This way we won\u0027t need any output parsing and randomly choosing from set difference.\n\nI haven\u0027t found how to call setns() syscall for this process in order to get free port from given namespace ...","commit_id":"688f86efa4c7f3d33d406f0997a106bbdf39c097"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"376e3336535a1edcf2973a7c75db3d17c7bc4279","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    r\u0027^.*\\s+\\d+\\s+.*:(?P\u003cport\u003e\\d+)\\s+[0-9:].*\u0027)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def get_free_namespace_port(tcp\u003dTrue, root_helper\u003dNone, namespace\u003dNone):"},{"line_number":40,"context_line":"    \"\"\"Return an unused port from given namespace"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    WARNING: This function returns a port that is free at the execution time of"}],"source_content_type":"text/x-python","patch_set":33,"id":"3a961159_af31385b","line":39,"in_reply_to":"3a961159_436765ea","updated":"2015-01-20 04:38:55.000000000","message":"Why are the root_helper and namespace parameters optional if they are required?","commit_id":"688f86efa4c7f3d33d406f0997a106bbdf39c097"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"66ba437a6124c4ab41b708e638e1759d936c9b2f","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    r\u0027^.*\\s+\\d+\\s+.*:(?P\u003cport\u003e\\d+)\\s+[0-9:].*\u0027)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def get_free_namespace_port(tcp\u003dTrue, root_helper\u003dNone, namespace\u003dNone):"},{"line_number":40,"context_line":"    \"\"\"Return an unused port from given namespace"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    WARNING: This function returns a port that is free at the execution time of"}],"source_content_type":"text/x-python","patch_set":33,"id":"3a961159_f9b22795","line":39,"in_reply_to":"3a961159_af31385b","updated":"2015-01-20 08:46:53.000000000","message":"If None is passed to IPWrapper, global namespace is used.","commit_id":"688f86efa4c7f3d33d406f0997a106bbdf39c097"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"376e3336535a1edcf2973a7c75db3d17c7bc4279","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    return get_unused_number_from_sequence(used_ports)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def get_source_ports_from_ss_output(output):"},{"line_number":63,"context_line":"    ports \u003d set()"},{"line_number":64,"context_line":"    for line in output.splitlines():"},{"line_number":65,"context_line":"        match \u003d SS_SOURCE_PORT_PATTERN.match(line)"}],"source_content_type":"text/x-python","patch_set":33,"id":"3a961159_2f4548b4","line":62,"updated":"2015-01-20 04:38:55.000000000","message":"(No action required) Consider prefixing with an underscore to indicate that this is an internal method.","commit_id":"688f86efa4c7f3d33d406f0997a106bbdf39c097"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"5e676d9cf48e4462ceff89185b9ac4fe317efedc","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    return get_unused_number_from_sequence(used_ports)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def get_source_ports_from_ss_output(output):"},{"line_number":63,"context_line":"    ports \u003d set()"},{"line_number":64,"context_line":"    for line in output.splitlines():"},{"line_number":65,"context_line":"        match \u003d SS_SOURCE_PORT_PATTERN.match(line)"}],"source_content_type":"text/x-python","patch_set":33,"id":"1a930d6b_0bcc6769","line":62,"in_reply_to":"3a961159_2f4548b4","updated":"2015-01-26 17:49:28.000000000","message":"Done","commit_id":"688f86efa4c7f3d33d406f0997a106bbdf39c097"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"376e3336535a1edcf2973a7c75db3d17c7bc4279","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    return ports"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"def get_unused_number_from_sequence(used, start\u003d1024, end\u003d65535):"},{"line_number":72,"context_line":"    candidates \u003d set(range(start, end + 1))"},{"line_number":73,"context_line":"    return random.choice(list(candidates - used))"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"3a961159_0f1facb9","line":71,"updated":"2015-01-20 04:38:55.000000000","message":"(No action required) Given that the start/end values are tailored for use with port selection, consider renaming to \u0027get_unused_port\u0027","commit_id":"688f86efa4c7f3d33d406f0997a106bbdf39c097"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"5e676d9cf48e4462ceff89185b9ac4fe317efedc","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    return ports"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"def get_unused_number_from_sequence(used, start\u003d1024, end\u003d65535):"},{"line_number":72,"context_line":"    candidates \u003d set(range(start, end + 1))"},{"line_number":73,"context_line":"    return random.choice(list(candidates - used))"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"1a930d6b_2bc92359","line":71,"in_reply_to":"3a961159_0f1facb9","updated":"2015-01-26 17:49:28.000000000","message":"Done","commit_id":"688f86efa4c7f3d33d406f0997a106bbdf39c097"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b573211afed8010279e9b935b40534e5677a9ea0","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    r\u0027^.*\\s+\\d+\\s+.*:(?P\u003cport\u003e\\d+)\\s+[0-9:].*\u0027)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def get_free_namespace_port(tcp\u003dTrue, root_helper\u003dNone, namespace\u003dNone):"},{"line_number":37,"context_line":"    \"\"\"Return an unused port from given namespace"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    WARNING: This function returns a port that is free at the execution time of"}],"source_content_type":"text/x-python","patch_set":34,"id":"1a930d6b_7fa83c8d","line":36,"updated":"2015-01-26 21:32:54.000000000","message":"wouldn\u0027t be more readable to have proto \u003d [\u0027udp\u0027 | \u0027tcp\u0027] instead of this bool flag?","commit_id":"e3fa0112820e6ae95c61b5ebc150e4ba206b3c3c"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fd32494d32f769c411350d6623dca1d1a09d9740","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    r\u0027^.*\\s+\\d+\\s+.*:(?P\u003cport\u003e\\d+)\\s+[0-9:].*\u0027)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def get_free_namespace_port(tcp\u003dTrue, root_helper\u003dNone, namespace\u003dNone):"},{"line_number":37,"context_line":"    \"\"\"Return an unused port from given namespace"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    WARNING: This function returns a port that is free at the execution time of"}],"source_content_type":"text/x-python","patch_set":34,"id":"1a930d6b_cb8ec32d","line":36,"in_reply_to":"1a930d6b_7fa83c8d","updated":"2015-01-27 08:52:00.000000000","message":"I agree. It\u0027s also more generic. Thanks for suggestion.","commit_id":"e3fa0112820e6ae95c61b5ebc150e4ba206b3c3c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b573211afed8010279e9b935b40534e5677a9ea0","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                port for UDP protocol if set to False"},{"line_number":46,"context_line":"    \"\"\""},{"line_number":47,"context_line":"    if tcp:"},{"line_number":48,"context_line":"        param \u003d \u0027-tna\u0027"},{"line_number":49,"context_line":"    else:"},{"line_number":50,"context_line":"        param \u003d \u0027-una\u0027"},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"1a930d6b_bf854408","line":48,"updated":"2015-01-26 21:32:54.000000000","message":"if you followed my suggestion above this could be:\n\nparams \u003d {\u0027tcp\u0027: \u0027-tna\u0027, \u0027udp\u0027: \u0027-una\u0027}","commit_id":"e3fa0112820e6ae95c61b5ebc150e4ba206b3c3c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b573211afed8010279e9b935b40534e5677a9ea0","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        param \u003d \u0027-una\u0027"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    ip_wrapper \u003d ip_lib.IPWrapper(root_helper, namespace)"},{"line_number":53,"context_line":"    output \u003d ip_wrapper.netns.execute([\u0027ss\u0027, param])"},{"line_number":54,"context_line":"    used_ports \u003d _get_source_ports_from_ss_output(output)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    return get_unused_port(used_ports)"}],"source_content_type":"text/x-python","patch_set":34,"id":"1a930d6b_df7db01d","line":53,"updated":"2015-01-26 21:32:54.000000000","message":"params[proto]","commit_id":"e3fa0112820e6ae95c61b5ebc150e4ba206b3c3c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b573211afed8010279e9b935b40534e5677a9ea0","unresolved":false,"context_lines":[{"line_number":211,"context_line":"            self.pid, root_helper\u003dself.root_helper)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"class NetcatTester(object):"},{"line_number":215,"context_line":"    TESTING_STRING \u003d \u0027foo\u0027"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"    def __init__(self, client_namespace, server_namespace, address, port,"}],"source_content_type":"text/x-python","patch_set":34,"id":"1a930d6b_1fb7383b","line":214,"updated":"2015-01-26 21:32:54.000000000","message":"not worth holding this patch on this, but whenever a helper class/method is added, it\u0027d be polite to have docstrings. Consider this as a follow-up or suggestion for future reference.","commit_id":"e3fa0112820e6ae95c61b5ebc150e4ba206b3c3c"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fd32494d32f769c411350d6623dca1d1a09d9740","unresolved":false,"context_lines":[{"line_number":211,"context_line":"            self.pid, root_helper\u003dself.root_helper)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"class NetcatTester(object):"},{"line_number":215,"context_line":"    TESTING_STRING \u003d \u0027foo\u0027"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"    def __init__(self, client_namespace, server_namespace, address, port,"}],"source_content_type":"text/x-python","patch_set":34,"id":"1a930d6b_6bc78f64","line":214,"in_reply_to":"1a930d6b_1fb7383b","updated":"2015-01-27 08:52:00.000000000","message":"Noted :)","commit_id":"e3fa0112820e6ae95c61b5ebc150e4ba206b3c3c"}],"neutron/tests/functional/agent/linux/test_iptables.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f2fd2a28ebc9b5c819bf2055faa21dbd59f93c67","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.tests.functional.agent.linux import helpers"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"PROTOCOL_BLOCK_RULE \u003d \u0027-p %s -j DROP\u0027"},{"line_number":22,"context_line":"PROTOCOL_PORT_BLOCK_RULE \u003d \u0027-p %s --dport %d -j DROP\u0027"},{"line_number":23,"context_line":"NC_PORT \u003d 12345"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9aa7fdbe_98632741","line":21,"updated":"2014-10-27 17:48:44.000000000","message":"I\u0027m not sure why these are defined test-only.  Aren\u0027t they used elsewhere in the code?","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dd93e37d86a7f0f3dc9b55f679a35fafda764509","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.tests.functional.agent.linux import helpers"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"PROTOCOL_BLOCK_RULE \u003d \u0027-p %s -j DROP\u0027"},{"line_number":22,"context_line":"PROTOCOL_PORT_BLOCK_RULE \u003d \u0027-p %s --dport %d -j DROP\u0027"},{"line_number":23,"context_line":"NC_PORT \u003d 12345"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9aa7fdbe_dd21e6fd","line":21,"in_reply_to":"9aa7fdbe_98632741","updated":"2014-11-13 13:42:20.000000000","message":"Such things are hardcoded in iptables_firewall. There are not constants for this.","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"12011396585e166ef8834d35bdc5df40d5e7fe2a","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.tests.functional.agent.linux import helpers"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"PROTOCOL_BLOCK_RULE \u003d \u0027-p %s -j DROP\u0027"},{"line_number":22,"context_line":"PROTOCOL_PORT_BLOCK_RULE \u003d \u0027-p %s --dport %d -j DROP\u0027"},{"line_number":23,"context_line":"NC_PORT \u003d 12345"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"5a890539_f270d909","line":21,"in_reply_to":"9aa7fdbe_dd21e6fd","updated":"2014-11-25 12:18:00.000000000","message":"Should we then make iptables_firewall use the pattern instead of hardcoding it?","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f2fd2a28ebc9b5c819bf2055faa21dbd59f93c67","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"PROTOCOL_BLOCK_RULE \u003d \u0027-p %s -j DROP\u0027"},{"line_number":22,"context_line":"PROTOCOL_PORT_BLOCK_RULE \u003d \u0027-p %s --dport %d -j DROP\u0027"},{"line_number":23,"context_line":"NC_PORT \u003d 12345"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def _ipv4_filter_execute(manager, method, chain, rule):"}],"source_content_type":"text/x-python","patch_set":17,"id":"9aa7fdbe_784843b3","line":23,"updated":"2014-10-27 17:48:44.000000000","message":"Would it make sense to randomize this port and/or look for an unused port in the event of conflict to avoid spurious test failure?","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dd93e37d86a7f0f3dc9b55f679a35fafda764509","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"PROTOCOL_BLOCK_RULE \u003d \u0027-p %s -j DROP\u0027"},{"line_number":22,"context_line":"PROTOCOL_PORT_BLOCK_RULE \u003d \u0027-p %s --dport %d -j DROP\u0027"},{"line_number":23,"context_line":"NC_PORT \u003d 12345"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def _ipv4_filter_execute(manager, method, chain, rule):"}],"source_content_type":"text/x-python","patch_set":17,"id":"9aa7fdbe_fd1eaaba","line":23,"in_reply_to":"9aa7fdbe_784843b3","updated":"2014-11-13 13:42:20.000000000","message":"Good idea, I\u0027ll implement this.","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f2fd2a28ebc9b5c819bf2055faa21dbd59f93c67","unresolved":false,"context_lines":[{"line_number":23,"context_line":"NC_PORT \u003d 12345"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def _ipv4_filter_execute(manager, method, chain, rule):"},{"line_number":27,"context_line":"    method \u003d getattr(manager.ipv4[\u0027filter\u0027], method)"},{"line_number":28,"context_line":"    method(chain, rule)"},{"line_number":29,"context_line":"    manager.apply()"}],"source_content_type":"text/x-python","patch_set":17,"id":"9aa7fdbe_581fffb6","line":26,"updated":"2014-10-27 17:48:44.000000000","message":"Should these helpers be incorporated in to the manager class?","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dd93e37d86a7f0f3dc9b55f679a35fafda764509","unresolved":false,"context_lines":[{"line_number":23,"context_line":"NC_PORT \u003d 12345"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def _ipv4_filter_execute(manager, method, chain, rule):"},{"line_number":27,"context_line":"    method \u003d getattr(manager.ipv4[\u0027filter\u0027], method)"},{"line_number":28,"context_line":"    method(chain, rule)"},{"line_number":29,"context_line":"    manager.apply()"}],"source_content_type":"text/x-python","patch_set":17,"id":"9aa7fdbe_7d82bac9","line":26,"in_reply_to":"9aa7fdbe_581fffb6","updated":"2014-11-13 13:42:20.000000000","message":"As static methods?","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f2fd2a28ebc9b5c819bf2055faa21dbd59f93c67","unresolved":false,"context_lines":[{"line_number":65,"context_line":"            self.assertTrue(netcat.test_connectivity())"},{"line_number":66,"context_line":"            ipv4_filter_add_rule("},{"line_number":67,"context_line":"                iptables_manager, chain, block_rule)"},{"line_number":68,"context_line":"            self.assertRaises(RuntimeError, netcat.test_connectivity)"},{"line_number":69,"context_line":"            ipv4_filter_remove_rule("},{"line_number":70,"context_line":"                iptables_manager, chain, block_rule)"},{"line_number":71,"context_line":"            self.assertTrue(netcat.test_connectivity())"}],"source_content_type":"text/x-python","patch_set":17,"id":"9aa7fdbe_b81e2b6e","line":68,"updated":"2014-10-27 17:48:44.000000000","message":"Prefer:\n\nwith testtools.ExpectedException(RuntimeError):\n  netcat.test_connectivity()","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dd93e37d86a7f0f3dc9b55f679a35fafda764509","unresolved":false,"context_lines":[{"line_number":65,"context_line":"            self.assertTrue(netcat.test_connectivity())"},{"line_number":66,"context_line":"            ipv4_filter_add_rule("},{"line_number":67,"context_line":"                iptables_manager, chain, block_rule)"},{"line_number":68,"context_line":"            self.assertRaises(RuntimeError, netcat.test_connectivity)"},{"line_number":69,"context_line":"            ipv4_filter_remove_rule("},{"line_number":70,"context_line":"                iptables_manager, chain, block_rule)"},{"line_number":71,"context_line":"            self.assertTrue(netcat.test_connectivity())"}],"source_content_type":"text/x-python","patch_set":17,"id":"9aa7fdbe_1d736e16","line":68,"in_reply_to":"9aa7fdbe_b81e2b6e","updated":"2014-11-13 13:42:20.000000000","message":"Will do.","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f2fd2a28ebc9b5c819bf2055faa21dbd59f93c67","unresolved":false,"context_lines":[{"line_number":70,"context_line":"                iptables_manager, chain, block_rule)"},{"line_number":71,"context_line":"            self.assertTrue(netcat.test_connectivity())"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def test_tcp_input_port(self):"},{"line_number":74,"context_line":"        self._test_with_nc(self.dst_iptables,"},{"line_number":75,"context_line":"                           \u0027INPUT\u0027,"},{"line_number":76,"context_line":"                           PROTOCOL_PORT_BLOCK_RULE % (\u0027tcp\u0027, NC_PORT),"}],"source_content_type":"text/x-python","patch_set":17,"id":"9aa7fdbe_38007b33","line":73,"updated":"2014-10-27 17:48:44.000000000","message":"I\u0027m concerned that what is being tested is iptables itself rather than our interaction with it.  Might it make more sense to ensure that the correct filters are seen to be applied (via inspecting iptables output) for most cases and then for safety check the filtering of a single one of them?  Perhaps it\u0027s not even necessary to be checking the filtering once we have in-tree integration testing that validates security group usage.","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"06f31858579f2f1c055e8a0bfcbcbc33dacf7bbe","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"PROTOCOL_BLOCK_RULE \u003d \u0027-p %s -j DROP\u0027"},{"line_number":23,"context_line":"PROTOCOL_PORT_BLOCK_RULE \u003d \u0027-p %s --dport %d -j DROP\u0027"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"class FirewallTestBase(object):"}],"source_content_type":"text/x-python","patch_set":20,"id":"5a890539_7d17a745","line":23,"updated":"2014-11-21 16:00:39.000000000","message":"I think this could be moved under IptablesManagerTestCase","commit_id":"e62bd9eb16399e91e0d41d9649c08547d1017c04"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"0badb83d373d9c3d82ad059364560f3c13730681","unresolved":false,"context_lines":[{"line_number":116,"context_line":""},{"line_number":117,"context_line":"class IptablesManagerTestCase(FirewallTestBase, base.BaseIPVethTestCase):"},{"line_number":118,"context_line":"    TRAFFIC_CHAIN_MAPPER \u003d {\u0027ingress\u0027: \u0027INPUT\u0027,"},{"line_number":119,"context_line":"                            \u0027egress\u0027: \u0027OUTPUT\u0027}"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def create_firewalls(self):"},{"line_number":122,"context_line":"        client_iptables \u003d iptables_manager.IptablesManager("}],"source_content_type":"text/x-python","patch_set":20,"id":"5a890539_90f59a86","line":119,"updated":"2014-11-26 16:17:07.000000000","message":"So you\u0027re following what the firewall code does and use \u0027ingress\u0027 and \u0027egress\u0027, then change it to iptables values.  Guess I\u0027m Ok with that if you\u0027re trying to keep this very generic.\n\nBut perhaps instead of \u0027traffic\u0027 as the argument below it should be \u0027direction\u0027?  I had to look a few times to figure out what that was.","commit_id":"e62bd9eb16399e91e0d41d9649c08547d1017c04"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"eb1e2e7ae1803816b9f7dc4ff20a8adf782e5d0e","unresolved":false,"context_lines":[{"line_number":116,"context_line":""},{"line_number":117,"context_line":"class IptablesManagerTestCase(FirewallTestBase, base.BaseIPVethTestCase):"},{"line_number":118,"context_line":"    TRAFFIC_CHAIN_MAPPER \u003d {\u0027ingress\u0027: \u0027INPUT\u0027,"},{"line_number":119,"context_line":"                            \u0027egress\u0027: \u0027OUTPUT\u0027}"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def create_firewalls(self):"},{"line_number":122,"context_line":"        client_iptables \u003d iptables_manager.IptablesManager("}],"source_content_type":"text/x-python","patch_set":20,"id":"5a890539_07b96a15","line":119,"in_reply_to":"5a890539_90f59a86","updated":"2014-11-26 17:59:21.000000000","message":"Good idea, I\u0027ll rename it to direction. The idea behind generic naming is to extend FirewallTestBase class with different drivers and achieve the same test scenarios for given driver.","commit_id":"e62bd9eb16399e91e0d41d9649c08547d1017c04"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"cb7bc6444f4508424299fb340cc800df18a8143e","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        client_iptables \u003d iptables_manager.IptablesManager("},{"line_number":131,"context_line":"            root_helper\u003dself.root_helper,"},{"line_number":132,"context_line":"            namespace\u003dself.client_ns.namespace)"},{"line_number":133,"context_line":"        server_iptabels \u003d iptables_manager.IptablesManager("},{"line_number":134,"context_line":"            root_helper\u003dself.root_helper,"},{"line_number":135,"context_line":"            namespace\u003dself.server_ns.namespace)"},{"line_number":136,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"5a890539_97c28251","line":133,"updated":"2014-12-02 02:51:36.000000000","message":"nit: s/server_iptabels/server_iptables","commit_id":"3b22b77c37984618f228151fa40dea859a0f102b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a01cda12e1b15f014dabd382f631341525267e19","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        client_iptables \u003d iptables_manager.IptablesManager("},{"line_number":131,"context_line":"            root_helper\u003dself.root_helper,"},{"line_number":132,"context_line":"            namespace\u003dself.client_ns.namespace)"},{"line_number":133,"context_line":"        server_iptabels \u003d iptables_manager.IptablesManager("},{"line_number":134,"context_line":"            root_helper\u003dself.root_helper,"},{"line_number":135,"context_line":"            namespace\u003dself.server_ns.namespace)"},{"line_number":136,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"5a890539_80179144","line":133,"in_reply_to":"5a890539_97c28251","updated":"2014-12-02 09:04:54.000000000","message":"Good eye!","commit_id":"3b22b77c37984618f228151fa40dea859a0f102b"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"cb7bc6444f4508424299fb340cc800df18a8143e","unresolved":false,"context_lines":[{"line_number":134,"context_line":"            root_helper\u003dself.root_helper,"},{"line_number":135,"context_line":"            namespace\u003dself.server_ns.namespace)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        return client_iptables, server_iptabels"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def filter_add_rule(self, fw_manager, address, direction, protocol, port):"},{"line_number":140,"context_line":"        self._ipv4_filter_execute(fw_manager, \u0027add_rule\u0027, direction, protocol,"}],"source_content_type":"text/x-python","patch_set":24,"id":"5a890539_578f3a2e","line":137,"updated":"2014-12-02 02:51:36.000000000","message":"Here too, same typo in both places made it work","commit_id":"3b22b77c37984618f228151fa40dea859a0f102b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a01cda12e1b15f014dabd382f631341525267e19","unresolved":false,"context_lines":[{"line_number":134,"context_line":"            root_helper\u003dself.root_helper,"},{"line_number":135,"context_line":"            namespace\u003dself.server_ns.namespace)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        return client_iptables, server_iptabels"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def filter_add_rule(self, fw_manager, address, direction, protocol, port):"},{"line_number":140,"context_line":"        self._ipv4_filter_execute(fw_manager, \u0027add_rule\u0027, direction, protocol,"}],"source_content_type":"text/x-python","patch_set":24,"id":"5a890539_603385f6","line":137,"in_reply_to":"5a890539_578f3a2e","updated":"2014-12-02 09:04:54.000000000","message":"Done","commit_id":"3b22b77c37984618f228151fa40dea859a0f102b"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"494a16ce093595557991873a7f97294005a891fb","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        protocol \u003d \u0027tcp\u0027"},{"line_number":79,"context_line":"        if udp:"},{"line_number":80,"context_line":"            protocol \u003d \u0027udp\u0027"},{"line_number":81,"context_line":"        with self.assert_max_execution_time(15):"},{"line_number":82,"context_line":"            self.assertTrue(netcat.test_connectivity())"},{"line_number":83,"context_line":"            self.filter_add_rule("},{"line_number":84,"context_line":"                fw_manager, self.DST_ADDRESS, direction, protocol, port)"}],"source_content_type":"text/x-python","patch_set":25,"id":"3a961159_72b40235","line":81,"updated":"2014-12-12 00:59:07.000000000","message":"Should this timeout be configurable?","commit_id":"3ad19854d0c1e1fdc9afc6fa2377b35b8928da8f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"4c4a77672ceaef3281f33c27ab27b3f95559047f","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        protocol \u003d \u0027tcp\u0027"},{"line_number":79,"context_line":"        if udp:"},{"line_number":80,"context_line":"            protocol \u003d \u0027udp\u0027"},{"line_number":81,"context_line":"        with self.assert_max_execution_time(15):"},{"line_number":82,"context_line":"            self.assertTrue(netcat.test_connectivity())"},{"line_number":83,"context_line":"            self.filter_add_rule("},{"line_number":84,"context_line":"                fw_manager, self.DST_ADDRESS, direction, protocol, port)"}],"source_content_type":"text/x-python","patch_set":25,"id":"3a961159_0f51be0e","line":81,"in_reply_to":"3a961159_72b40235","updated":"2014-12-12 17:47:11.000000000","message":"Per our conversation I submitted patch to set timeout globally: https://review.openstack.org/141441","commit_id":"3ad19854d0c1e1fdc9afc6fa2377b35b8928da8f"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"494a16ce093595557991873a7f97294005a891fb","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        self.pinger.assert_ping_from_ns(self.client_ns, self.DST_ADDRESS)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def test_tcp_input_port(self):"},{"line_number":99,"context_line":"        self._test_with_nc(self.server_fw, \u0027ingress\u0027, False, self.port)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def test_tcp_output_port(self):"},{"line_number":102,"context_line":"        self._test_with_nc(self.client_fw, \u0027egress\u0027, False, self.port)"}],"source_content_type":"text/x-python","patch_set":25,"id":"3a961159_5260e6ce","line":99,"updated":"2014-12-12 00:59:07.000000000","message":"(No action required) Specifying keyword names (e.g. udp\u003dFalse) can aid in readability.","commit_id":"3ad19854d0c1e1fdc9afc6fa2377b35b8928da8f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"4c4a77672ceaef3281f33c27ab27b3f95559047f","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        self.pinger.assert_ping_from_ns(self.client_ns, self.DST_ADDRESS)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def test_tcp_input_port(self):"},{"line_number":99,"context_line":"        self._test_with_nc(self.server_fw, \u0027ingress\u0027, False, self.port)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def test_tcp_output_port(self):"},{"line_number":102,"context_line":"        self._test_with_nc(self.client_fw, \u0027egress\u0027, False, self.port)"}],"source_content_type":"text/x-python","patch_set":25,"id":"3a961159_51b9ab77","line":99,"in_reply_to":"3a961159_5260e6ce","updated":"2014-12-12 17:47:11.000000000","message":"Done","commit_id":"3ad19854d0c1e1fdc9afc6fa2377b35b8928da8f"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"a369022b0500091f5fedc390fc5ab2e1b5094511","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        protocol \u003d \u0027tcp\u0027"},{"line_number":79,"context_line":"        if udp:"},{"line_number":80,"context_line":"            protocol \u003d \u0027udp\u0027"},{"line_number":81,"context_line":"        self.assertTrue(netcat.test_connectivity())"},{"line_number":82,"context_line":"        self.filter_add_rule("},{"line_number":83,"context_line":"            fw_manager, self.DST_ADDRESS, direction, protocol, port)"},{"line_number":84,"context_line":"        with testtools.ExpectedException(RuntimeError):"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a961159_c3e063cf","line":81,"updated":"2014-12-13 04:43:41.000000000","message":"I think you\u0027ll need to add the timeout back in since this patch is not dependent on your global timeout patch yet and if this patch merges before that one there won\u0027t be a check on the test taking too long.","commit_id":"b0b790bba09f9dbbd27d46d1dd3aae6e9ce3ce46"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"47a7c55f6581829a67c43d089a41be8f58ec923f","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        protocol \u003d \u0027tcp\u0027"},{"line_number":79,"context_line":"        if udp:"},{"line_number":80,"context_line":"            protocol \u003d \u0027udp\u0027"},{"line_number":81,"context_line":"        self.assertTrue(netcat.test_connectivity())"},{"line_number":82,"context_line":"        self.filter_add_rule("},{"line_number":83,"context_line":"            fw_manager, self.DST_ADDRESS, direction, protocol, port)"},{"line_number":84,"context_line":"        with testtools.ExpectedException(RuntimeError):"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a961159_c414d74e","line":81,"in_reply_to":"3a961159_c3e063cf","updated":"2014-12-15 09:40:19.000000000","message":"I\u0027ll make this patch dependent on the one with global timeout.","commit_id":"b0b790bba09f9dbbd27d46d1dd3aae6e9ce3ce46"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"f7006d0246cb3092312d35a422f37a8e5a594e33","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from neutron.tests.functional.agent.linux import helpers"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class FirewallTestBase(object):"},{"line_number":23,"context_line":"    \"\"\"Base class for firewall drivers testing"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    This class must be used as mixin with class or subclass of"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_d766a4ba","line":22,"updated":"2014-12-19 11:09:11.000000000","message":"I would prefer FirewallTestMixin.","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"269a65a34732f5608d8d4d3f9bb0ad18db525e8b","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from neutron.tests.functional.agent.linux import helpers"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class FirewallTestBase(object):"},{"line_number":23,"context_line":"    \"\"\"Base class for firewall drivers testing"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    This class must be used as mixin with class or subclass of"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_917996c7","line":22,"in_reply_to":"3a961159_55fff0aa","updated":"2015-01-14 16:42:08.000000000","message":"My apologies. I\u0027ll implement scenarios with later patches, when I start testing new iptables driver. For now, squashing these two classes. Thanks.","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7405c702c35e79a62b78b66e3185edaeac05fdef","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from neutron.tests.functional.agent.linux import helpers"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class FirewallTestBase(object):"},{"line_number":23,"context_line":"    \"\"\"Base class for firewall drivers testing"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    This class must be used as mixin with class or subclass of"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_55fff0aa","line":22,"in_reply_to":"3a961159_94c27651","updated":"2015-01-07 01:02:46.000000000","message":"Ixnay on the mixin-nay!   If you find yourself wanting to use a mixin - or even name something \u0027mixin\u0027 - stop yourself and figure out a way to use composition or testscenarios instead.  The mess that is our current plugin testing should be warning enough.","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dce141e5959e048f2be96fd93323e9f17e9e8009","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from neutron.tests.functional.agent.linux import helpers"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class FirewallTestBase(object):"},{"line_number":23,"context_line":"    \"\"\"Base class for firewall drivers testing"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    This class must be used as mixin with class or subclass of"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_94c27651","line":22,"in_reply_to":"3a961159_d766a4ba","updated":"2015-01-05 14:07:50.000000000","message":"Done","commit_id":"d8ead9401f661292b287ee1a363aaa1a2ed4a895"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"b71021e55a85ca0c9f86c26a3b93f6f63746d7a4","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from neutron.tests.functional.agent.linux import helpers"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class FirewallTestMixin(object):"},{"line_number":23,"context_line":"    \"\"\"Base class for firewall drivers testing"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    This class must be used as mixin with class or subclass of"}],"source_content_type":"text/x-python","patch_set":30,"id":"3a961159_d5a760ba","line":22,"updated":"2015-01-07 01:07:27.000000000","message":"Please see comment from previous patchset.","commit_id":"0872c401fc88adf00094c9165e7f8af212e63eec"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"376e3336535a1edcf2973a7c75db3d17c7bc4279","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        super(IptablesManagerTestCase, self).setUp()"},{"line_number":30,"context_line":"        self.client_ns, self.server_ns \u003d self.prepare_veth_pairs()"},{"line_number":31,"context_line":"        self.client_fw, self.server_fw \u003d self.create_firewalls()"},{"line_number":32,"context_line":"        self.port \u003d helpers.get_free_namespace_port(self.server_ns.namespace)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def create_firewalls(self):"},{"line_number":35,"context_line":"        client_iptables \u003d iptables_manager.IptablesManager("}],"source_content_type":"text/x-python","patch_set":33,"id":"3a961159_2fe1c89b","line":32,"updated":"2015-01-20 04:38:55.000000000","message":"(No action required) Consider adding a comment that the namespace isolation effectively precludes the possibility of port conflict.","commit_id":"688f86efa4c7f3d33d406f0997a106bbdf39c097"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"5e676d9cf48e4462ceff89185b9ac4fe317efedc","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        super(IptablesManagerTestCase, self).setUp()"},{"line_number":30,"context_line":"        self.client_ns, self.server_ns \u003d self.prepare_veth_pairs()"},{"line_number":31,"context_line":"        self.client_fw, self.server_fw \u003d self.create_firewalls()"},{"line_number":32,"context_line":"        self.port \u003d helpers.get_free_namespace_port(self.server_ns.namespace)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def create_firewalls(self):"},{"line_number":35,"context_line":"        client_iptables \u003d iptables_manager.IptablesManager("}],"source_content_type":"text/x-python","patch_set":33,"id":"1a930d6b_0b41c7a8","line":32,"in_reply_to":"3a961159_2fe1c89b","updated":"2015-01-26 17:49:28.000000000","message":"Done","commit_id":"688f86efa4c7f3d33d406f0997a106bbdf39c097"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"376e3336535a1edcf2973a7c75db3d17c7bc4279","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        self.server_fw.apply()"},{"line_number":106,"context_line":"        self.pinger.assert_ping_from_ns(self.client_ns, self.DST_ADDRESS)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def test_tcp_input_port(self):"},{"line_number":109,"context_line":"        self._test_with_nc(self.server_fw, \u0027ingress\u0027, self.port, udp\u003dFalse)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    def test_tcp_output_port(self):"}],"source_content_type":"text/x-python","patch_set":33,"id":"3a961159_2f4aa8ad","line":108,"updated":"2015-01-20 04:38:55.000000000","message":"(No action required) This type of parameter-driven testing definitely recommends testscenarios.","commit_id":"688f86efa4c7f3d33d406f0997a106bbdf39c097"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"5e676d9cf48e4462ceff89185b9ac4fe317efedc","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        self.server_fw.apply()"},{"line_number":106,"context_line":"        self.pinger.assert_ping_from_ns(self.client_ns, self.DST_ADDRESS)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def test_tcp_input_port(self):"},{"line_number":109,"context_line":"        self._test_with_nc(self.server_fw, \u0027ingress\u0027, self.port, udp\u003dFalse)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    def test_tcp_output_port(self):"}],"source_content_type":"text/x-python","patch_set":33,"id":"1a930d6b_86bccedd","line":108,"in_reply_to":"3a961159_2f4aa8ad","updated":"2015-01-26 17:49:28.000000000","message":"Will do in a new changeset.","commit_id":"688f86efa4c7f3d33d406f0997a106bbdf39c097"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b573211afed8010279e9b935b40534e5677a9ea0","unresolved":false,"context_lines":[{"line_number":72,"context_line":"                                      self.DST_ADDRESS, self.port,"},{"line_number":73,"context_line":"                                      self.root_helper, udp\u003dudp)"},{"line_number":74,"context_line":"        self.addCleanup(netcat.stop_processes)"},{"line_number":75,"context_line":"        protocol \u003d \u0027tcp\u0027"},{"line_number":76,"context_line":"        if udp:"},{"line_number":77,"context_line":"            protocol \u003d \u0027udp\u0027"},{"line_number":78,"context_line":"        self.assertTrue(netcat.test_connectivity())"}],"source_content_type":"text/x-python","patch_set":34,"id":"1a930d6b_bf5d447b","line":75,"updated":"2015-01-26 21:32:54.000000000","message":"see my suggestion in previous file","commit_id":"e3fa0112820e6ae95c61b5ebc150e4ba206b3c3c"}],"neutron/tests/functional/contrib/filters.template":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f2fd2a28ebc9b5c819bf2055faa21dbd59f93c67","unresolved":false,"context_lines":[{"line_number":18,"context_line":"tee_kill: KillFilter, root, tee, -9"},{"line_number":19,"context_line":"nc_filter: CommandFilter, nc, root"},{"line_number":20,"context_line":"nc_kill: KillFilter, root, nc, -9"},{"line_number":21,"context_line":"ncbsd_kill: KillFilter, root, nc.openbsd, -9"}],"source_content_type":"application/octet-stream","patch_set":17,"id":"9aa7fdbe_982ec7f9","line":21,"updated":"2014-10-27 17:48:44.000000000","message":"Why is this necessary?","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dd93e37d86a7f0f3dc9b55f679a35fafda764509","unresolved":false,"context_lines":[{"line_number":18,"context_line":"tee_kill: KillFilter, root, tee, -9"},{"line_number":19,"context_line":"nc_filter: CommandFilter, nc, root"},{"line_number":20,"context_line":"nc_kill: KillFilter, root, nc, -9"},{"line_number":21,"context_line":"ncbsd_kill: KillFilter, root, nc.openbsd, -9"}],"source_content_type":"application/octet-stream","patch_set":17,"id":"5a890539_4b506f5e","line":21,"in_reply_to":"9aa7fdbe_982ec7f9","updated":"2014-11-13 13:42:20.000000000","message":"During my work on this test I ran into different issues with netcat. It\u0027s not the same across distributions. Ubuntu 14 uses symlink from /bin/nc to /bin/nc.openbsd. KillFilter in oslo matches filters according /proc/PID/exe - which is the actual executable. Meaning that running nc process is actually nc.openbsd.\n\nOn Fedora nc is just bash wrapper that calls exec to ncat, so we might add \u0027ncat\u0027 as well...","commit_id":"b13d5da1ec60cdff02a4fd5813d8ab4e84a2f46e"}],"tox.ini":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5221e877a95a65c6fc1effdca9d455c71f3d1f6d","unresolved":false,"context_lines":[{"line_number":30,"context_line":"setenv \u003d OS_TEST_PATH\u003d./neutron/tests/functional"},{"line_number":31,"context_line":"         OS_SUDO_TESTING\u003d1"},{"line_number":32,"context_line":"         OS_ROOTWRAP_CMD\u003dsudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf"},{"line_number":33,"context_line":"         OS_FAIL_ON_MISSING_DEPS\u003d1"},{"line_number":34,"context_line":"         OS_TEST_TIMEOUT\u003d10"},{"line_number":35,"context_line":"sitepackages\u003dTrue"},{"line_number":36,"context_line":"commands \u003d"}],"source_content_type":"text/x-properties","patch_set":10,"id":"baa201ad_c25ad982","line":33,"updated":"2014-09-29 21:22:44.000000000","message":"This seems to destroy the job \u003dD","commit_id":"43a7175ca463ad844d0ad7e76dc20ff11d016b9a"}]}
