Skip to content

Commit 0a7a250

Browse files
committed
test: optional traefik installation
1 parent df66a25 commit 0a7a250

8 files changed

Lines changed: 150 additions & 145 deletions

File tree

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ UPSTREAM_TAG ?= latest
5151
# latest is the most current release
5252
# edge is the most current merged change
5353
BUILD_DEPLOY_IMAGE_REPO = uselagoon/build-deploy-image
54-
BUILD_DEPLOY_IMAGE_TAG ?= edge
54+
BUILD_DEPLOY_IMAGE_TAG ?= pr-472
5555

5656
# UI_IMAGE_REPO and UI_IMAGE_TAG are an easy way to override the UI image used
5757
# only works for installations where INSTALL_STABLE_CORE=false
@@ -520,10 +520,12 @@ ifeq ($(INGRESS_CONTROLLER),traefik)
520520
INGRESS_CONTROLLER_NAMESPACE = ingress-traefik
521521
INGRESS_CONTROLLER_SERVICE = ingress-traefik
522522
INGRESS_CONTROLLER_CLASSNAME = traefik
523+
INGRESS_CONTROLLER_REMOTE_CLASSNAME = traefik
523524
else
524525
INGRESS_CONTROLLER_NAMESPACE = ingress-nginx
525526
INGRESS_CONTROLLER_SERVICE = ingress-nginx-controller
526527
INGRESS_CONTROLLER_CLASSNAME = nginx
528+
INGRESS_CONTROLLER_REMOTE_CLASSNAME = nginx
527529
endif
528530

529531
# the following can be used to selectively leave out the installation of certain
@@ -787,6 +789,7 @@ k3d/setup: k3d/cluster helm/repos $(addprefix local-dev/,$(K3D_TOOLS)) k3d/check
787789
INGRESS_CONTROLLER_NAMESPACE=$(INGRESS_CONTROLLER_NAMESPACE) \
788790
INGRESS_CONTROLLER_SERVICE=$(INGRESS_CONTROLLER_SERVICE) \
789791
INGRESS_CONTROLLER_CLASSNAME=$(INGRESS_CONTROLLER_CLASSNAME) \
792+
INGRESS_CONTROLLER_REMOTE_CLASSNAME=$(INGRESS_CONTROLLER_REMOTE_CLASSNAME) \
790793
$$([ $(INSTALL_MAILPIT) ] && echo 'INSTALL_MAILPIT=$(INSTALL_MAILPIT)') \
791794
$$([ $(INSTALL_PROMETHEUS) ] && echo 'INSTALL_PROMETHEUS=$(INSTALL_PROMETHEUS)') \
792795
$$([ $(INSTALL_K8UP) ] && echo 'INSTALL_K8UP=$(INSTALL_K8UP)') \
@@ -860,6 +863,7 @@ endif
860863
INGRESS_CONTROLLER_NAMESPACE=$(INGRESS_CONTROLLER_NAMESPACE) \
861864
INGRESS_CONTROLLER_SERVICE=$(INGRESS_CONTROLLER_SERVICE) \
862865
INGRESS_CONTROLLER_CLASSNAME=$(INGRESS_CONTROLLER_CLASSNAME) \
866+
INGRESS_CONTROLLER_REMOTE_CLASSNAME=$(INGRESS_CONTROLLER_REMOTE_CLASSNAME) \
863867
$$([ $(LAGOON_SEED_USERNAME) ] && echo 'LAGOON_SEED_USERNAME=$(LAGOON_SEED_USERNAME)') \
864868
$$([ $(LAGOON_SEED_PASSWORD) ] && echo 'LAGOON_SEED_PASSWORD=$(LAGOON_SEED_PASSWORD)') \
865869
$$([ $(LAGOON_SEED_ORGANIZATION) ] && echo 'LAGOON_SEED_ORGANIZATION=$(LAGOON_SEED_ORGANIZATION)') \
@@ -1135,6 +1139,7 @@ endif
11351139
INGRESS_CONTROLLER_NAMESPACE=$(INGRESS_CONTROLLER_NAMESPACE) \
11361140
INGRESS_CONTROLLER_SERVICE=$(INGRESS_CONTROLLER_SERVICE) \
11371141
INGRESS_CONTROLLER_CLASSNAME=$(INGRESS_CONTROLLER_CLASSNAME) \
1142+
INGRESS_CONTROLLER_REMOTE_CLASSNAME=$(INGRESS_CONTROLLER_REMOTE_CLASSNAME) \
11381143
&& docker run --rm --network host --name ct-$(CI_BUILD_TAG) \
11391144
--volume "$$(pwd)/test-suite-run.ct.yaml:/etc/ct/ct.yaml" \
11401145
--volume "$$(pwd):/workdir" \

