From 6fe9cf11f171242cd5533b830d56f9220850adcd Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 14 Jun 2022 07:35:29 +0200 Subject: [PATCH] Print debug output during tests. --- .../alternatives/tasks/subcommands.yml | 20 ++++++++++++++++++- .../targets/alternatives/vars/Debian.yml | 1 + .../targets/alternatives/vars/Suse-42.3.yml | 1 + .../targets/alternatives/vars/default.yml | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/integration/targets/alternatives/tasks/subcommands.yml b/tests/integration/targets/alternatives/tasks/subcommands.yml index ba4ecbbafe..1d0d8ee1c0 100644 --- a/tests/integration/targets/alternatives/tasks/subcommands.yml +++ b/tests/integration/targets/alternatives/tasks/subcommands.yml @@ -32,6 +32,15 @@ that: - cmd.stdout == "dummy2" +- name: Get dummymain alternatives output + command: + argv: '{{ alternatives_command }} --display dummymain' + register: result + +- name: Print result + debug: + var: result.stdout_lines + - name: Subcommands are not removed if not specified alternatives: name: dummymain @@ -75,4 +84,13 @@ assert: that: - cmd.rc == 2 - - '"No such file" in cmd.msg' \ No newline at end of file + - '"No such file" in cmd.msg' + +- name: Get dummymain alternatives output + command: + argv: '{{ alternatives_command }} --display dummymain' + register: result + +- name: Print result + debug: + var: result.stdout_lines diff --git a/tests/integration/targets/alternatives/vars/Debian.yml b/tests/integration/targets/alternatives/vars/Debian.yml index 1e83283e4d..d2cdd0cd0e 100644 --- a/tests/integration/targets/alternatives/vars/Debian.yml +++ b/tests/integration/targets/alternatives/vars/Debian.yml @@ -1,2 +1,3 @@ --- alternatives_dir: /var/lib/dpkg/alternatives/ +alternatives_command: update-alternatives diff --git a/tests/integration/targets/alternatives/vars/Suse-42.3.yml b/tests/integration/targets/alternatives/vars/Suse-42.3.yml index 37664ddb56..14958db39a 100644 --- a/tests/integration/targets/alternatives/vars/Suse-42.3.yml +++ b/tests/integration/targets/alternatives/vars/Suse-42.3.yml @@ -1,2 +1,3 @@ --- alternatives_dir: /var/lib/rpm/alternatives/ +alternatives_command: update-alternatives diff --git a/tests/integration/targets/alternatives/vars/default.yml b/tests/integration/targets/alternatives/vars/default.yml index d00123ded3..7aeb9bb562 100644 --- a/tests/integration/targets/alternatives/vars/default.yml +++ b/tests/integration/targets/alternatives/vars/default.yml @@ -1,2 +1,3 @@ --- alternatives_dir: /var/lib/alternatives/ +alternatives_command: update-alternatives