Skip to content

Commit

Permalink
Remove unnecessary library from testswq
Browse files Browse the repository at this point in the history
  • Loading branch information
ciarams87 committed Aug 12, 2022
1 parent 9996ce6 commit 2262e36
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
1 change: 0 additions & 1 deletion perf-tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ PyYAML==6.0
requests==2.28.1
kubernetes==24.2.0
pytest==7.1.2
ipaddress==1.0.23 # >= 1.0.17
cffi==1.15.1
certifi==2022.6.15
urllib3==1.26.11
Expand Down
1 change: 0 additions & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ requests==2.28.1
forcediphttpsadapter==1.0.2
kubernetes==24.2.0
pytest==7.1.2
ipaddress==1.0.23 # >= 1.0.17
cffi==1.15.1
pyOpenSSL==22.0.0
certifi==2022.6.15
Expand Down
18 changes: 12 additions & 6 deletions tests/suite/test_transport_server_udp_load_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ def chk_endpoint(endp):
endpoint. Otherwise, return unmodified endpoint.
"""
ip = endp[:endp.rfind(":")]
address = ipaddress.ip_address(ip)
try:
address = ipaddress.ip_address(ip)
except ValueError:
return endp
if address.version == 6:
port = endp[endp.rfind(":"):]
return f"[{ip}]{port}"
Expand All @@ -37,11 +40,14 @@ def ipfamily_from_host(host):
Return socket type (AF_INET or AF_INET6) based on
IP address type from host
"""
address = ipaddress.ip_address(host)
if address.version == 6:
return socket.AF_INET6
else:
return socket.AF_INET
sock = socket.AF_INET
try:
address = ipaddress.ip_address(host)
if address.version == 6:
sock = socket.AF_INET6
except ValueError:
pass
return sock

@pytest.mark.ts
@pytest.mark.skip_for_loadbalancer
Expand Down

0 comments on commit 2262e36

Please sign in to comment.