tests/tests/deploytarget/check-first.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -88,28 +88,28 @@
8888
tasks:
8989
- ansible.builtin.include_tasks: ../../checks/check-url-content-host.yaml
9090

91-
# - name: "{{ testname }} - check if custom domain 'hsts-header.com' is created and has HSTS header set"
92-
# hosts: localhost
93-
# serial: 1
94-
# vars:
95-
# url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
96-
# host: "hsts-header.com"
97-
# expected_returncode: 200
98-
# expected_header: "strict_transport_security"
99-
# expected_header_value: "max-age=15768000"
100-
# tasks:
101-
# - ansible.builtin.include_tasks: ../../checks/check-url-header.yaml
102-
103-
# - name: "{{ testname }} - check if custom domain 'hsts-header-null.com' is created and does not have HSTS header set"
104-
# hosts: localhost
105-
# serial: 1
106-
# vars:
107-
# url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
108-
# host: "hsts-header-null.com"
109-
# expected_returncode: 200
110-
# expected_header: "strict_transport_security"
111-
# tasks:
112-
# - ansible.builtin.include_tasks: ../../checks/check-url-header-absent.yaml
91+
- name: "{{ testname }} - check if custom domain 'hsts-header.com' is created and has HSTS header set"
92+
hosts: localhost
93+
serial: 1
94+
vars:
95+
url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
96+
host: "hsts-header.com"
97+
expected_returncode: 200
98+
expected_header: "strict_transport_security"
99+
expected_header_value: "max-age=15768000"
100+
tasks:
101+
- ansible.builtin.include_tasks: ../../checks/check-url-header.yaml
102+
103+
- name: "{{ testname }} - check if custom domain 'hsts-header-null.com' is created and does not have HSTS header set"
104+
hosts: localhost
105+
serial: 1
106+
vars:
107+
url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
108+
host: "hsts-header-null.com"
109+
expected_returncode: 200
110+
expected_header: "strict_transport_security"
111+
tasks:
112+
- ansible.builtin.include_tasks: ../../checks/check-url-header-absent.yaml
113113

114114
- name: "{{ testname }} - check if {{ project }} is redirecting correctly with no preserve'"
115115
hosts: localhost

tests/tests/deploytarget/check-second.yaml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,25 @@
5858
tasks:
5959
- ansible.builtin.include_tasks: ../../checks/check-url-returncode-host.yaml
6060

61-
# - name: "{{ testname }} - SECOND TEST: check if custom domain 'hsts-header-null.com' now has HSTS header set"
62-
# hosts: localhost
63-
# serial: 1
64-
# vars:
65-
# url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
66-
# host: "hsts-header-null.com"
67-
# expected_returncode: 200
68-
# expected_header: "strict_transport_security"
69-
# expected_header_value: "max-age=15768000"
70-
# tasks:
71-
# - ansible.builtin.include_tasks: ../../checks/check-url-header.yaml
61+
- name: "{{ testname }} - SECOND TEST: check if custom domain 'hsts-header-null.com' now has HSTS header set"
62+
hosts: localhost
63+
serial: 1
64+
vars:
65+
url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
66+
host: "hsts-header-null.com"
67+
expected_returncode: 200
68+
expected_header: "strict_transport_security"
69+
expected_header_value: "max-age=15768000"
70+
tasks:
71+
- ansible.builtin.include_tasks: ../../checks/check-url-header.yaml
7272

