Skip to content

Commit

Permalink
chore: remove assertions related to output files
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Dec 2, 2021
1 parent 7971ca7 commit 4254564
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 256 deletions.
52 changes: 0 additions & 52 deletions roles/test-beat/tasks/auditbeat/assert.yml

This file was deleted.

15 changes: 0 additions & 15 deletions roles/test-beat/tasks/common/assert.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
---

- name: 'Stat {{ beat_name }} output file'
stat:
path: '{{ beat_output_file }}'
register: output_stat

- name: '{{ beat_name }} output file stats'
debug:
var: output_stat

- name: "Assert that {{ beat_name }} output file exists"
assert:
that:
- "output_stat.stat.exists"
- "output_stat.stat.size > 0"

- name: 'Stat {{ beat_name }} log file'
stat:
path: '{{ beat_log_file }}'
Expand Down
6 changes: 0 additions & 6 deletions roles/test-beat/tasks/darwin/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
loop_control:
loop_var: post_run_item

- name: 'Wait for {{ beat_service_name }} to produce output.json'
wait_for:
path: '{{ beat_output_file }}'
search_regex: '"version"'
timeout: 20

- name: 'Fetch metrics from {{ beat_name }} over HTTP'
get_url:
url: http://localhost:5066/stats
Expand Down
6 changes: 0 additions & 6 deletions roles/test-beat/tasks/linux/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@
loop_control:
loop_var: post_run_item

- name: 'Wait for {{ beat_name }} to produce output.json'
wait_for:
path: '{{ beat_output_file }}'
search_regex: '"version"'
timeout: 20

- name: 'Fetch metrics from {{ beat_name }} over HTTP'
get_url:
url: http://localhost:5066/stats
Expand Down
17 changes: 1 addition & 16 deletions roles/test-beat/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
- 'vars/{{ ansible_system | lower }}.yml'
- default.yml

- name: Set config/output/log file vars
- name: Set config/log file vars
set_fact:
beat_config_file: '{{ beat_config_path}}/{{ beat_name }}.yml'
beat_output_file: '{{ beat_logs_path }}/output.json'
beat_log_file: '{{ beat_logs_path }}/{{ beat_name }}.json'
beat_registry_file: '{{ beat_data_path }}/{{ registry_file }}'
beat_metrics_file: '{{ beat_logs_path }}/metrics.json'
Expand All @@ -48,12 +47,6 @@
loop_var: system_item

always:
- name: Save output to host
fetch:
src: '{{ beat_output_file }}'
dest: 'logs/{{ beat_name }}{{ beat_pkg_suffix }}-{{ win_arch | default(ansible_architecture) }}-{{ inventory_hostname }}/output.json'
flat: yes

- name: Save log to host
fetch:
src: '{{ beat_log_file }}'
Expand Down Expand Up @@ -89,11 +82,3 @@
loop_control:
loop_var: assert_item

- name: Run {{ beat_name }} assertions on outputs
include: '{{ beat_assert_item }}'
with_first_found:
- files:
- '{{ beat_name }}/assert.yml'
- default.yml
loop_control:
loop_var: beat_assert_item
27 changes: 0 additions & 27 deletions roles/test-beat/tasks/packetbeat/assert.yml

This file was deleted.

82 changes: 0 additions & 82 deletions roles/test-beat/tasks/win32nt/assert.yml

This file was deleted.

52 changes: 0 additions & 52 deletions roles/test-beat/tasks/winlogbeat/assert.yml

This file was deleted.

0 comments on commit 4254564

Please sign in to comment.