summaryrefslogtreecommitdiffhomepage
path: root/test/test_proxy.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2023-11-08 18:37:02 +0000
committerAndrei Zeliankou <zelenkov@nginx.com>2023-11-08 18:37:02 +0000
commit0b85fe29f7e49c88cab88aa9303d5885fa9c9dd5 (patch)
tree329ee87058eea8631596c802c23f39b78ad9446b /test/test_proxy.py
parent78c133d0ca3c343135e123a087970837afdebed1 (diff)
downloadunit-0b85fe29f7e49c88cab88aa9303d5885fa9c9dd5.tar.gz
unit-0b85fe29f7e49c88cab88aa9303d5885fa9c9dd5.tar.bz2
Tests: 8XXX used as default port range.
After the launch of the project, the testing infrastructure was shared with nginx project in some cases. To avoid port overlap, a decision was made to shift the port range for Unit tests. This problem was resolved a long time ago and is no longer relevant, so it is now safe to use port 8XXX range as the default, as it is more appropriate for testing purposes.
Diffstat (limited to '')
-rw-r--r--test/test_proxy.py60
1 files changed, 30 insertions, 30 deletions
diff --git a/test/test_proxy.py b/test/test_proxy.py
index 207e90e7..b64e19db 100644
--- a/test/test_proxy.py
+++ b/test/test_proxy.py
@@ -23,10 +23,10 @@ def setup_method_fixture():
assert 'success' in client.conf(
{
"listeners": {
- "*:7080": {"pass": "routes"},
- "*:7081": {"pass": "applications/mirror"},
+ "*:8080": {"pass": "routes"},
+ "*:8081": {"pass": "applications/mirror"},
},
- "routes": [{"action": {"proxy": "http://127.0.0.1:7081"}}],
+ "routes": [{"action": {"proxy": "http://127.0.0.1:8081"}}],
"applications": {
"mirror": {
"type": client.get_application_type(),
@@ -110,19 +110,19 @@ def test_proxy_chain():
assert 'success' in client.conf(
{
"listeners": {
- "*:7080": {"pass": "routes/first"},
- "*:7081": {"pass": "routes/second"},
- "*:7082": {"pass": "routes/third"},
- "*:7083": {"pass": "routes/fourth"},
- "*:7084": {"pass": "routes/fifth"},
- "*:7085": {"pass": "applications/mirror"},
+ "*:8080": {"pass": "routes/first"},
+ "*:8081": {"pass": "routes/second"},
+ "*:8082": {"pass": "routes/third"},
+ "*:8083": {"pass": "routes/fourth"},
+ "*:8084": {"pass": "routes/fifth"},
+ "*:8085": {"pass": "applications/mirror"},
},
"routes": {
- "first": [{"action": {"proxy": "http://127.0.0.1:7081"}}],
- "second": [{"action": {"proxy": "http://127.0.0.1:7082"}}],
- "third": [{"action": {"proxy": "http://127.0.0.1:7083"}}],
- "fourth": [{"action": {"proxy": "http://127.0.0.1:7084"}}],
- "fifth": [{"action": {"proxy": "http://127.0.0.1:7085"}}],
+ "first": [{"action": {"proxy": "http://127.0.0.1:8081"}}],
+ "second": [{"action": {"proxy": "http://127.0.0.1:8082"}}],
+ "third": [{"action": {"proxy": "http://127.0.0.1:8083"}}],
+ "fourth": [{"action": {"proxy": "http://127.0.0.1:8084"}}],
+ "fifth": [{"action": {"proxy": "http://127.0.0.1:8085"}}],
},
"applications": {
"mirror": {
@@ -210,7 +210,7 @@ def test_proxy_parallel():
def test_proxy_header():
assert 'success' in client.conf(
- {"pass": "applications/custom_header"}, 'listeners/*:7081'
+ {"pass": "applications/custom_header"}, 'listeners/*:8081'
), 'custom_header configure'
header_value = 'blah'
@@ -325,7 +325,7 @@ def test_proxy_fragmented_body_close():
def test_proxy_nowhere():
assert 'success' in client.conf(
- [{"action": {"proxy": "http://127.0.0.1:7082"}}], 'routes'
+ [{"action": {"proxy": "http://127.0.0.1:8082"}}], 'routes'
), 'proxy path changed'
assert get_http10()['status'] == 502, 'status'
@@ -334,14 +334,14 @@ def test_proxy_nowhere():
def test_proxy_ipv6():
assert 'success' in client.conf(
{
- "*:7080": {"pass": "routes"},
- "[::1]:7081": {'application': 'mirror'},
+ "*:8080": {"pass": "routes"},
+ "[::1]:8081": {'application': 'mirror'},
},
'listeners',
), 'add ipv6 listener configure'
assert 'success' in client.conf(
- [{"action": {"proxy": "http://[::1]:7081"}}], 'routes'
+ [{"action": {"proxy": "http://[::1]:8081"}}], 'routes'
), 'proxy ipv6 configure'
assert get_http10()['status'] == 200, 'status'
@@ -352,7 +352,7 @@ def test_proxy_unix(temp_dir):
assert 'success' in client.conf(
{
- "*:7080": {"pass": "routes"},
+ "*:8080": {"pass": "routes"},
f'unix:{addr}': {'application': 'mirror'},
},
'listeners',
@@ -367,7 +367,7 @@ def test_proxy_unix(temp_dir):
def test_proxy_delayed():
assert 'success' in client.conf(
- {"pass": "applications/delayed"}, 'listeners/*:7081'
+ {"pass": "applications/delayed"}, 'listeners/*:8081'
), 'delayed configure'
body = '0123456789' * 1000
@@ -400,7 +400,7 @@ def test_proxy_delayed():
def test_proxy_delayed_close():
assert 'success' in client.conf(
- {"pass": "applications/delayed"}, 'listeners/*:7081'
+ {"pass": "applications/delayed"}, 'listeners/*:8081'
), 'delayed configure'
sock = post_http10(
@@ -469,11 +469,11 @@ def test_proxy_invalid():
check_proxy('http://127.0.0.1:')
check_proxy('http://127.0.0.1:blah')
check_proxy('http://127.0.0.1:-1')
- check_proxy('http://127.0.0.1:7080b')
+ check_proxy('http://127.0.0.1:8080b')
check_proxy('http://[]')
- check_proxy('http://[]:7080')
- check_proxy('http://[:]:7080')
- check_proxy('http://[::7080')
+ check_proxy('http://[]:8080')
+ check_proxy('http://[:]:8080')
+ check_proxy('http://[::8080')
@pytest.mark.skip('not yet')
@@ -486,11 +486,11 @@ def test_proxy_loop(skip_alert):
assert 'success' in client.conf(
{
"listeners": {
- "*:7080": {"pass": "routes"},
- "*:7081": {"pass": "applications/mirror"},
- "*:7082": {"pass": "routes"},
+ "*:8080": {"pass": "routes"},
+ "*:8081": {"pass": "applications/mirror"},
+ "*:8082": {"pass": "routes"},
},
- "routes": [{"action": {"proxy": "http://127.0.0.1:7082"}}],
+ "routes": [{"action": {"proxy": "http://127.0.0.1:8082"}}],
"applications": {
"mirror": {
"type": client.get_application_type(),