mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Reorganize integration tests:
- Move legacy tests into a separate directory. - Reduce common dependencies between targets.
This commit is contained in:
parent
896c4b42ba
commit
781fd7099a
513 changed files with 111 additions and 6 deletions
6
test/legacy/roles/netscaler_service/defaults/main.yaml
Normal file
6
test/legacy/roles/netscaler_service/defaults/main.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
testcase: "*"
|
||||
test_cases: []
|
||||
|
||||
nitro_user: nsroot
|
||||
nitro_pass: nsroot
|
5
test/legacy/roles/netscaler_service/sample_inventory
Normal file
5
test/legacy/roles/netscaler_service/sample_inventory
Normal file
|
@ -0,0 +1,5 @@
|
|||
|
||||
|
||||
[netscaler]
|
||||
|
||||
172.18.0.2 nsip=172.18.0.2 nitro_user=nsroot nitro_pass=nsroot
|
2
test/legacy/roles/netscaler_service/tasks/main.yaml
Normal file
2
test/legacy/roles/netscaler_service/tasks/main.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
- { include: nitro.yaml, tags: ['nitro'] }
|
14
test/legacy/roles/netscaler_service/tasks/nitro.yaml
Normal file
14
test/legacy/roles/netscaler_service/tasks/nitro.yaml
Normal file
|
@ -0,0 +1,14 @@
|
|||
- name: collect all nitro test cases
|
||||
find:
|
||||
paths: "{{ role_path }}/tests/nitro"
|
||||
patterns: "{{ testcase }}.yaml"
|
||||
register: test_cases
|
||||
|
||||
- name: set test_items
|
||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||
|
||||
- name: run test case
|
||||
include: "{{ test_case_to_run }}"
|
||||
with_items: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
|
@ -0,0 +1,57 @@
|
|||
---
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/adns_service/setup.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/adns_service/setup.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/adns_service/setup.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/adns_service/setup.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/adns_service/remove.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/adns_service/remove.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/adns_service/remove.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/adns_service/remove.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
|
||||
- name: Remove adns service
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
netscaler_service:
|
||||
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: absent
|
||||
name: service-adns
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
|
||||
- name: Setup adns service
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
netscaler_service:
|
||||
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
state: present
|
||||
|
||||
name: service-adns
|
||||
ipaddress: 192.168.1.3
|
||||
port: 80
|
||||
servicetype: ADNS
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/flap_disabled/setup.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/flap_disabled/remove.yaml"
|
||||
vars:
|
||||
check_mode: no
|
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
|
||||
- name: Remove htttp service
|
||||
netscaler_service:
|
||||
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: absent
|
||||
|
||||
name: service-http
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
|
@ -0,0 +1,47 @@
|
|||
---
|
||||
|
||||
- name: Flap service
|
||||
netscaler_service:
|
||||
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: present
|
||||
|
||||
name: service-http
|
||||
ip: 192.168.1.1
|
||||
ipaddress: 192.168.1.1
|
||||
port: 80
|
||||
servicetype: HTTP
|
||||
|
||||
disabled: "{{ item|int % 2 }}"
|
||||
with_sequence: count=20
|
||||
delay: 1
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
|
||||
- name: Flap service
|
||||
netscaler_service:
|
||||
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: present
|
||||
|
||||
name: service-http
|
||||
ip: 192.168.1.1
|
||||
ipaddress: 192.168.1.1
|
||||
port: 80
|
||||
servicetype: HTTP
|
||||
|
||||
disabled: "{{ item|int % 2 }}"
|
||||
with_sequence: count=20
|
||||
delay: 5
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
|
@ -0,0 +1,85 @@
|
|||
---
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/http_service/setup.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/http_service/setup.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/http_service/setup.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/http_service/setup.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/http_service/update.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/http_service/update.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/http_service/update.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/http_service/update.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/http_service/remove.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/http_service/remove.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/http_service/remove.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/http_service/remove.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
|
||||
- name: Remove htttp service
|
||||
netscaler_service:
|
||||
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: absent
|
||||
|
||||
name: service-http
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
|
||||
- name: Setup http service
|
||||
netscaler_service:
|
||||
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: present
|
||||
|
||||
name: service-http
|
||||
ip: 192.168.1.1
|
||||
ipaddress: 192.168.1.1
|
||||
port: 80
|
||||
servicetype: HTTP
|
||||
cachetype: TRANSPARENT
|
||||
maxclient: 100
|
||||
healthmonitor: no
|
||||
maxreq: 200
|
||||
cacheable: no
|
||||
cip: enabled
|
||||
cipheader: client-ip
|
||||
usip: yes
|
||||
useproxyport: yes
|
||||
sp: off
|
||||
rtspsessionidremap: off
|
||||
clttimeout: 100
|
||||
svrtimeout: 100
|
||||
customserverid: 476
|
||||
cka: yes
|
||||
tcpb: yes
|
||||
cmp: no
|
||||
maxbandwidth: 10000
|
||||
accessdown: "NO"
|
||||
monthreshold: 100
|
||||
downstateflush: enabled
|
||||
hashid: 10
|
||||
comment: some comment
|
||||
appflowlog: enabled
|
||||
processlocal: enabled
|
||||
graceful: no
|
||||
|
||||
monitor_bindings:
|
||||
- monitorname: ping
|
||||
weight: 50
|
||||
- monitorname: http
|
||||
weight: 50
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
|
@ -0,0 +1,49 @@
|
|||
---
|
||||
|
||||
- name: Update http service
|
||||
netscaler_service:
|
||||
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: present
|
||||
|
||||
name: service-http
|
||||
ip: 192.168.1.1
|
||||
ipaddress: 192.168.1.1
|
||||
port: 80
|
||||
servicetype: HTTP
|
||||
cachetype: TRANSPARENT
|
||||
maxclient: 100
|
||||
healthmonitor: no
|
||||
maxreq: 200
|
||||
cacheable: no
|
||||
cip: enabled
|
||||
cipheader: client-ip
|
||||
usip: yes
|
||||
useproxyport: yes
|
||||
sp: off
|
||||
rtspsessionidremap: off
|
||||
clttimeout: 100
|
||||
svrtimeout: 100
|
||||
customserverid: 476
|
||||
cka: yes
|
||||
tcpb: yes
|
||||
cmp: no
|
||||
maxbandwidth: 20000
|
||||
accessdown: "NO"
|
||||
monthreshold: 100
|
||||
downstateflush: enabled
|
||||
hashid: 10
|
||||
comment: some comment
|
||||
appflowlog: enabled
|
||||
processlocal: enabled
|
||||
|
||||
monitor_bindings:
|
||||
- monitorname: http
|
||||
weight: 100
|
||||
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
|
@ -0,0 +1,57 @@
|
|||
---
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/ssl_service/setup.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/ssl_service/setup.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/ssl_service/setup.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/ssl_service/setup.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/ssl_service/remove.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/ssl_service/remove.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/ssl_service/remove.yaml"
|
||||
vars:
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
||||
|
||||
- include: "{{ role_path }}/tests/nitro/ssl_service/remove.yaml"
|
||||
vars:
|
||||
check_mode: no
|
||||
|
||||
- assert:
|
||||
that: not result|changed
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
|
||||
- name: Remove ssl service
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
netscaler_service:
|
||||
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: absent
|
||||
name: service-ssl
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
|
||||
- name: Setup ssl service
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
check_mode: "{{ check_mode }}"
|
||||
netscaler_service:
|
||||
|
||||
nitro_user: "{{nitro_user}}"
|
||||
nitro_pass: "{{nitro_pass}}"
|
||||
nsip: "{{nsip}}"
|
||||
|
||||
state: present
|
||||
name: service-ssl
|
||||
ipaddress: 192.168.1.2
|
||||
port: 80
|
||||
servicetype: SSL
|
||||
cleartextport: 88
|
Loading…
Add table
Add a link
Reference in a new issue