Reorganize integration tests:

- Move legacy tests into a separate directory.
- Reduce common dependencies between targets.
This commit is contained in:
Matt Clay 2017-09-13 17:31:44 -07:00
commit 781fd7099a
513 changed files with 111 additions and 6 deletions

View file

@ -0,0 +1,6 @@
---
testcase: "*"
test_cases: []
nitro_user: nsroot
nitro_pass: nsroot

View file

@ -0,0 +1,5 @@
[netscaler]
172.18.0.2 nsip=172.18.0.2 nitro_user=nsroot nitro_pass=nsroot

View file

@ -0,0 +1,2 @@
---
- { include: nitro.yaml, tags: ['nitro'] }

View 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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 }}"

View file

@ -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 }}"

View file

@ -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

View file

@ -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 }}"

View file

@ -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 }}"

View file

@ -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 }}"

View file

@ -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

View file

@ -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

View file

@ -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