update consul tests to reflect fixes to the core and session modules (#17451)
This commit is contained in:
parent
bb9ed50441
commit
a06da86d52
3 changed files with 11 additions and 10 deletions
|
@ -29,7 +29,7 @@
|
||||||
- with_rules.token | length == 36
|
- with_rules.token | length == 36
|
||||||
- with_rules.name == 'With rule'
|
- with_rules.name == 'With rule'
|
||||||
- with_rules.rules | match('.*"foo".*')
|
- with_rules.rules | match('.*"foo".*')
|
||||||
- with_rules.rules | match('.*"private/foo".*')
|
- with_rules.rules | search(pattern='private/foo')
|
||||||
|
|
||||||
- name: clear up
|
- name: clear up
|
||||||
consul_acl:
|
consul_acl:
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
name: 'ACL rule for testing'
|
name: 'ACL rule for testing'
|
||||||
rules:
|
rules:
|
||||||
- key: 'somekey'
|
- key: 'somekey'
|
||||||
policy: all
|
policy: write
|
||||||
register: test_acl
|
register: test_acl
|
||||||
|
|
||||||
- name: cleanup from previous failed runs
|
- name: cleanup from previous failed runs
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
- name: register basic session with consul
|
- name: register basic session with consul
|
||||||
consul_session:
|
consul_session:
|
||||||
name: session1
|
name: session1
|
||||||
|
@ -13,8 +14,10 @@
|
||||||
- name: add checks for session health check
|
- name: add checks for session health check
|
||||||
consul:
|
consul:
|
||||||
check_name: session_check
|
check_name: session_check
|
||||||
script: /usr/bin/true
|
script: /bin/true
|
||||||
interval: 15
|
interval: 1
|
||||||
|
|
||||||
|
- pause: seconds=2
|
||||||
|
|
||||||
- name: register a session with check
|
- name: register a session with check
|
||||||
consul_session:
|
consul_session:
|
||||||
|
@ -43,7 +46,7 @@
|
||||||
- with_delay.changed
|
- with_delay.changed
|
||||||
- with_delay.session_id | length == 36
|
- with_delay.session_id | length == 36
|
||||||
- with_delay.name == 'session_with_delay'
|
- with_delay.name == 'session_with_delay'
|
||||||
- with_delay.delay == 20
|
- with_delay.delay == "20"
|
||||||
|
|
||||||
|
|
||||||
- name: retrieve session by id
|
- name: retrieve session by id
|
||||||
|
@ -65,11 +68,9 @@
|
||||||
- 3 <= retrieved_by_list.sessions[0]
|
- 3 <= retrieved_by_list.sessions[0]
|
||||||
|
|
||||||
- name: remove sessions
|
- name: remove sessions
|
||||||
consul_session: id={{item}} state=absent
|
consul_session: id='{{basic_result.session_id}}' state=absent
|
||||||
with_items:
|
- consul_session: id='{{with_check.session_id}}' state=absent
|
||||||
- basic_result.session_id
|
- consul_session: id='{{with_delay.session_id}}' state=absent
|
||||||
- with_check.session_id
|
|
||||||
- with_delay.session_id
|
|
||||||
|
|
||||||
- name: remove check
|
- name: remove check
|
||||||
consul:
|
consul:
|
||||||
|
|
Loading…
Add table
Reference in a new issue