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.yml38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/test-restart-app.yml b/tests/test-restart-app.yml
new file mode 100644
index 0000000..4c13a14
--- /dev/null
+++ b/tests/test-restart-app.yml
@@ -0,0 +1,38 @@
1---
2- name: Restart app on clever
3 hosts: localhost
4 remote_user: root
5 pre_tasks:
6 - file:
7 state: absent
8 path: ../clever-commands
9 roles:
10 - role: clever
11 vars:
12 clever_token: 123abc
13 clever_secret: cba321
14 clever_app: app_00000000-0000-0000-0000-000000000000
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 }}"