73-
# - name: "{{ testname }} - SECOND TEST: check if custom domain 'hsts-header.com' is created and does not have HSTS header set"
74-
# hosts: localhost
75-
# serial: 1
76-
# vars:
77-
# url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
78-
# host: "hsts-header.com"
79-
# expected_returncode: 200
80-
# expected_header: "strict_transport_security"
81-
# tasks:
82-
# - ansible.builtin.include_tasks: ../../checks/check-url-header-absent.yaml
73+
- name: "{{ testname }} - SECOND TEST: check if custom domain 'hsts-header.com' is created and does not have HSTS header set"
74+
hosts: localhost
75+
serial: 1
76+
vars:
77+
url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
78+
host: "hsts-header.com"
79+
expected_returncode: 200
80+
expected_header: "strict_transport_security"
81+
tasks:
82+
- ansible.builtin.include_tasks: ../../checks/check-url-header-absent.yaml

tests/tests/features-kubernetes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
git_repo_name: features.git
3232
project: ci-features-{{ cluster_type }}
3333
branch: ingress-annotations
34-
check_url: "http://node.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix }}"
34+
check_url: "https://node.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
3535

3636
- ansible.builtin.import_playbook: features/short-router-url.yaml
3737
vars:

tests/tests/features/ingress-annotations.yaml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -31,45 +31,45 @@
3131
tasks:
3232
- ansible.builtin.include_tasks: ../../checks/check-ingress-annotations.yaml
3333

34-
# - name: "{{ testname }} - check if custom domain 'redirect-to-example.com' is created and redirects to https://example.com"
35-
# hosts: localhost
36-
# serial: 1
37-
# vars:
38-
# url: "{{ check_url }}"
39-
# host: "redirect-to-example.com"
40-
# expected_redirect_location: "https://example.com/$"
41-
# tasks:
42-
# - ansible.builtin.include_tasks: ../../checks/check-url-redirect-host.yaml
34+
- name: "{{ testname }} - check if custom domain 'redirect-to-example.com' is created and redirects to https://example.com"
35+
hosts: localhost
36+
serial: 1
37+
vars:
38+
url: "{{ check_url }}"
39+
host: "redirect-to-example.com"
40+
expected_redirect_location: "https://example.com/$"
41+
tasks:
42+
- ansible.builtin.include_tasks: ../../checks/check-url-redirect-host.yaml
4343

44-
# - name: "{{ testname }} - check if custom domain 'redirect-to-example.com' is created and request to /asdf redirects to https://example.com/asdf"
45-
# hosts: localhost
46-
# serial: 1
47-
# vars:
48-
# url: "http://node.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix }}/asdf"
49-
# host: "redirect-to-example.com"
50-
# expected_redirect_location: "https://example.com/asdf$"
51-
# tasks:
52-
# - ansible.builtin.include_tasks: ../../checks/check-url-redirect-host.yaml
44+
- name: "{{ testname }} - check if custom domain 'redirect-to-example.com' is created and request to /asdf redirects to https://example.com/asdf"
45+
hosts: localhost
46+
serial: 1
47+
vars:
48+
url: "https://node.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}/asdf"
49+
host: "redirect-to-example.com"
50+
expected_redirect_location: "https://example.com/asdf$"
51+
tasks:
52+
- ansible.builtin.include_tasks: ../../checks/check-url-redirect-host.yaml
5353

54-
# - name: "{{ testname }} - check if custom domain 'redirect-to-www.com' is created and redirects to https://www.redirect-to-www.com"
55-
# hosts: localhost
56-
# serial: 1
57-
# vars:
58-
# url: "{{ check_url }}"
59-
# host: "redirect-to-www.com"
60-
# expected_redirect_location: "https://www.redirect-to-www.com/$"
61-
# tasks:
62-
# - ansible.builtin.include_tasks: ../../checks/check-url-redirect-host.yaml
54+
- name: "{{ testname }} - check if custom domain 'redirect-to-www.com' is created and redirects to https://www.redirect-to-www.com"
55+
hosts: localhost
56+
serial: 1
57+
vars:
58+
url: "{{ check_url }}"
59+
host: "redirect-to-www.com"
60+
expected_redirect_location: "https://www.redirect-to-www.com/$"
61+
tasks:
62+
- ansible.builtin.include_tasks: ../../checks/check-url-redirect-host.yaml
6363

