From a9c0b3535db433aa919b586e860509cac583c94d Mon Sep 17 00:00:00 2001 From: Martin Krizek Date: Mon, 6 May 2024 13:35:13 +0200 Subject: [PATCH] add test --- test/integration/targets/dnf/tasks/dnf.yml | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/integration/targets/dnf/tasks/dnf.yml b/test/integration/targets/dnf/tasks/dnf.yml index 4110d4b80c2..bd40ec5869a 100644 --- a/test/integration/targets/dnf/tasks/dnf.yml +++ b/test/integration/targets/dnf/tasks/dnf.yml @@ -885,3 +885,27 @@ - dnf: name: langpacks-ja state: absent + +- name: test passing non existing plugins, should fail + block: + - dnf: + name: sos + enable_plugin: nonexisting + ignore_errors: true + register: enable_plugin_result + + - dnf: + name: sos + disable_plugin: nonexisting + ignore_errors: true + register: disable_plugin_result + + - assert: + that: + - enable_plugin_result is failed + - disable_plugin_result is failed + - '"No matches were found for the following plugin name patterns while enabling libdnf5 plugins: " in enable_plugin_result.msg' + - '"No matches were found for the following plugin name patterns while disabling libdnf5 plugins: " in disable_plugin_result.msg' + - '"nonexisting" in enable_plugin_result.msg' + - '"nonexisting" in disable_plugin_result.msg' + when: dnf5|default(false)