Skip to content

Commit

Permalink
Test headers with molecule
Browse files Browse the repository at this point in the history
  • Loading branch information
dale-c-anderson committed May 6, 2024
1 parent c93847e commit 912c298
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions molecule/default/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ nginx_server_name: www.bigcorp.com
nginx_listeners:
- server_name: "{{ nginx_server_name }}"
port: 80
add_headers:
- name: 'x-molecule-foo'
value: 'headers-are-fun'
always: true
php_version: "{{ php_default_version }}"
web_root_dir_name: wwwroot
web_application: php
Expand Down
5 changes: 5 additions & 0 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
- curl_unauth_result.failed
- '"401 Unauthorized" in curl_unauth_result.stdout or "401 Unauthorized" in curl_unauth_result.stderr'

- name: Make sure our x-foo header was present in the response.
assert:
that:
- '"x-molecule-foo: headers-are-fun" in curl_result.stdout'


- name: Verify role part 2 - change PHP version on the vhost to make sure things don't blow up.
hosts: all
Expand Down

0 comments on commit 912c298

Please sign in to comment.