64-
# - name: "{{ testname }} - check if custom domain 'www.redirect-from-www.com' is created and redirects to https://redirect-from-www.com"
65-
# hosts: localhost
66-
# serial: 1
67-
# vars:
68-
# url: "{{ check_url }}"
69-
# host: "www.redirect-from-www.com"
70-
# expected_redirect_location: "https://redirect-from-www.com/$"
71-
# tasks:
72-
# - ansible.builtin.include_tasks: ../../checks/check-url-redirect-host.yaml
64+
- name: "{{ testname }} - check if custom domain 'www.redirect-from-www.com' is created and redirects to https://redirect-from-www.com"
65+
hosts: localhost
66+
serial: 1
67+
vars:
68+
url: "{{ check_url }}"
69+
host: "www.redirect-from-www.com"
70+
expected_redirect_location: "https://redirect-from-www.com/$"
71+
tasks:
72+
- ansible.builtin.include_tasks: ../../checks/check-url-redirect-host.yaml
7373

7474
- name: "{{ testname }} - api deleteEnvironment on {{ project }}, which should remove all resources"
7575
hosts: localhost

tests/tests/nginx/check-first.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -98,28 +98,28 @@
9898
tasks:
9999
- ansible.builtin.include_tasks: ../../checks/check-url-content-host.yaml
100100

101-
# - name: "{{ testname }} - check if custom domain 'hsts-header.com' is created and has HSTS header set"
102-
# hosts: localhost
103-
# serial: 1
104-
# vars:
105-
# url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
106-
# host: "hsts-header.com"
107-
# expected_returncode: 200
108-
# expected_header: "strict_transport_security"
109-
# expected_header_value: "max-age=15768000"
110-
# tasks:
111-
# - ansible.builtin.include_tasks: ../../checks/check-url-header.yaml
112-
113-
# - name: "{{ testname }} - check if custom domain 'hsts-header-null.com' is created and does not have HSTS header set"
114-
# hosts: localhost
115-
# serial: 1
116-
# vars:
117-
# url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
118-
# host: "hsts-header-null.com"
119-
# expected_returncode: 200
120-
# expected_header: "strict_transport_security"
121-
# tasks:
122-
# - ansible.builtin.include_tasks: ../../checks/check-url-header-absent.yaml
101+
- name: "{{ testname }} - check if custom domain 'hsts-header.com' is created and has HSTS header set"
102+
hosts: localhost
103+
serial: 1
104+
vars:
105+
url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
106+
host: "hsts-header.com"
107+
expected_returncode: 200
108+
expected_header: "strict_transport_security"
109+
expected_header_value: "max-age=15768000"
110+
tasks:
111+
- ansible.builtin.include_tasks: ../../checks/check-url-header.yaml
112+
113+
- name: "{{ testname }} - check if custom domain 'hsts-header-null.com' is created and does not have HSTS header set"
114+
hosts: localhost
115+
serial: 1
116+
vars:
117+
url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
118+
host: "hsts-header-null.com"
119+
expected_returncode: 200
120+
expected_header: "strict_transport_security"
121+
tasks:
122+
- ansible.builtin.include_tasks: ../../checks/check-url-header-absent.yaml
123123

124124
- name: "{{ testname }} - check if {{ project }} is redirecting correctly with no preserve'"
125125
hosts: localhost

tests/tests/nginx/check-fourth.yaml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,25 @@
5858
tasks:
5959
- ansible.builtin.include_tasks: ../../checks/check-url-returncode-host.yaml
6060

