Skip to content

Commit 69828d6

Browse files
committed
Fix failing tests
1 parent c6f13b2 commit 69828d6

File tree

6 files changed

+32
-32
lines changed

6 files changed

+32
-32
lines changed

molecule/default/prepare.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22
- name: Prepare
33
hosts: all
44
become: true
5-
tasks: []
5+
tasks:
6+
- name: include vars
7+
include_vars: "{{ playbook_dir }}/../../tests/vars/main.yml"
8+
- name: include tasks
9+
include: "{{ playbook_dir }}/../../tests/tasks/pre.yml"

molecule/default/verify.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
- name: Verify
33
hosts: all
44
become: true
5-
tasks: []
5+
tasks:
6+
- name: include tasks
7+
include: "{{ playbook_dir }}/../../tests/tasks/post.yml"
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
# post test file
22
---
3-
- name: post | install dependencies
3+
- name: install test dependencies
44
apt:
55
name:
66
- curl
77
state: "{{ apt_install_state | default('latest') }}"
88
update_cache: true
99
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}"
1010

11-
- name: post | test installation
11+
- name: test tinyproxy installation
1212
command: >
1313
curl -sL --head https://www.google.com --proxy http://127.0.0.1:3128
1414
args:
1515
warn: false
1616
register: _result
1717
changed_when: false
1818
failed_when: _result.stdout.find('HTTP/1.0 200') == -1
19+
tags:
20+
- skip_ansible_lint

tests/tasks/pre.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# post test file
2+
---
3+
- name: install test dependencies
4+
apt:
5+
name:
6+
- net-tools
7+
- iproute2
8+
- ethtool
9+
state: "{{ apt_install_state | default('latest') }}"
10+
update_cache: true
11+
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}"
12+
13+
- name: (re)gather facts
14+
action: setup

tests/test.yml

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,9 @@
55
become: true
66
pre_tasks:
77
- name: include vars
8-
include_vars: main.yml
8+
include_vars: "{{ playbook_dir }}/vars/main.yml"
99
roles:
1010
- ../../
1111
post_tasks:
12-
- include: post.yml
13-
vars:
14-
tinyproxy_tinyproxy_conf:
15-
- |
16-
User nobody
17-
Group nogroup
18-
Port {{ tinyproxy_port }}
19-
Timeout 666
20-
DefaultErrorFile "/usr/share/tinyproxy/default.html"
21-
StatFile "/usr/share/tinyproxy/stats.html"
22-
Logfile "/var/log/tinyproxy/tinyproxy.log"
23-
LogLevel Info
24-
PidFile "/var/run/tinyproxy/tinyproxy.pid"
25-
MaxClients 100
26-
MinSpareServers 5
27-
MaxSpareServers 20
28-
StartServers 10
29-
MaxRequestsPerChild 0
30-
{% for allow in tinyproxy_allow %}
31-
Allow {{ allow }}
32-
{% endfor %}
33-
ViaProxyName "tinyproxy"
34-
{% for connect_port in tinyproxy_connect_port %}
35-
ConnectPort {{ connect_port }}
36-
{% endfor %}
12+
- name: include tasks
13+
include: "{{ playbook_dir }}/tasks/post.yml"

tests/vagrant.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
become: true
66
pre_tasks:
77
- name: include vars
8-
include_vars: main.yml
8+
include_vars: "{{ playbook_dir }}/vars/main.yml"
99
roles:
1010
- ../../
1111
post_tasks:
12-
- include: post.yml
12+
- name: include tasks
13+
include: "{{ playbook_dir }}/tasks/post.yml"

0 commit comments

Comments
 (0)