Commit f7b39cc0 authored by Łukasz Nowak's avatar Łukasz Nowak

fix "fix "caddy-frontend/test: Prove that disabled-cookie-list does not work""

curl invocation was incorrect, and was working only in some conditions by
chance, so fix it fully. Now the test fails in all conditions correctly,
including sanity assertion.
parent 2481bc39
Pipeline #22727 failed with stage
...@@ -4384,14 +4384,14 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4384,14 +4384,14 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
replacement_dict = dict( replacement_dict = dict(
domain=parameter_dict['domain'], ip=TEST_IP, port=HTTPS_PORT) domain=parameter_dict['domain'], ip=TEST_IP, port=HTTPS_PORT)
curl_command = [ curl_command = [
'curl', '-v', '-k', '-H', 'curl', '-v', '-k',
'"Host:', '%(domain)s' % replacement_dict, '-H', 'Host: %(domain)s' % replacement_dict,
'--resolve', '%(domain)s:%(port)s:%(ip)s' % replacement_dict, '--resolve', '%(domain)s:%(port)s:%(ip)s' % replacement_dict,
'https://%(domain)s:%(port)s/' % replacement_dict,
'--cookie', '--cookie',
# Note: Cookie order is extremely important here, do not change # Note: Cookie order is extremely important here, do not change
# or test will start to pass incorrectly # or test will start to pass incorrectly
'"Coconut=absent; Chocolate=absent; Coffee=present; Vanilia=absent"' 'Coconut=absent; Chocolate=absent; Coffee=present; Vanilia=absent',
'https://%(domain)s:%(port)s/' % replacement_dict,
] ]
prc = subprocess.Popen( prc = subprocess.Popen(
curl_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE curl_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE
...@@ -4403,8 +4403,8 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -4403,8 +4403,8 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
curl_command, out, err)) curl_command, out, err))
# self check - were the cookies sent in required order? # self check - were the cookies sent in required order?
self.assertIn( self.assertIn(
'> cookie: "Coconut=absent; Chocolate=absent; Coffee=present; ' 'ookie: Coconut=absent; Chocolate=absent; Coffee=present; '
'Vanilia=absent"', 'Vanilia=absent',
err.decode()) err.decode())
# real test - all configured cookies are dropped # real test - all configured cookies are dropped
self.assertEqual( self.assertEqual(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment