From 2f8ce00067f1164a5913142e9aebb77c218c2156 Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Mon, 30 Dec 2019 17:43:18 +0100 Subject: [PATCH] Add tests on proxy protocol --- tests/test.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/test.yml b/tests/test.yml index 0999070..7615764 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -268,6 +268,8 @@ https_proxy_protocol_port: [20443] template: '_base' ssl_name: 'test-ssl.local' + headers: + 'X-Proxy-Protocol': '1' - name: '{{ ngrok.stdout }}' proto: ['http', 'https'] template: '_base' @@ -516,6 +518,28 @@ register: notdefaultssl failed_when: notdefaultssl.x_ansible_default is defined + +# -------------------------------- +# Check Proxy protocol +# -------------------------------- + - name: SHELL | Check HTTP proxy protocol + shell: curl -I --haproxy-protocol http://test-ssl-proxy-protocol.local:20080 | grep -qi 'X-Proxy-Protocol' + args: + executable: /bin/sh + warn: no + changed_when: false + tags: + - skip_ansible_lint + + - name: SHELL | Check HTTPS proxy protocol + shell: curl -I --haproxy-protocol -k https://test-ssl-proxy-protocol.local:20443 | grep -qi 'X-Proxy-Protocol' + args: + executable: /bin/sh + warn: no + changed_when: false + tags: + - skip_ansible_lint + # -------------------------------- # Check HTTP2 # --------------------------------