diff options
author | Matt Clay <matt@mystile.com> | 2019-01-25 19:37:56 -0800 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2019-01-25 20:46:53 -0800 |
commit | a8116497ba302de524489ffd47444517b520e9a7 (patch) | |
tree | 3c4d07baddd98426280787f82c1231fefbd8cead /test/integration/targets/sensu_handler/tasks | |
parent | 73636175da5f44eff2d2ac9623e38ed35d6e6309 (diff) | |
download | ansible-a8116497ba302de524489ffd47444517b520e9a7.tar.gz |
More test fixes for split controller/remote tests.
Diffstat (limited to 'test/integration/targets/sensu_handler/tasks')
5 files changed, 25 insertions, 30 deletions
diff --git a/test/integration/targets/sensu_handler/tasks/main.yml b/test/integration/targets/sensu_handler/tasks/main.yml index e85543f20b..0c0b56d23e 100644 --- a/test/integration/targets/sensu_handler/tasks/main.yml +++ b/test/integration/targets/sensu_handler/tasks/main.yml @@ -28,10 +28,10 @@ state: "present" register: handler_twice -- name: Retrieve configuration file stat - stat: - path: "{{ handler['file'] }}" - register: handler_stat +- name: Retrieve configuration file + slurp: + src: "{{ handler['file'] }}" + register: handler_config - name: Assert that handler data was set successfully and properly assert: @@ -40,7 +40,6 @@ - "handler is changed" - "handler_twice is successful" - "handler_twice is not changed" - - "handler_stat.stat.exists == true" - "handler['name'] == 'handler'" - "handler['file'] == '/etc/sensu/conf.d/handlers/handler.json'" - "handler['config']['type'] == 'pipe'" @@ -51,7 +50,7 @@ - name: Assert that the handler configuration file is actually configured properly vars: - config: "{{ lookup('file', handler['file']) | from_json }}" + config: "{{ handler_config.content | b64decode | from_json }}" assert: that: - "'handler' in config['handlers']" diff --git a/test/integration/targets/sensu_handler/tasks/set.yml b/test/integration/targets/sensu_handler/tasks/set.yml index 27908b76ca..393d711dc3 100644 --- a/test/integration/targets/sensu_handler/tasks/set.yml +++ b/test/integration/targets/sensu_handler/tasks/set.yml @@ -19,17 +19,16 @@ - anotherhandler register: handler -- name: Retrieve configuration file stat - stat: - path: "{{ handler['file'] }}" - register: handler_stat +- name: Retrieve configuration file + slurp: + src: "{{ handler['file'] }}" + register: handler_config - name: Validate set handler return data assert: that: - "handler is successful" - "handler is changed" - - "handler_stat.stat.exists == true" - "handler['name'] == 'set'" - "handler['file'] == '/etc/sensu/conf.d/handlers/set.json'" - "handler['config']['type'] == 'set'" @@ -39,7 +38,7 @@ - name: Assert that the handler configuration file is actually configured properly vars: - config: "{{ lookup('file', handler['file']) | from_json }}" + config: "{{ handler_config.content | b64decode | from_json }}" assert: that: - "'set' in config['handlers']" diff --git a/test/integration/targets/sensu_handler/tasks/tcp.yml b/test/integration/targets/sensu_handler/tasks/tcp.yml index f318e3b8c9..076ea14e1e 100644 --- a/test/integration/targets/sensu_handler/tasks/tcp.yml +++ b/test/integration/targets/sensu_handler/tasks/tcp.yml @@ -20,17 +20,16 @@ port: 8000 register: handler -- name: Retrieve configuration file stat - stat: - path: "{{ handler['file'] }}" - register: handler_stat +- name: Retrieve configuration file + slurp: + src: "{{ handler['file'] }}" + register: handler_config - name: Validate tcp handler return data assert: that: - "handler is successful" - "handler is changed" - - "handler_stat.stat.exists == true" - "handler['name'] == 'tcp'" - "handler['file'] == '/etc/sensu/conf.d/handlers/tcp.json'" - "handler['config']['type'] == 'tcp'" @@ -41,7 +40,7 @@ - name: Assert that the handler configuration file is actually configured properly vars: - config: "{{ lookup('file', handler['file']) | from_json }}" + config: "{{ handler_config.content | b64decode | from_json }}" assert: that: - "'tcp' in config['handlers']" diff --git a/test/integration/targets/sensu_handler/tasks/transport.yml b/test/integration/targets/sensu_handler/tasks/transport.yml index c40ee56202..34816194fa 100644 --- a/test/integration/targets/sensu_handler/tasks/transport.yml +++ b/test/integration/targets/sensu_handler/tasks/transport.yml @@ -20,17 +20,16 @@ name: "transport_handler" register: handler -- name: Retrieve configuration file stat - stat: - path: "{{ handler['file'] }}" - register: handler_stat +- name: Retrieve configuration file + slurp: + src: "{{ handler['file'] }}" + register: handler_config - name: Validate transport handler return data assert: that: - "handler is successful" - "handler is changed" - - "handler_stat.stat.exists == true" - "handler['name'] == 'transport'" - "handler['file'] == '/etc/sensu/conf.d/handlers/transport.json'" - "handler['config']['type'] == 'transport'" @@ -41,7 +40,7 @@ - name: Assert that the handler configuration file is actually configured properly vars: - config: "{{ lookup('file', handler['file']) | from_json }}" + config: "{{ handler_config.content | b64decode | from_json }}" assert: that: - "'transport' in config['handlers']" diff --git a/test/integration/targets/sensu_handler/tasks/udp.yml b/test/integration/targets/sensu_handler/tasks/udp.yml index 1c9bb4360a..8f13a2a25e 100644 --- a/test/integration/targets/sensu_handler/tasks/udp.yml +++ b/test/integration/targets/sensu_handler/tasks/udp.yml @@ -20,17 +20,16 @@ port: 8000 register: handler -- name: Retrieve configuration file stat - stat: - path: "{{ handler['file'] }}" - register: handler_stat +- name: Retrieve configuration file + slurp: + src: "{{ handler['file'] }}" + register: handler_config - name: Validate udp handler return data assert: that: - "handler is successful" - "handler is changed" - - "handler_stat.stat.exists == true" - "handler['name'] == 'udp'" - "handler['file'] == '/etc/sensu/conf.d/handlers/udp.json'" - "handler['config']['type'] == 'udp'" @@ -41,7 +40,7 @@ - name: Assert that the handler configuration file is actually configured properly vars: - config: "{{ lookup('file', handler['file']) | from_json }}" + config: "{{ handler_config.content | b64decode | from_json }}" assert: that: - "'udp' in config['handlers']" |