mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
4fe08441be
* Warn on tests used as filters * Update docs, add aliases for tests that fit more gramatically with test syntax * Fix rst formatting * Add successful filter, alias of success * Remove renamed_deprecation, it was overkill * Make directory alias for is_dir * Update tests to use proper jinja test syntax * Update additional documentation, living outside of YAML files, to reflect proper jinja test syntax * Add conversion script, porting guide updates, and changelog updates * Update newly added uses of tests as filters * No underscore variable * Convert recent tests as filter changes to win_stat * Fix some changes related to rebasing a few integration tests * Make tests_as_filters_warning explicitly accept the name of the test, instead of inferring the name * Add test for tests_as_filters_warning * Update tests as filters in newly added/modified tests * Address recent changes to several integration tests * Address recent changes in cs_vpc
171 lines
4.3 KiB
YAML
171 lines
4.3 KiB
YAML
---
|
|
- name: test remove http range rule in check mode
|
|
cs_securitygroup_rule:
|
|
security_group: default
|
|
start_port: 8000
|
|
end_port: 8888
|
|
cidr: 1.2.3.4/32
|
|
state: absent
|
|
register: sg_rule
|
|
check_mode: true
|
|
- name: verify create http range rule in check mode
|
|
assert:
|
|
that:
|
|
- sg_rule is successful
|
|
- sg_rule is changed
|
|
- sg_rule.type == 'ingress'
|
|
- sg_rule.security_group == 'default'
|
|
- sg_rule.protocol == 'tcp'
|
|
- sg_rule.start_port == 8000
|
|
- sg_rule.end_port == 8888
|
|
- sg_rule.cidr == '1.2.3.4/32'
|
|
|
|
- name: test remove http range rule
|
|
cs_securitygroup_rule:
|
|
security_group: default
|
|
start_port: 8000
|
|
end_port: 8888
|
|
cidr: 1.2.3.4/32
|
|
state: absent
|
|
register: sg_rule
|
|
- name: verify create http range rule
|
|
assert:
|
|
that:
|
|
- sg_rule is successful
|
|
- sg_rule is changed
|
|
- sg_rule.type == 'ingress'
|
|
- sg_rule.security_group == 'default'
|
|
- sg_rule.protocol == 'tcp'
|
|
- sg_rule.start_port == 8000
|
|
- sg_rule.end_port == 8888
|
|
- sg_rule.cidr == '1.2.3.4/32'
|
|
|
|
- name: test remove http range rule idempotence
|
|
cs_securitygroup_rule:
|
|
security_group: default
|
|
start_port: 8000
|
|
end_port: 8888
|
|
cidr: 1.2.3.4/32
|
|
state: absent
|
|
register: sg_rule
|
|
- name: verify create http range rule idempotence
|
|
assert:
|
|
that:
|
|
- sg_rule is successful
|
|
- sg_rule is not changed
|
|
|
|
- name: test remove single port udp rule in check mode
|
|
cs_securitygroup_rule:
|
|
security_group: default
|
|
port: 5353
|
|
protocol: udp
|
|
type: egress
|
|
user_security_group: '{{ cs_resource_prefix }}_sg'
|
|
state: absent
|
|
register: sg_rule
|
|
check_mode: true
|
|
- name: verify remove single port udp rule in check mode
|
|
assert:
|
|
that:
|
|
- sg_rule is successful
|
|
- sg_rule is changed
|
|
- sg_rule.type == 'egress'
|
|
- sg_rule.security_group == 'default'
|
|
- sg_rule.protocol == 'udp'
|
|
- sg_rule.start_port == 5353
|
|
- sg_rule.end_port == 5353
|
|
- sg_rule.user_security_group == '{{ cs_resource_prefix }}_sg'
|
|
|
|
- name: test remove single port udp rule
|
|
cs_securitygroup_rule:
|
|
security_group: default
|
|
port: 5353
|
|
protocol: udp
|
|
type: egress
|
|
user_security_group: '{{ cs_resource_prefix }}_sg'
|
|
state: absent
|
|
register: sg_rule
|
|
- name: verify remove single port udp rule
|
|
assert:
|
|
that:
|
|
- sg_rule is successful
|
|
- sg_rule is changed
|
|
- sg_rule.type == 'egress'
|
|
- sg_rule.security_group == 'default'
|
|
- sg_rule.protocol == 'udp'
|
|
- sg_rule.start_port == 5353
|
|
- sg_rule.end_port == 5353
|
|
- sg_rule.user_security_group == '{{ cs_resource_prefix }}_sg'
|
|
|
|
- name: test remove single port udp rule idempotence
|
|
cs_securitygroup_rule:
|
|
security_group: default
|
|
port: 5353
|
|
protocol: udp
|
|
type: egress
|
|
user_security_group: '{{ cs_resource_prefix }}_sg'
|
|
state: absent
|
|
register: sg_rule
|
|
- name: verify remove single port udp rule idempotence
|
|
assert:
|
|
that:
|
|
- sg_rule is successful
|
|
- sg_rule is not changed
|
|
|
|
- name: test remove icmp rule in check mode
|
|
cs_securitygroup_rule:
|
|
security_group: default
|
|
protocol: icmp
|
|
type: ingress
|
|
icmp_type: -1
|
|
icmp_code: -1
|
|
state: absent
|
|
register: sg_rule
|
|
check_mode: true
|
|
- name: verify icmp rule in check mode
|
|
assert:
|
|
that:
|
|
- sg_rule is successful
|
|
- sg_rule is changed
|
|
- sg_rule.type == 'ingress'
|
|
- sg_rule.security_group == 'default'
|
|
- sg_rule.cidr == '0.0.0.0/0'
|
|
- sg_rule.protocol == 'icmp'
|
|
- sg_rule.icmp_code == -1
|
|
- sg_rule.icmp_type == -1
|
|
|
|
- name: test remove icmp rule
|
|
cs_securitygroup_rule:
|
|
security_group: default
|
|
protocol: icmp
|
|
type: ingress
|
|
icmp_type: -1
|
|
icmp_code: -1
|
|
state: absent
|
|
register: sg_rule
|
|
- name: verify icmp rule
|
|
assert:
|
|
that:
|
|
- sg_rule is successful
|
|
- sg_rule is changed
|
|
- sg_rule.type == 'ingress'
|
|
- sg_rule.security_group == 'default'
|
|
- sg_rule.cidr == '0.0.0.0/0'
|
|
- sg_rule.protocol == 'icmp'
|
|
- sg_rule.icmp_code == -1
|
|
- sg_rule.icmp_type == -1
|
|
|
|
- name: test remove icmp rule idempotence
|
|
cs_securitygroup_rule:
|
|
security_group: default
|
|
protocol: icmp
|
|
type: ingress
|
|
icmp_type: -1
|
|
icmp_code: -1
|
|
state: absent
|
|
register: sg_rule
|
|
- name: verify icmp rule idempotence
|
|
assert:
|
|
that:
|
|
- sg_rule is successful
|
|
- sg_rule is not changed
|