From cb173f7f1dbf2bd4b0edb8e6e6c051383b32b049 Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Tue, 11 Dec 2018 18:32:52 +0530 Subject: [PATCH] nxos_logging message fix author:mikewiebe commit 374ca78 Signed-off-by: Trishna Guha --- .../targets/nxos_logging/tasks/main.yaml | 14 ++++++++++++-- .../targets/nxos_logging/tests/common/basic.yaml | 11 ++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/test/integration/targets/nxos_logging/tasks/main.yaml b/test/integration/targets/nxos_logging/tasks/main.yaml index 4b0f8c64d90..f6c7fec17e6 100644 --- a/test/integration/targets/nxos_logging/tasks/main.yaml +++ b/test/integration/targets/nxos_logging/tasks/main.yaml @@ -1,3 +1,13 @@ --- -- { include: cli.yaml, tags: ['cli'] } -- { include: nxapi.yaml, tags: ['nxapi'] } +# Use block to ensure that the baude rate gets set +# back to 9600 even if there are failures or errors. +- block: + - { include: cli.yaml, tags: ['cli'] } + - { include: nxapi.yaml, tags: ['nxapi'] } + always: + - name: Set Baud Rate Back to 9600 so our tests don't break + nxos_config: + lines: + - speed 9600 + parents: line console + connection: network_cli diff --git a/test/integration/targets/nxos_logging/tests/common/basic.yaml b/test/integration/targets/nxos_logging/tests/common/basic.yaml index 1e60b4e0ea3..6e490b5d3a4 100644 --- a/test/integration/targets/nxos_logging/tests/common/basic.yaml +++ b/test/integration/targets/nxos_logging/tests/common/basic.yaml @@ -3,6 +3,15 @@ - debug: msg="Using provider={{ connection.transport }}" when: ansible_connection == "local" +# This task is needed to clear out any previous logfile +# size settings. +- name: Workaround to clear logging logfile size + nxos_config: + lines: + - logging logfile test 1 size 4194304 + provider: "{{ connection }}" + ignore_errors: yes + - name: Set up console logging nxos_logging: &clog dest: console @@ -46,7 +55,7 @@ - name: Set Baud Rate to less than 38400 nxos_config: lines: - - speed 9600 + - speed 19200 parents: line console provider: "{{ connection }}"