From e7dab70b47aa6c836dee1054ba4079392c31a635 Mon Sep 17 00:00:00 2001 From: Myron Sosyak <49795530+msosyak@users.noreply.github.com> Date: Mon, 27 Apr 2020 18:23:29 +0300 Subject: [PATCH] Fix sensors_check link (#1611) --- .../sonic-common/tasks/sensors_check.yml | 27 +++---------------- ansible/roles/test/tasks/sensors_check.yml | 5 +--- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/ansible/roles/sonic-common/tasks/sensors_check.yml b/ansible/roles/sonic-common/tasks/sensors_check.yml index 067686367d..0178df17b9 100644 --- a/ansible/roles/sonic-common/tasks/sensors_check.yml +++ b/ansible/roles/sonic-common/tasks/sensors_check.yml @@ -1,25 +1,4 @@ -- name: Get platform monitor docker name - shell: docker ps -a --format '{{'{{'}}.Image{{'}} {{'}}.Names{{'}}'}}' | grep 'platform' | awk '{print $2}' - register: pmon_ps - -- name: Get platform name - shell: show platform summary | grep Platform | awk '{print $2}' - register: platform - -- include_tasks: add_container_to_inventory.yml +- name: run test + include_tasks: roles/test/tasks/pytest_runner.yml vars: - container_name: "{{ pmon_ps.stdout }}" - -- name: Gather sensors - sensors_facts: checks={{ sensors_checks[platform.stdout] }} - delegate_to: "{{ ansible_host }}_{{ pmon_ps.stdout }}" - -- name: Output of sensors information - debug: var=vars['sensors'] - -- name: Assert no alarm - assert: { that: "{{ vars['sensors']['alarm'] }} == False" } - -- name: Show warnings - debug: var=vars['sensors']['warnings'] - when: vars['sensors']['warning'] + test_node: platform/test_sensors.py \ No newline at end of file diff --git a/ansible/roles/test/tasks/sensors_check.yml b/ansible/roles/test/tasks/sensors_check.yml index 6ec6b3afac..a0436103e0 120000 --- a/ansible/roles/test/tasks/sensors_check.yml +++ b/ansible/roles/test/tasks/sensors_check.yml @@ -1,4 +1 @@ -- name: run test - include_tasks: roles/test/tasks/pytest_runner.yml - vars: - test_node: platform/test_sensors.py \ No newline at end of file +../../sonic-common/tasks/sensors_check.yml \ No newline at end of file