From d7f4f886f81f3b43a9a4fd0327926e0266ffb0f0 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Mon, 27 May 2019 00:34:03 -0400 Subject: [PATCH] ansible-test: ios_command cli test should only be network_cli (#56955) We do not support testing under ansible_connection=local Signed-off-by: Paul Belanger --- .../ios_command/tests/cli/cli_command.yaml | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/test/integration/targets/ios_command/tests/cli/cli_command.yaml b/test/integration/targets/ios_command/tests/cli/cli_command.yaml index 3fd3807e135..a2a252d3abc 100644 --- a/test/integration/targets/ios_command/tests/cli/cli_command.yaml +++ b/test/integration/targets/ios_command/tests/cli/cli_command.yaml @@ -2,25 +2,27 @@ - debug: msg: "START cli/cli_command.yaml on connection={{ ansible_connection }}" -- name: get output for single command - cli_command: - command: show version - register: result +- block: + - name: get output for single command + cli_command: + command: show version + register: result -- assert: - that: - - "result.changed == false" - - "result.stdout is defined" + - assert: + that: + - "result.changed == false" + - "result.stdout is defined" -- name: send invalid command - cli_command: - command: 'show foo' - register: result - ignore_errors: yes + - name: send invalid command + cli_command: + command: 'show foo' + register: result + ignore_errors: yes -- assert: - that: - - "result.failed == true" - - "result.msg is defined" + - assert: + that: + - "result.failed == true" + - "result.msg is defined" + when: "ansible_connection == 'network_cli'" - debug: msg="END cli/cli_command.yaml on connection={{ ansible_connection }}"