aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/test-restart-app.yml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-restart-app.yml')
-rw-r--r--tests/test-restart-app.yml27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test-restart-app.yml b/tests/test-restart-app.yml
index 09d9936..4c13a14 100644
--- a/tests/test-restart-app.yml
+++ b/tests/test-restart-app.yml
@@ -2,6 +2,10 @@
2- name: Restart app on clever 2- name: Restart app on clever
3 hosts: localhost 3 hosts: localhost
4 remote_user: root 4 remote_user: root
5 pre_tasks:
6 - file:
7 state: absent
8 path: ../clever-commands
5 roles: 9 roles:
6 - role: clever 10 - role: clever
7 vars: 11 vars:
@@ -9,3 +13,26 @@
9 clever_secret: cba321 13 clever_secret: cba321
10 clever_app: app_00000000-0000-0000-0000-000000000000 14 clever_app: app_00000000-0000-0000-0000-000000000000
11 clever_restart_only: true 15 clever_restart_only: true
16 post_tasks:
17 - name: Check stubbed commands
18 command: "{{ item.cmd }}"
19 ignore_errors: true
20 vars:
21 display: "{{ item.display }}"
22 with_list:
23 - cmd: "grep restart ../clever-commands"
24 display: "Expected 'clever restart' command to be called"
25 - cmd: "grep -v deploy ../clever-commands"
26 display: "Expected 'clever deploy' command to NOT be called"
27 - cmd: "grep -v scale ../clever-commands"
28 display: "Expected 'clever scale' command to NOT be called"
29 register: tests_results
30 - name: show results
31 debug:
32 msg:
33 - "failed_results: {{ failed_results }}"
34 - "success_results: {{ success_results }}"
35 failed_when: tests_results is failed
36 vars:
37 failed_results: "{{ tests_results.results | selectattr('failed') | map(attribute='item.display') | list }}"
38 success_results: "{{ tests_results.results | rejectattr('failed') | map(attribute='item.display') | list }}"