61-
# - name: "{{ testname }} - FOURTH TEST: check if custom domain 'hsts-header-null.com' now has HSTS header set"
62-
# hosts: localhost
63-
# serial: 1
64-
# vars:
65-
# url: "https://nginx-{{ project | regex_replace('_', '-') }}-{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
66-
# host: "hsts-header-null.com"
67-
# expected_returncode: 200
68-
# expected_header: "strict_transport_security"
69-
# expected_header_value: "max-age=15768000"
70-
# tasks:
71-
# - ansible.builtin.include_tasks: ../../checks/check-url-header.yaml
61+
- name: "{{ testname }} - FOURTH TEST: check if custom domain 'hsts-header-null.com' now has HSTS header set"
62+
hosts: localhost
63+
serial: 1
64+
vars:
65+
url: "https://nginx-{{ project | regex_replace('_', '-') }}-{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
66+
host: "hsts-header-null.com"
67+
expected_returncode: 200
68+
expected_header: "strict_transport_security"
69+
expected_header_value: "max-age=15768000"
70+
tasks:
71+
- ansible.builtin.include_tasks: ../../checks/check-url-header.yaml
7272

73-
# - name: "{{ testname }} - FOURTH TEST: check if custom domain 'hsts-header.com' is created and does not have HSTS header set"
74-
# hosts: localhost
75-
# serial: 1
76-
# vars:
77-
# url: "https://nginx-{{ project | regex_replace('_', '-') }}-{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
78-
# host: "hsts-header.com"
79-
# expected_returncode: 200
80-
# expected_header: "strict_transport_security"
81-
# tasks:
82-
# - ansible.builtin.include_tasks: ../../checks/check-url-header-absent.yaml
73+
- name: "{{ testname }} - FOURTH TEST: check if custom domain 'hsts-header.com' is created and does not have HSTS header set"
74+
hosts: localhost
75+
serial: 1
76+
vars:
77+
url: "https://nginx-{{ project | regex_replace('_', '-') }}-{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
78+
host: "hsts-header.com"
79+
expected_returncode: 200
80+
expected_header: "strict_transport_security"
81+
tasks:
82+
- ansible.builtin.include_tasks: ../../checks/check-url-header-absent.yaml

tests/tests/nginx/check-second.yaml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,25 @@
5858
tasks:
5959
- ansible.builtin.include_tasks: ../../checks/check-url-returncode-host.yaml
6060

61-
# - name: "{{ testname }} - SECOND TEST: check if custom domain 'hsts-header-null.com' now has HSTS header set"
62-
# hosts: localhost
63-
# serial: 1
64-
# vars:
65-
# url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
66-
# host: "hsts-header-null.com"
67-
# expected_returncode: 200
68-
# expected_header: "strict_transport_security"
69-
# expected_header_value: "max-age=15768000"
70-
# tasks:
71-
# - ansible.builtin.include_tasks: ../../checks/check-url-header.yaml
61+
- name: "{{ testname }} - SECOND TEST: check if custom domain 'hsts-header-null.com' now has HSTS header set"
62+
hosts: localhost
63+
serial: 1
64+
vars:
65+
url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
66+
host: "hsts-header-null.com"
67+
expected_returncode: 200
68+
expected_header: "strict_transport_security"
69+
expected_header_value: "max-age=15768000"
70+
tasks:
71+
- ansible.builtin.include_tasks: ../../checks/check-url-header.yaml
7272

73-
# - name: "{{ testname }} - SECOND TEST: check if custom domain 'hsts-header.com' is created and does not have HSTS header set"
74-
# hosts: localhost
75-
# serial: 1
76-
# vars:
77-
# url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
78-
# host: "hsts-header.com"
79-
# expected_returncode: 200
80-
# expected_header: "strict_transport_security"
81-
# tasks:
82-
# - ansible.builtin.include_tasks: ../../checks/check-url-header-absent.yaml
73+
- name: "{{ testname }} - SECOND TEST: check if custom domain 'hsts-header.com' is created and does not have HSTS header set"
74+
hosts: localhost
75+
serial: 1
76+
vars:
77+
url: "https://nginx.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix_https }}"
78+
host: "hsts-header.com"
79+
expected_returncode: 200
80+
expected_header: "strict_transport_security"
81+
tasks:
82+
- ansible.builtin.include_tasks: ../../checks/check-url-header-absent.yaml

0 commit comments

Comments
 (0)