Skip to content

Commit

Permalink
test-tcp-rst.py: Fix flake8 errors.
Browse files Browse the repository at this point in the history
Build fails due to flake8 errors:
===
../tests/test-tcp-rst.py:20:1: F401 'sys' imported but unused
../tests/test-tcp-rst.py:25:80: E501 line too long (85 > 79 characters)
../tests/test-tcp-rst.py:36:80: E501 line too long (90 > 79 characters)
Makefile:2944: recipe for target 'flake8-check' failed
make[1]: *** [flake8-check] Error 1
===

Fixes: b4b6817 ("Fix conntrack entry leaks because of TCP RST packets not sent to conntrack.")
Acked-by: Numan Siddique <numans@ovn.org>
Signed-off-by: Han Zhou <hzhou@ovn.org>
  • Loading branch information
hzhou8 committed May 1, 2020
1 parent aa6cf5d commit 3c2908b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test-tcp-rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
# resets the connection.
import argparse
import socket
import sys
import struct
import time

parser = argparse.ArgumentParser(description='')
parser.add_argument("--src-port", type=int, default=11337, help="source port to use")
parser.add_argument("--src-port", type=int, default=11337,
help="source port to use")
parser.add_argument("--dst-port", type=int, help="dst port to use")
parser.add_argument("--dst-ip", help="server ip to use")
args = parser.parse_args()
Expand All @@ -33,5 +33,6 @@
l_onoff = 1
l_linger = 0
time.sleep(1)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack('ii', l_onoff, l_linger))
sock.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER,
struct.pack('ii', l_onoff, l_linger))
sock.close()

0 comments on commit 3c2908b

Please sign in to comment.