More test fixes for split controller/remote tests.

This commit is contained in:
Matt Clay
2019-01-25 19:37:56 -08:00
parent 73636175da
commit a8116497ba
49 changed files with 217 additions and 135 deletions

View File

@@ -1 +1,2 @@
shippable/posix/group1
needs/root

View File

@@ -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']"

View File

@@ -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']"

View File

@@ -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']"

View File

@@ -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']"

View File

@@ -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']"