Skip to content

Commit f43cb41

Browse files
committed
test: skip include tests on el7, document el7 support
The new `includes` feature is only supported on EL8 and above, not on EL7. Document this. Skip testing includes on EL7. Signed-off-by: Rich Megginson <[email protected]>
1 parent 4535834 commit f43cb41

File tree

3 files changed

+37
-23
lines changed

3 files changed

+37
-23
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,10 +700,11 @@ helper_module: nf_conntrack_ftp
700700

701701
### includes
702702

703-
Name of one or more services to specify in an `include` in a
704-
service definition. The `include` directive is described in the
703+
Name of one or more services to specify in an `includes` in a
704+
service definition. The `includes` directive is described in the
705705
[service manpage](https://firewalld.org/documentation/man-pages/firewalld.service.html)
706706
This can only be used when managing service definitions.
707+
NOTE: `includes` support is only available in EL8 and higher.
707708

708709
```yaml
709710
includes:

tests/tests_ansible.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@
546546
permanent: true
547547
register: result
548548
failed_when: result is failed or result is not changed
549+
when:
550+
- ansible_distribution in ["RedHat", "CentOS", "Fedora"]
551+
- ansible_distribution_major_version is version("8", ">=")
549552

550553
- name: Add includes again to check idempotence
551554
firewall_lib:
@@ -557,6 +560,9 @@
557560
permanent: true
558561
register: result
559562
failed_when: result is failed or result is changed
563+
when:
564+
- ansible_distribution in ["RedHat", "CentOS", "Fedora"]
565+
- ansible_distribution_major_version is version("8", ">=")
560566

561567
- name: Delete custom service
562568
firewall_lib:
@@ -586,9 +592,10 @@
586592
destination:
587593
- 123.45.6.78
588594
- "aaaa:aaaa:aaaa:aaa:aaaa:aaaa:aaaa::"
589-
includes:
590-
- https
591-
- ldaps
595+
includes: "{{ ['https', 'ldaps']
596+
if ansible_distribution in ['RedHat', 'CentOS', 'Fedora']
597+
and ansible_distribution_major_version is version('8', '>=')
598+
else omit }}"
592599
permanent: true
593600
state: present
594601
register: result

tests/tests_service.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@
6969
destination:
7070
- 1.1.1.1
7171
- 1::1
72-
includes:
73-
- ssh
74-
- ldaps
72+
includes: "{{ ['ssh', 'ldaps']
73+
if ansible_distribution in ['RedHat', 'CentOS', 'Fedora']
74+
and ansible_distribution_major_version is version('8', '>=')
75+
else [] }}"
7576
permanent: true
7677
state: present
7778

@@ -91,9 +92,10 @@
9192
destination:
9293
- 1.1.1.1
9394
- 1::1
94-
includes:
95-
- ssh
96-
- ldaps
95+
includes: "{{ ['ssh', 'ldaps']
96+
if ansible_distribution in ['RedHat', 'CentOS', 'Fedora']
97+
and ansible_distribution_major_version is version('8', '>=')
98+
else [] }}"
9799
permanent: true
98100
state: present
99101

@@ -124,9 +126,10 @@
124126
- 1::1
125127
helper_module: ftp
126128
protocol: icmp
127-
includes:
128-
- ssh
129-
- ldaps
129+
includes: "{{ ['ssh', 'ldaps']
130+
if ansible_distribution in ['RedHat', 'CentOS', 'Fedora']
131+
and ansible_distribution_major_version is version('8', '>=')
132+
else [] }}"
130133
permanent: true
131134
state: present
132135

@@ -167,9 +170,10 @@
167170
- 1::1
168171
helper_module: ftp
169172
protocol: icmp
170-
includes:
171-
- ssh
172-
- ldaps
173+
includes: "{{ ['ssh', 'ldaps']
174+
if ansible_distribution in ['RedHat', 'CentOS', 'Fedora']
175+
and ansible_distribution_major_version is version('8', '>=')
176+
else [] }}"
173177
permanent: true
174178
state: present
175179

@@ -245,9 +249,10 @@
245249
- 1::1
246250
helper_module: ftp
247251
protocol: icmp
248-
includes:
249-
- ssh
250-
- ldaps
252+
includes: "{{ ['ssh', 'ldaps']
253+
if ansible_distribution in ['RedHat', 'CentOS', 'Fedora']
254+
and ansible_distribution_major_version is version('8', '>=')
255+
else [] }}"
251256
permanent: true
252257
state: absent
253258

@@ -271,9 +276,10 @@
271276
- 1::1
272277
helper_module: ftp
273278
protocol: icmp
274-
includes:
275-
- ssh
276-
- ldaps
279+
includes: "{{ ['ssh', 'ldaps']
280+
if ansible_distribution in ['RedHat', 'CentOS', 'Fedora']
281+
and ansible_distribution_major_version is version('8', '>=')
282+
else [] }}"
277283
permanent: true
278284
state: absent
279285

0 commit comments

Comments
 (0)