Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a06da86

Browse files
Steve Garganmattclay
authored andcommitted
update consul tests to reflect fixes to the core and session modules (ansible#17451)
1 parent bb9ed50 commit a06da86

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

test/integration/roles/test_consul_acl/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
- with_rules.token | length == 36
3030
- with_rules.name == 'With rule'
3131
- with_rules.rules | match('.*"foo".*')
32-
- with_rules.rules | match('.*"private/foo".*')
32+
- with_rules.rules | search(pattern='private/foo')
3333

3434
- name: clear up
3535
consul_acl:

test/integration/roles/test_consul_kv/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
name: 'ACL rule for testing'
66
rules:
77
- key: 'somekey'
8-
policy: all
8+
policy: write
99
register: test_acl
1010

1111
- name: cleanup from previous failed runs

test/integration/roles/test_consul_session/tasks/main.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
- name: register basic session with consul
23
consul_session:
34
name: session1
@@ -13,8 +14,10 @@
1314
- name: add checks for session health check
1415
consul:
1516
check_name: session_check
16-
script: /usr/bin/true
17-
interval: 15
17+
script: /bin/true
18+
interval: 1
19+
20+
- pause: seconds=2
1821

1922
- name: register a session with check
2023
consul_session:
@@ -43,7 +46,7 @@
4346
- with_delay.changed
4447
- with_delay.session_id | length == 36
4548
- with_delay.name == 'session_with_delay'
46-
- with_delay.delay == 20
49+
- with_delay.delay == "20"
4750

4851

4952
- name: retrieve session by id
@@ -65,11 +68,9 @@
6568
- 3 <= retrieved_by_list.sessions[0]
6669

6770
- name: remove sessions
68-
consul_session: id={{item}} state=absent
69-
with_items:
70-
- basic_result.session_id
71-
- with_check.session_id
72-
- with_delay.session_id
71+
consul_session: id='{{basic_result.session_id}}' state=absent
72+
- consul_session: id='{{with_check.session_id}}' state=absent
73+
- consul_session: id='{{with_delay.session_id}}' state=absent
7374

7475
- name: remove check
7576
consul:

0 commit comments

Comments
 (0)