diff options
author | Paul Bonaud <paul.bonaud@fretlink.com> | 2020-06-22 22:32:55 +0200 |
---|---|---|
committer | Paul Bonaud <paul.bonaud@fretlink.com> | 2020-06-23 10:53:05 +0200 |
commit | 4525f9489fe792b0d7ee4ca76dc0c3706784d256 (patch) | |
tree | d3a0759aee49d8aa595417a88e20978f6f6586c3 /tests/test-restart-app.yml | |
parent | fd2e4788a034e76b25001dc11d56e05ba9f428b5 (diff) | |
download | ansible-clever-4525f9489fe792b0d7ee4ca76dc0c3706784d256.tar.gz ansible-clever-4525f9489fe792b0d7ee4ca76dc0c3706784d256.tar.zst ansible-clever-4525f9489fe792b0d7ee4ca76dc0c3706784d256.zip |
tests: expectations on binary stub
Diffstat (limited to 'tests/test-restart-app.yml')
-rw-r--r-- | tests/test-restart-app.yml | 27 |
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 }}" | ||