diff --git a/tests/unit/plugins/modules/test_cpanm.yaml b/tests/unit/plugins/modules/test_cpanm.yaml index 5886a90f357..467429b10dc 100644 --- a/tests/unit/plugins/modules/test_cpanm.yaml +++ b/tests/unit/plugins/modules/test_cpanm.yaml @@ -8,396 +8,396 @@ anchors: environ_true: &env-def-true {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true} environ_false: &env-def-false {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: false} test_cases: -- id: install_dancer_compatibility - input: - name: Dancer - mode: compatibility - output: - changed: true - cpanm_version: "1.7047" - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/perl, -le, 'use Dancer;'] - environ: *env-def-false - rc: 2 - out: "" - err: "error, not installed" - - command: [/testbin/cpanm, Dancer] - environ: *env-def-true - rc: 0 - out: "" - err: "" -- id: install_dancer_already_installed_compatibility - input: - name: Dancer - mode: compatibility - output: - changed: false - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/perl, -le, 'use Dancer;'] - environ: *env-def-false - rc: 0 - out: "" - err: "" -- id: install_dancer - input: - name: Dancer - output: - changed: true - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/cpanm, Dancer] - environ: *env-def-true - rc: 0 - out: "" - err: "" -- id: install_distribution_file_compatibility - input: - name: MIYAGAWA/Plack-0.99_05.tar.gz - mode: compatibility - output: - changed: true - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/cpanm, MIYAGAWA/Plack-0.99_05.tar.gz] - environ: *env-def-true - rc: 0 - out: "" - err: "" -- id: install_distribution_file - input: - name: MIYAGAWA/Plack-0.99_05.tar.gz - output: - changed: true - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/cpanm, MIYAGAWA/Plack-0.99_05.tar.gz] - environ: *env-def-true - rc: 0 - out: "" - err: "" -- id: install_into_locallib - input: - name: Dancer - mode: new - locallib: /srv/webapps/my_app/extlib - output: - changed: true - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/cpanm, --local-lib, /srv/webapps/my_app/extlib, Dancer] - environ: *env-def-true - rc: 0 - out: "" - err: "" -- id: install_from_local_directory - input: - from_path: /srv/webapps/my_app/src/ - mode: new - output: - changed: true - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/cpanm, /srv/webapps/my_app/src/] - environ: *env-def-true - rc: 0 - out: "" - err: "" -- id: install_into_locallib_no_unit_testing - input: - name: Dancer - notest: true - mode: new - locallib: /srv/webapps/my_app/extlib - output: - changed: true - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/cpanm, --notest, --local-lib, /srv/webapps/my_app/extlib, Dancer] - environ: *env-def-true - rc: 0 - out: "" - err: "" -- id: install_from_mirror - input: - name: Dancer - mode: new - mirror: "http://cpan.cpantesters.org/" - output: - changed: true - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/cpanm, --mirror, "http://cpan.cpantesters.org/", Dancer] - environ: *env-def-true - rc: 0 - out: "" - err: "" -- id: install_into_system_lib - input: - name: Dancer - mode: new - system_lib: true - output: - failed: true - mocks: - run_command: [] -- id: install_minversion_implicit - input: - name: Dancer - mode: new - version: "1.0" - output: - changed: true - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/cpanm, Dancer~1.0] - environ: *env-def-true - rc: 0 - out: "" - err: "" -- id: install_minversion_explicit - input: - name: Dancer - mode: new - version: "~1.5" - output: - changed: true - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/cpanm, Dancer~1.5] - environ: *env-def-true - rc: 0 - out: "" - err: "" -- id: install_specific_version - input: - name: Dancer - mode: new - version: "@1.7" - output: - changed: true - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/cpanm, Dancer@1.7] - environ: *env-def-true - rc: 0 - out: "" - err: "" -- id: install_specific_version_from_file_error - input: - name: MIYAGAWA/Plack-0.99_05.tar.gz - mode: new - version: "@1.7" - output: - failed: true - msg: parameter 'version' must not be used when installing from a file - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" -- id: install_specific_version_from_directory_error - input: - from_path: ~/ - mode: new - version: "@1.7" - output: - failed: true - msg: parameter 'version' must not be used when installing from a directory - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" -- id: install_specific_version_from_git_url_explicit - input: - name: "git://github.com/plack/Plack.git" - mode: new - version: "@1.7" - output: - changed: true - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/cpanm, "git://github.com/plack/Plack.git@1.7"] - environ: *env-def-true - rc: 0 - out: "" - err: "" -- id: install_specific_version_from_git_url_implicit - input: - name: "git://github.com/plack/Plack.git" - mode: new - version: "2.5" - output: - changed: true - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/cpanm, "git://github.com/plack/Plack.git@2.5"] - environ: *env-def-true - rc: 0 - out: "" - err: "" -- id: install_version_operator_from_git_url_error - input: - name: "git://github.com/plack/Plack.git" - mode: new - version: "~2.5" - output: - failed: true - msg: operator '~' not allowed in version parameter when installing from git repository - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" -- id: install_dancer_with_recommends - input: - name: Dancer2 - install_recommendations: true - output: - changed: true - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/cpanm, --with-recommends, Dancer2] - environ: *env-def-true - rc: 0 - out: "" - err: "" -- id: install_dancer_with_suggests - input: - name: Dancer2 - install_suggestions: true - output: - changed: true - mocks: - run_command: - - command: [/testbin/cpanm, --version] - environ: *env-def-true - rc: 0 - out: | - cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) - perl version 5.041005 (/usr/local/bin/perl) - err: "" - - command: [/testbin/cpanm, --with-suggests, Dancer2] - environ: *env-def-true - rc: 0 - out: "" - err: "" + - id: install_dancer_compatibility + input: + name: Dancer + mode: compatibility + output: + changed: true + cpanm_version: '1.7047' + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/perl, -le, use Dancer;] + environ: *env-def-false + rc: 2 + out: '' + err: error, not installed + - command: [/testbin/cpanm, Dancer] + environ: *env-def-true + rc: 0 + out: '' + err: '' + - id: install_dancer_already_installed_compatibility + input: + name: Dancer + mode: compatibility + output: + changed: false + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/perl, -le, use Dancer;] + environ: *env-def-false + rc: 0 + out: '' + err: '' + - id: install_dancer + input: + name: Dancer + output: + changed: true + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/cpanm, Dancer] + environ: *env-def-true + rc: 0 + out: '' + err: '' + - id: install_distribution_file_compatibility + input: + name: MIYAGAWA/Plack-0.99_05.tar.gz + mode: compatibility + output: + changed: true + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/cpanm, MIYAGAWA/Plack-0.99_05.tar.gz] + environ: *env-def-true + rc: 0 + out: '' + err: '' + - id: install_distribution_file + input: + name: MIYAGAWA/Plack-0.99_05.tar.gz + output: + changed: true + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/cpanm, MIYAGAWA/Plack-0.99_05.tar.gz] + environ: *env-def-true + rc: 0 + out: '' + err: '' + - id: install_into_locallib + input: + name: Dancer + mode: new + locallib: /srv/webapps/my_app/extlib + output: + changed: true + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/cpanm, --local-lib, /srv/webapps/my_app/extlib, Dancer] + environ: *env-def-true + rc: 0 + out: '' + err: '' + - id: install_from_local_directory + input: + from_path: /srv/webapps/my_app/src/ + mode: new + output: + changed: true + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/cpanm, /srv/webapps/my_app/src/] + environ: *env-def-true + rc: 0 + out: '' + err: '' + - id: install_into_locallib_no_unit_testing + input: + name: Dancer + notest: true + mode: new + locallib: /srv/webapps/my_app/extlib + output: + changed: true + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/cpanm, --notest, --local-lib, /srv/webapps/my_app/extlib, Dancer] + environ: *env-def-true + rc: 0 + out: '' + err: '' + - id: install_from_mirror + input: + name: Dancer + mode: new + mirror: http://cpan.cpantesters.org/ + output: + changed: true + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/cpanm, --mirror, http://cpan.cpantesters.org/, Dancer] + environ: *env-def-true + rc: 0 + out: '' + err: '' + - id: install_into_system_lib + input: + name: Dancer + mode: new + system_lib: true + output: + failed: true + mocks: + run_command: [] + - id: install_minversion_implicit + input: + name: Dancer + mode: new + version: '1.0' + output: + changed: true + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/cpanm, Dancer~1.0] + environ: *env-def-true + rc: 0 + out: '' + err: '' + - id: install_minversion_explicit + input: + name: Dancer + mode: new + version: ~1.5 + output: + changed: true + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/cpanm, Dancer~1.5] + environ: *env-def-true + rc: 0 + out: '' + err: '' + - id: install_specific_version + input: + name: Dancer + mode: new + version: '@1.7' + output: + changed: true + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/cpanm, Dancer@1.7] + environ: *env-def-true + rc: 0 + out: '' + err: '' + - id: install_specific_version_from_file_error + input: + name: MIYAGAWA/Plack-0.99_05.tar.gz + mode: new + version: '@1.7' + output: + failed: true + msg: parameter 'version' must not be used when installing from a file + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - id: install_specific_version_from_directory_error + input: + from_path: ~/ + mode: new + version: '@1.7' + output: + failed: true + msg: parameter 'version' must not be used when installing from a directory + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - id: install_specific_version_from_git_url_explicit + input: + name: git://github.com/plack/Plack.git + mode: new + version: '@1.7' + output: + changed: true + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/cpanm, git://github.com/plack/Plack.git@1.7] + environ: *env-def-true + rc: 0 + out: '' + err: '' + - id: install_specific_version_from_git_url_implicit + input: + name: git://github.com/plack/Plack.git + mode: new + version: '2.5' + output: + changed: true + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/cpanm, git://github.com/plack/Plack.git@2.5] + environ: *env-def-true + rc: 0 + out: '' + err: '' + - id: install_version_operator_from_git_url_error + input: + name: git://github.com/plack/Plack.git + mode: new + version: ~2.5 + output: + failed: true + msg: operator '~' not allowed in version parameter when installing from git repository + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - id: install_dancer_with_recommends + input: + name: Dancer2 + install_recommendations: true + output: + changed: true + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/cpanm, --with-recommends, Dancer2] + environ: *env-def-true + rc: 0 + out: '' + err: '' + - id: install_dancer_with_suggests + input: + name: Dancer2 + install_suggestions: true + output: + changed: true + mocks: + run_command: + - command: [/testbin/cpanm, --version] + environ: *env-def-true + rc: 0 + out: | + cpanm (App::cpanminus) version 1.7047 (/usr/local/bin/cpanm) + perl version 5.041005 (/usr/local/bin/perl) + err: '' + - command: [/testbin/cpanm, --with-suggests, Dancer2] + environ: *env-def-true + rc: 0 + out: '' + err: '' diff --git a/tests/unit/plugins/modules/test_django_check.yaml b/tests/unit/plugins/modules/test_django_check.yaml index 1b8b36a52cf..fb39b6d62fa 100644 --- a/tests/unit/plugins/modules/test_django_check.yaml +++ b/tests/unit/plugins/modules/test_django_check.yaml @@ -7,40 +7,40 @@ anchors: environ: &env-def {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true} test_cases: -- id: success - input: - settings: whatever.settings - output: - version: "5.1.2" - mocks: - run_command: - - command: [/testbin/python, -m, django, --version] - environ: *env-def - rc: 0 - out: "5.1.2\n" - err: "" - - command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings] - environ: *env-def - rc: 0 - out: "whatever\n" - err: "" -- id: multiple_databases - input: - settings: whatever.settings - database: - - abc - - def - output: - version: "5.1.2" - mocks: - run_command: - - command: [/testbin/python, -m, django, --version] - environ: *env-def - rc: 0 - out: "5.1.2\n" - err: "" - - command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings, --database, abc, --database, def] - environ: *env-def - rc: 0 - out: "whatever\n" - err: "" + - id: success + input: + settings: whatever.settings + output: + version: 5.1.2 + mocks: + run_command: + - command: [/testbin/python, -m, django, --version] + environ: *env-def + rc: 0 + out: "5.1.2\n" + err: '' + - command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings] + environ: *env-def + rc: 0 + out: "whatever\n" + err: '' + - id: multiple_databases + input: + settings: whatever.settings + database: + - abc + - def + output: + version: 5.1.2 + mocks: + run_command: + - command: [/testbin/python, -m, django, --version] + environ: *env-def + rc: 0 + out: "5.1.2\n" + err: '' + - command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings, --database, abc, --database, def] + environ: *env-def + rc: 0 + out: "whatever\n" + err: '' diff --git a/tests/unit/plugins/modules/test_django_command.yaml b/tests/unit/plugins/modules/test_django_command.yaml index a98182385e5..10da8753bd4 100644 --- a/tests/unit/plugins/modules/test_django_command.yaml +++ b/tests/unit/plugins/modules/test_django_command.yaml @@ -7,47 +7,47 @@ anchors: environ: &env-def {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true} test_cases: -- id: command_success - input: - command: check - extra_args: - - babaloo - - yaba - - daba - - doo - settings: whatever.settings - mocks: - run_command: - - command: [/testbin/python, -m, django, --version] - environ: *env-def - rc: 0 - out: "5.1.2\n" - err: "" - - command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings, babaloo, yaba, daba, doo] - environ: *env-def - rc: 0 - out: "whatever\n" - err: "" -- id: command_fail - input: - command: check - extra_args: - - babaloo - - yaba - - daba - - doo - settings: whatever.settings - output: - failed: true - mocks: - run_command: - - command: [/testbin/python, -m, django, --version] - environ: *env-def - rc: 0 - out: "5.1.2\n" - err: "" - - command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings, babaloo, yaba, daba, doo] - environ: *env-def - rc: 1 - out: "whatever\n" - err: "" + - id: command_success + input: + command: check + extra_args: + - babaloo + - yaba + - daba + - doo + settings: whatever.settings + mocks: + run_command: + - command: [/testbin/python, -m, django, --version] + environ: *env-def + rc: 0 + out: "5.1.2\n" + err: '' + - command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings, babaloo, yaba, daba, doo] + environ: *env-def + rc: 0 + out: "whatever\n" + err: '' + - id: command_fail + input: + command: check + extra_args: + - babaloo + - yaba + - daba + - doo + settings: whatever.settings + output: + failed: true + mocks: + run_command: + - command: [/testbin/python, -m, django, --version] + environ: *env-def + rc: 0 + out: "5.1.2\n" + err: '' + - command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings, babaloo, yaba, daba, doo] + environ: *env-def + rc: 1 + out: "whatever\n" + err: '' diff --git a/tests/unit/plugins/modules/test_django_createcachetable.yaml b/tests/unit/plugins/modules/test_django_createcachetable.yaml index e800fb65ac1..b8056e1b2e0 100644 --- a/tests/unit/plugins/modules/test_django_createcachetable.yaml +++ b/tests/unit/plugins/modules/test_django_createcachetable.yaml @@ -7,18 +7,18 @@ anchors: environ: &env-def {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true} test_cases: -- id: command_success - input: - settings: whatever.settings - mocks: - run_command: - - command: [/testbin/python, -m, django, --version] - environ: *env-def - rc: 0 - out: "5.1.2\n" - err: "" - - command: [/testbin/python, -m, django, createcachetable, --no-color, --settings=whatever.settings, --noinput, --database=default] - environ: *env-def - rc: 0 - out: "whatever\n" - err: "" + - id: command_success + input: + settings: whatever.settings + mocks: + run_command: + - command: [/testbin/python, -m, django, --version] + environ: *env-def + rc: 0 + out: "5.1.2\n" + err: '' + - command: [/testbin/python, -m, django, createcachetable, --no-color, --settings=whatever.settings, --noinput, --database=default] + environ: *env-def + rc: 0 + out: "whatever\n" + err: '' diff --git a/tests/unit/plugins/modules/test_facter_facts.yaml b/tests/unit/plugins/modules/test_facter_facts.yaml index ffce162b27b..89a98714c5a 100644 --- a/tests/unit/plugins/modules/test_facter_facts.yaml +++ b/tests/unit/plugins/modules/test_facter_facts.yaml @@ -7,39 +7,39 @@ anchors: environ: &env-def {check_rc: true} test_cases: -- id: simple run - output: - ansible_facts: - facter: - a: 1 - b: 2 - c: 3 - mocks: - run_command: - - command: [/testbin/facter, --json] - environ: *env-def - rc: 0 - out: > - { "a": 1, "b": 2, "c": 3 } - err: "" -- id: with args - input: - arguments: - - -p - - system_uptime - - timezone - - is_virtual - output: - ansible_facts: - facter: - a: 1 - b: 2 - c: 3 - mocks: - run_command: - - command: [/testbin/facter, --json, -p, system_uptime, timezone, is_virtual] - environ: *env-def - rc: 0 - out: > - { "a": 1, "b": 2, "c": 3 } - err: "" + - id: simple run + output: + ansible_facts: + facter: + a: 1 + b: 2 + c: 3 + mocks: + run_command: + - command: [/testbin/facter, --json] + environ: *env-def + rc: 0 + out: > + { "a": 1, "b": 2, "c": 3 } + err: '' + - id: with args + input: + arguments: + - -p + - system_uptime + - timezone + - is_virtual + output: + ansible_facts: + facter: + a: 1 + b: 2 + c: 3 + mocks: + run_command: + - command: [/testbin/facter, --json, -p, system_uptime, timezone, is_virtual] + environ: *env-def + rc: 0 + out: > + { "a": 1, "b": 2, "c": 3 } + err: '' diff --git a/tests/unit/plugins/modules/test_gconftool2.yaml b/tests/unit/plugins/modules/test_gconftool2.yaml index 12bf9099f48..19d389247fb 100644 --- a/tests/unit/plugins/modules/test_gconftool2.yaml +++ b/tests/unit/plugins/modules/test_gconftool2.yaml @@ -7,147 +7,147 @@ anchors: environ: &env-def {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true} test_cases: -- id: test_simple_element_set - input: - state: present - key: /desktop/gnome/background/picture_filename - value: 200 - value_type: int - output: - new_value: '200' - changed: true - version: "3.2.6" - mocks: - run_command: - - command: [/testbin/gconftool-2, --version] - environ: *env-def - rc: 0 - out: "3.2.6\n" - err: "" - - command: [/testbin/gconftool-2, --get, /desktop/gnome/background/picture_filename] - environ: *env-def - rc: 0 - out: "100\n" - err: "" - - command: [/testbin/gconftool-2, --type, int, --set, /desktop/gnome/background/picture_filename, "200"] - environ: *env-def - rc: 0 - out: "" - err: "" - - command: [/testbin/gconftool-2, --get, /desktop/gnome/background/picture_filename] - environ: *env-def - rc: 0 - out: "200\n" - err: "" -- id: test_simple_element_set_idempotency_int - input: - state: present - key: /desktop/gnome/background/picture_filename - value: 200 - value_type: int - output: - new_value: '200' - changed: false - version: "3.2.5" - mocks: - run_command: - - command: [/testbin/gconftool-2, --version] - environ: *env-def - rc: 0 - out: "3.2.5\n" - err: "" - - command: [/testbin/gconftool-2, --get, /desktop/gnome/background/picture_filename] - environ: *env-def - rc: 0 - out: "200\n" - err: "" - - command: [/testbin/gconftool-2, --type, int, --set, /desktop/gnome/background/picture_filename, "200"] - environ: *env-def - rc: 0 - out: "" - err: "" - - command: [/testbin/gconftool-2, --get, /desktop/gnome/background/picture_filename] - environ: *env-def - rc: 0 - out: "200\n" - err: "" -- id: test_simple_element_set_idempotency_bool - input: - state: present - key: /apps/gnome_settings_daemon/screensaver/start_screensaver - value: false - value_type: bool - output: - new_value: 'false' - changed: false - version: "3.2.4" - mocks: - run_command: - - command: [/testbin/gconftool-2, --version] - environ: *env-def - rc: 0 - out: "3.2.4\n" - err: "" - - command: [/testbin/gconftool-2, --get, /apps/gnome_settings_daemon/screensaver/start_screensaver] - environ: *env-def - rc: 0 - out: "false\n" - err: "" - - command: [/testbin/gconftool-2, --type, bool, --set, /apps/gnome_settings_daemon/screensaver/start_screensaver, "False"] - environ: *env-def - rc: 0 - out: "" - err: "" - - command: [/testbin/gconftool-2, --get, /apps/gnome_settings_daemon/screensaver/start_screensaver] - environ: *env-def - rc: 0 - out: "false\n" - err: "" -- id: test_simple_element_unset - input: - state: absent - key: /desktop/gnome/background/picture_filename - output: - new_value: - changed: true - mocks: - run_command: - - command: [/testbin/gconftool-2, --version] - environ: *env-def - rc: 0 - out: "3.2.4\n" - err: "" - - command: [/testbin/gconftool-2, --get, /desktop/gnome/background/picture_filename] - environ: *env-def - rc: 0 - out: "200\n" - err: "" - - command: [/testbin/gconftool-2, --unset, /desktop/gnome/background/picture_filename] - environ: *env-def - rc: 0 - out: "" - err: "" -- id: test_simple_element_unset_idempotency - input: - state: absent - key: /apps/gnome_settings_daemon/screensaver/start_screensaver - output: - new_value: - changed: false - mocks: - run_command: - - command: [/testbin/gconftool-2, --version] - environ: *env-def - rc: 0 - out: "3.2.4\n" - err: "" - - command: [/testbin/gconftool-2, --get, /apps/gnome_settings_daemon/screensaver/start_screensaver] - environ: *env-def - rc: 0 - out: "" - err: "" - - command: [/testbin/gconftool-2, --unset, /apps/gnome_settings_daemon/screensaver/start_screensaver] - environ: *env-def - rc: 0 - out: "" - err: "" + - id: test_simple_element_set + input: + state: present + key: /desktop/gnome/background/picture_filename + value: 200 + value_type: int + output: + new_value: '200' + changed: true + version: 3.2.6 + mocks: + run_command: + - command: [/testbin/gconftool-2, --version] + environ: *env-def + rc: 0 + out: "3.2.6\n" + err: '' + - command: [/testbin/gconftool-2, --get, /desktop/gnome/background/picture_filename] + environ: *env-def + rc: 0 + out: "100\n" + err: '' + - command: [/testbin/gconftool-2, --type, int, --set, /desktop/gnome/background/picture_filename, '200'] + environ: *env-def + rc: 0 + out: '' + err: '' + - command: [/testbin/gconftool-2, --get, /desktop/gnome/background/picture_filename] + environ: *env-def + rc: 0 + out: "200\n" + err: '' + - id: test_simple_element_set_idempotency_int + input: + state: present + key: /desktop/gnome/background/picture_filename + value: 200 + value_type: int + output: + new_value: '200' + changed: false + version: 3.2.5 + mocks: + run_command: + - command: [/testbin/gconftool-2, --version] + environ: *env-def + rc: 0 + out: "3.2.5\n" + err: '' + - command: [/testbin/gconftool-2, --get, /desktop/gnome/background/picture_filename] + environ: *env-def + rc: 0 + out: "200\n" + err: '' + - command: [/testbin/gconftool-2, --type, int, --set, /desktop/gnome/background/picture_filename, '200'] + environ: *env-def + rc: 0 + out: '' + err: '' + - command: [/testbin/gconftool-2, --get, /desktop/gnome/background/picture_filename] + environ: *env-def + rc: 0 + out: "200\n" + err: '' + - id: test_simple_element_set_idempotency_bool + input: + state: present + key: /apps/gnome_settings_daemon/screensaver/start_screensaver + value: false + value_type: bool + output: + new_value: 'false' + changed: false + version: 3.2.4 + mocks: + run_command: + - command: [/testbin/gconftool-2, --version] + environ: *env-def + rc: 0 + out: "3.2.4\n" + err: '' + - command: [/testbin/gconftool-2, --get, /apps/gnome_settings_daemon/screensaver/start_screensaver] + environ: *env-def + rc: 0 + out: "false\n" + err: '' + - command: [/testbin/gconftool-2, --type, bool, --set, /apps/gnome_settings_daemon/screensaver/start_screensaver, 'False'] + environ: *env-def + rc: 0 + out: '' + err: '' + - command: [/testbin/gconftool-2, --get, /apps/gnome_settings_daemon/screensaver/start_screensaver] + environ: *env-def + rc: 0 + out: "false\n" + err: '' + - id: test_simple_element_unset + input: + state: absent + key: /desktop/gnome/background/picture_filename + output: + new_value: + changed: true + mocks: + run_command: + - command: [/testbin/gconftool-2, --version] + environ: *env-def + rc: 0 + out: "3.2.4\n" + err: '' + - command: [/testbin/gconftool-2, --get, /desktop/gnome/background/picture_filename] + environ: *env-def + rc: 0 + out: "200\n" + err: '' + - command: [/testbin/gconftool-2, --unset, /desktop/gnome/background/picture_filename] + environ: *env-def + rc: 0 + out: '' + err: '' + - id: test_simple_element_unset_idempotency + input: + state: absent + key: /apps/gnome_settings_daemon/screensaver/start_screensaver + output: + new_value: + changed: false + mocks: + run_command: + - command: [/testbin/gconftool-2, --version] + environ: *env-def + rc: 0 + out: "3.2.4\n" + err: '' + - command: [/testbin/gconftool-2, --get, /apps/gnome_settings_daemon/screensaver/start_screensaver] + environ: *env-def + rc: 0 + out: '' + err: '' + - command: [/testbin/gconftool-2, --unset, /apps/gnome_settings_daemon/screensaver/start_screensaver] + environ: *env-def + rc: 0 + out: '' + err: '' diff --git a/tests/unit/plugins/modules/test_gconftool2_info.yaml b/tests/unit/plugins/modules/test_gconftool2_info.yaml index 269f0b4ea2e..141b473e35c 100644 --- a/tests/unit/plugins/modules/test_gconftool2_info.yaml +++ b/tests/unit/plugins/modules/test_gconftool2_info.yaml @@ -7,37 +7,37 @@ anchors: environ: &env-def {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true} test_cases: -- id: test_simple_element_get - input: - key: /desktop/gnome/background/picture_filename - output: - value: '100' - mocks: - run_command: - - command: [/testbin/gconftool-2, --version] - environ: *env-def - rc: 0 - out: "3.2.6\n" - err: "" - - command: [/testbin/gconftool-2, --get, /desktop/gnome/background/picture_filename] - environ: *env-def - rc: 0 - out: "100\n" - err: "" -- id: test_simple_element_get_not_found - input: - key: /desktop/gnome/background/picture_filename - output: - value: - mocks: - run_command: - - command: [/testbin/gconftool-2, --version] - environ: *env-def - rc: 0 - out: "3.2.6\n" - err: "" - - command: [/testbin/gconftool-2, --get, /desktop/gnome/background/picture_filename] - environ: *env-def - rc: 0 - out: "" - err: "No value set for `/desktop/gnome/background/picture_filename'\n" + - id: test_simple_element_get + input: + key: /desktop/gnome/background/picture_filename + output: + value: '100' + mocks: + run_command: + - command: [/testbin/gconftool-2, --version] + environ: *env-def + rc: 0 + out: "3.2.6\n" + err: '' + - command: [/testbin/gconftool-2, --get, /desktop/gnome/background/picture_filename] + environ: *env-def + rc: 0 + out: "100\n" + err: '' + - id: test_simple_element_get_not_found + input: + key: /desktop/gnome/background/picture_filename + output: + value: + mocks: + run_command: + - command: [/testbin/gconftool-2, --version] + environ: *env-def + rc: 0 + out: "3.2.6\n" + err: '' + - command: [/testbin/gconftool-2, --get, /desktop/gnome/background/picture_filename] + environ: *env-def + rc: 0 + out: '' + err: "No value set for `/desktop/gnome/background/picture_filename'\n" diff --git a/tests/unit/plugins/modules/test_gio_mime.yaml b/tests/unit/plugins/modules/test_gio_mime.yaml index c1a3c5def5a..6ed5af5d497 100644 --- a/tests/unit/plugins/modules/test_gio_mime.yaml +++ b/tests/unit/plugins/modules/test_gio_mime.yaml @@ -7,85 +7,85 @@ anchors: environ: &env-def {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true} test_cases: -- id: test_set_handler - input: - handler: google-chrome.desktop - mime_type: x-scheme-handler/http - output: - handler: google-chrome.desktop - changed: true - mocks: - run_command: - - command: [/testbin/gio, --version] - environ: *env-def - rc: 0 - out: "2.80.0\n" - err: "" - - command: [/testbin/gio, mime, x-scheme-handler/http] - environ: *env-def - rc: 0 - out: "" - err: > - No default applications for “x-scheme-handler/http” - - command: [/testbin/gio, mime, x-scheme-handler/http, google-chrome.desktop] - environ: *env-def - rc: 0 - out: "Set google-chrome.desktop as the default for x-scheme-handler/http\n" - err: "" -- id: test_set_handler_check - input: - handler: google-chrome.desktop - mime_type: x-scheme-handler/http - output: - handler: google-chrome.desktop - changed: true - flags: - skip: test helper does not support check mode yet - mocks: - run_command: - - command: [/testbin/gio, --version] - environ: *env-def - rc: 0 - out: "2.80.0\n" - err: "" - - command: [/testbin/gio, mime, x-scheme-handler/http] - environ: *env-def - rc: 0 - out: "" - err: > - No default applications for “x-scheme-handler/http” - - command: [/testbin/gio, mime, x-scheme-handler/http, google-chrome.desktop] - environ: *env-def - rc: 0 - out: "Set google-chrome.desktop as the default for x-scheme-handler/http\n" - err: "" -- id: test_set_handler_idempot - input: - handler: google-chrome.desktop - mime_type: x-scheme-handler/http - output: - handler: google-chrome.desktop - changed: false - mocks: - run_command: - - command: [/testbin/gio, --version] - environ: *env-def - rc: 0 - out: "2.80.0\n" - err: "" - - command: [/testbin/gio, mime, x-scheme-handler/http] - environ: *env-def - rc: 0 - out: | - Default application for “x-scheme-handler/https”: google-chrome.desktop - Registered applications: - brave-browser.desktop - firefox.desktop - google-chrome.desktop - firefox_firefox.desktop - Recommended applications: - brave-browser.desktop - firefox.desktop - google-chrome.desktop - firefox_firefox.desktop - err: "" + - id: test_set_handler + input: + handler: google-chrome.desktop + mime_type: x-scheme-handler/http + output: + handler: google-chrome.desktop + changed: true + mocks: + run_command: + - command: [/testbin/gio, --version] + environ: *env-def + rc: 0 + out: "2.80.0\n" + err: '' + - command: [/testbin/gio, mime, x-scheme-handler/http] + environ: *env-def + rc: 0 + out: '' + err: > + No default applications for “x-scheme-handler/http” + - command: [/testbin/gio, mime, x-scheme-handler/http, google-chrome.desktop] + environ: *env-def + rc: 0 + out: "Set google-chrome.desktop as the default for x-scheme-handler/http\n" + err: '' + - id: test_set_handler_check + input: + handler: google-chrome.desktop + mime_type: x-scheme-handler/http + output: + handler: google-chrome.desktop + changed: true + flags: + skip: test helper does not support check mode yet + mocks: + run_command: + - command: [/testbin/gio, --version] + environ: *env-def + rc: 0 + out: "2.80.0\n" + err: '' + - command: [/testbin/gio, mime, x-scheme-handler/http] + environ: *env-def + rc: 0 + out: '' + err: > + No default applications for “x-scheme-handler/http” + - command: [/testbin/gio, mime, x-scheme-handler/http, google-chrome.desktop] + environ: *env-def + rc: 0 + out: "Set google-chrome.desktop as the default for x-scheme-handler/http\n" + err: '' + - id: test_set_handler_idempot + input: + handler: google-chrome.desktop + mime_type: x-scheme-handler/http + output: + handler: google-chrome.desktop + changed: false + mocks: + run_command: + - command: [/testbin/gio, --version] + environ: *env-def + rc: 0 + out: "2.80.0\n" + err: '' + - command: [/testbin/gio, mime, x-scheme-handler/http] + environ: *env-def + rc: 0 + out: | + Default application for “x-scheme-handler/https”: google-chrome.desktop + Registered applications: + brave-browser.desktop + firefox.desktop + google-chrome.desktop + firefox_firefox.desktop + Recommended applications: + brave-browser.desktop + firefox.desktop + google-chrome.desktop + firefox_firefox.desktop + err: '' diff --git a/tests/unit/plugins/modules/test_krb_ticket.yaml b/tests/unit/plugins/modules/test_krb_ticket.yaml index cfc9e212cbe..d1b6d67f57f 100644 --- a/tests/unit/plugins/modules/test_krb_ticket.yaml +++ b/tests/unit/plugins/modules/test_krb_ticket.yaml @@ -9,106 +9,106 @@ anchors: environ_data: &env-data {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true, data: cool_password} environ_norc: &env-norc {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true} test_cases: -- id: test_kinit_default - input: - state: present - password: cool_password - output: - changed: true - mocks: - run_command: - - command: [/testbin/klist] - environ: *env-def - rc: 1 - out: "" - err: "" - - command: [/testbin/kinit] - environ: *env-data - rc: 0 - out: "" - err: "" -- id: test_kinit_principal - input: - state: present - password: cool_password - principal: admin@IPA.TEST - output: - changed: true - mocks: - run_command: - - command: [/testbin/klist, -l] - environ: *env-def - rc: 0 - out: "" - err: "" - - command: [/testbin/kinit, admin@IPA.TEST] - environ: *env-data - rc: 0 - out: "" - err: "" -- id: test_kdestroy_default - input: - state: absent - output: - changed: true - mocks: - run_command: - - command: [/testbin/klist] - environ: *env-def - rc: 0 - out: "" - err: "" - - command: [/testbin/kdestroy] - environ: *env-norc - rc: 0 - out: "" - err: "" -- id: test_kdestroy_principal - input: - state: absent - principal: admin@IPA.TEST - output: - changed: true - mocks: - run_command: - - command: [/testbin/klist, -l] - environ: *env-def - rc: 0 - out: "admin@IPA.TEST" - err: "" - - command: [/testbin/kdestroy, -p, admin@IPA.TEST] - environ: *env-norc - rc: 0 - out: "" - err: "" -- id: test_kdestroy_cache_name - input: - state: absent - cache_name: KEYRING:persistent:0:0 - output: - changed: true - mocks: - run_command: - - command: [/testbin/klist, -l] - environ: *env-def - rc: 0 - out: "KEYRING:persistent:0:0" - err: "" - - command: [/testbin/kdestroy, -c, KEYRING:persistent:0:0] - environ: *env-norc - rc: 0 - out: "" - err: "" -- id: test_kdestroy_all - input: - state: absent - kdestroy_all: true - output: - changed: true - mocks: - run_command: - - command: [/testbin/kdestroy, -A] - environ: *env-norc - rc: 0 - out: "" - err: "" + - id: test_kinit_default + input: + state: present + password: cool_password + output: + changed: true + mocks: + run_command: + - command: [/testbin/klist] + environ: *env-def + rc: 1 + out: '' + err: '' + - command: [/testbin/kinit] + environ: *env-data + rc: 0 + out: '' + err: '' + - id: test_kinit_principal + input: + state: present + password: cool_password + principal: admin@IPA.TEST + output: + changed: true + mocks: + run_command: + - command: [/testbin/klist, -l] + environ: *env-def + rc: 0 + out: '' + err: '' + - command: [/testbin/kinit, admin@IPA.TEST] + environ: *env-data + rc: 0 + out: '' + err: '' + - id: test_kdestroy_default + input: + state: absent + output: + changed: true + mocks: + run_command: + - command: [/testbin/klist] + environ: *env-def + rc: 0 + out: '' + err: '' + - command: [/testbin/kdestroy] + environ: *env-norc + rc: 0 + out: '' + err: '' + - id: test_kdestroy_principal + input: + state: absent + principal: admin@IPA.TEST + output: + changed: true + mocks: + run_command: + - command: [/testbin/klist, -l] + environ: *env-def + rc: 0 + out: admin@IPA.TEST + err: '' + - command: [/testbin/kdestroy, -p, admin@IPA.TEST] + environ: *env-norc + rc: 0 + out: '' + err: '' + - id: test_kdestroy_cache_name + input: + state: absent + cache_name: KEYRING:persistent:0:0 + output: + changed: true + mocks: + run_command: + - command: [/testbin/klist, -l] + environ: *env-def + rc: 0 + out: KEYRING:persistent:0:0 + err: '' + - command: [/testbin/kdestroy, -c, KEYRING:persistent:0:0] + environ: *env-norc + rc: 0 + out: '' + err: '' + - id: test_kdestroy_all + input: + state: absent + kdestroy_all: true + output: + changed: true + mocks: + run_command: + - command: [/testbin/kdestroy, -A] + environ: *env-norc + rc: 0 + out: '' + err: '' diff --git a/tests/unit/plugins/modules/test_opkg.yaml b/tests/unit/plugins/modules/test_opkg.yaml index e6f627457d7..a437e544998 100644 --- a/tests/unit/plugins/modules/test_opkg.yaml +++ b/tests/unit/plugins/modules/test_opkg.yaml @@ -7,169 +7,169 @@ anchors: environ: &env-def {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: false} test_cases: -- id: install_zlibdev - input: - name: zlib-dev - state: present - output: - msg: installed 1 package(s) - mocks: - run_command: - - command: [/testbin/opkg, --version] - environ: *env-def - rc: 0 - out: "" - err: "" - - command: [/testbin/opkg, list-installed, zlib-dev] - environ: *env-def - rc: 0 - out: "" - err: "" - - command: [/testbin/opkg, install, zlib-dev] - environ: *env-def - rc: 0 - out: | - Installing zlib-dev (1.2.11-6) to root... - Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib-dev_1.2.11-6_mips_24kc.ipk - Installing zlib (1.2.11-6) to root... - Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib_1.2.11-6_mips_24kc.ipk - Configuring zlib. - Configuring zlib-dev. - err: "" - - command: [/testbin/opkg, list-installed, zlib-dev] - environ: *env-def - rc: 0 - out: | - zlib-dev - 1.2.11-6 - err: "" -- id: install_zlibdev_present - input: - name: zlib-dev - state: present - output: - msg: package(s) already present - mocks: - run_command: - - command: [/testbin/opkg, --version] - environ: *env-def - rc: 0 - out: "" - err: "" - - command: [/testbin/opkg, list-installed, zlib-dev] - environ: *env-def - rc: 0 - out: | - zlib-dev - 1.2.11-6 - err: "" -- id: install_zlibdev_force_reinstall - input: - name: zlib-dev - state: present - force: reinstall - output: - msg: installed 1 package(s) - mocks: - run_command: - - command: [/testbin/opkg, --version] - environ: *env-def - rc: 0 - out: "" - err: "" - - command: [/testbin/opkg, list-installed, zlib-dev] - environ: *env-def - rc: 0 - out: | - zlib-dev - 1.2.11-6 - err: "" - - command: [/testbin/opkg, install, --force-reinstall, zlib-dev] - environ: *env-def - rc: 0 - out: | - Installing zlib-dev (1.2.11-6) to root... - Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib-dev_1.2.11-6_mips_24kc.ipk - Configuring zlib-dev. - err: "" - - command: [/testbin/opkg, list-installed, zlib-dev] - environ: *env-def - rc: 0 - out: | - zlib-dev - 1.2.11-6 - err: "" -- id: install_zlibdev_with_version - input: - name: zlib-dev=1.2.11-6 - state: present - output: - msg: installed 1 package(s) - mocks: - run_command: - - command: [/testbin/opkg, --version] - environ: *env-def - rc: 0 - out: "" - err: "" - - command: [/testbin/opkg, list-installed, zlib-dev] - environ: *env-def - rc: 0 - out: "" - err: "" - - command: [/testbin/opkg, install, zlib-dev=1.2.11-6] - environ: *env-def - rc: 0 - out: | - Installing zlib-dev (1.2.11-6) to root... - Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib-dev_1.2.11-6_mips_24kc.ipk - Installing zlib (1.2.11-6) to root... - Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib_1.2.11-6_mips_24kc.ipk - Configuring zlib. - Configuring zlib-dev. - err: "" - - command: [/testbin/opkg, list-installed, zlib-dev] - environ: *env-def - rc: 0 - out: "zlib-dev - 1.2.11-6 \n" # This output has the extra space at the end, to satisfy the behaviour of Yocto/OpenEmbedded's opkg - err: "" -- id: install_vim_updatecache - input: - name: vim-fuller - state: present - update_cache: true - output: - msg: installed 1 package(s) - mocks: - run_command: - - command: [/testbin/opkg, --version] - environ: *env-def - rc: 0 - out: "" - err: "" - - command: [/testbin/opkg, update] - environ: *env-def - rc: 0 - out: "" - err: "" - - command: [/testbin/opkg, list-installed, vim-fuller] - environ: *env-def - rc: 0 - out: "" - err: "" - - command: [/testbin/opkg, install, vim-fuller] - environ: *env-def - rc: 0 - out: | - Multiple packages (libgcc1 and libgcc1) providing same name marked HOLD or PREFER. Using latest. - Installing vim-fuller (9.0-1) to root... - Downloading https://downloads.openwrt.org/snapshots/packages/x86_64/packages/vim-fuller_9.0-1_x86_64.ipk - Installing terminfo (6.4-2) to root... - Downloading https://downloads.openwrt.org/snapshots/packages/x86_64/base/terminfo_6.4-2_x86_64.ipk - Installing libncurses6 (6.4-2) to root... - Downloading https://downloads.openwrt.org/snapshots/packages/x86_64/base/libncurses6_6.4-2_x86_64.ipk - Configuring terminfo. - Configuring libncurses6. - Configuring vim-fuller. - err: "" - - command: [/testbin/opkg, list-installed, vim-fuller] - environ: *env-def - rc: 0 - out: "vim-fuller - 9.0-1 \n" # This output has the extra space at the end, to satisfy the behaviour of Yocto/OpenEmbedded's opkg - err: "" + - id: install_zlibdev + input: + name: zlib-dev + state: present + output: + msg: installed 1 package(s) + mocks: + run_command: + - command: [/testbin/opkg, --version] + environ: *env-def + rc: 0 + out: '' + err: '' + - command: [/testbin/opkg, list-installed, zlib-dev] + environ: *env-def + rc: 0 + out: '' + err: '' + - command: [/testbin/opkg, install, zlib-dev] + environ: *env-def + rc: 0 + out: | + Installing zlib-dev (1.2.11-6) to root... + Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib-dev_1.2.11-6_mips_24kc.ipk + Installing zlib (1.2.11-6) to root... + Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib_1.2.11-6_mips_24kc.ipk + Configuring zlib. + Configuring zlib-dev. + err: '' + - command: [/testbin/opkg, list-installed, zlib-dev] + environ: *env-def + rc: 0 + out: | + zlib-dev - 1.2.11-6 + err: '' + - id: install_zlibdev_present + input: + name: zlib-dev + state: present + output: + msg: package(s) already present + mocks: + run_command: + - command: [/testbin/opkg, --version] + environ: *env-def + rc: 0 + out: '' + err: '' + - command: [/testbin/opkg, list-installed, zlib-dev] + environ: *env-def + rc: 0 + out: | + zlib-dev - 1.2.11-6 + err: '' + - id: install_zlibdev_force_reinstall + input: + name: zlib-dev + state: present + force: reinstall + output: + msg: installed 1 package(s) + mocks: + run_command: + - command: [/testbin/opkg, --version] + environ: *env-def + rc: 0 + out: '' + err: '' + - command: [/testbin/opkg, list-installed, zlib-dev] + environ: *env-def + rc: 0 + out: | + zlib-dev - 1.2.11-6 + err: '' + - command: [/testbin/opkg, install, --force-reinstall, zlib-dev] + environ: *env-def + rc: 0 + out: | + Installing zlib-dev (1.2.11-6) to root... + Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib-dev_1.2.11-6_mips_24kc.ipk + Configuring zlib-dev. + err: '' + - command: [/testbin/opkg, list-installed, zlib-dev] + environ: *env-def + rc: 0 + out: | + zlib-dev - 1.2.11-6 + err: '' + - id: install_zlibdev_with_version + input: + name: zlib-dev=1.2.11-6 + state: present + output: + msg: installed 1 package(s) + mocks: + run_command: + - command: [/testbin/opkg, --version] + environ: *env-def + rc: 0 + out: '' + err: '' + - command: [/testbin/opkg, list-installed, zlib-dev] + environ: *env-def + rc: 0 + out: '' + err: '' + - command: [/testbin/opkg, install, zlib-dev=1.2.11-6] + environ: *env-def + rc: 0 + out: | + Installing zlib-dev (1.2.11-6) to root... + Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib-dev_1.2.11-6_mips_24kc.ipk + Installing zlib (1.2.11-6) to root... + Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib_1.2.11-6_mips_24kc.ipk + Configuring zlib. + Configuring zlib-dev. + err: '' + - command: [/testbin/opkg, list-installed, zlib-dev] + environ: *env-def + rc: 0 + out: "zlib-dev - 1.2.11-6 \n" # This output has the extra space at the end, to satisfy the behaviour of Yocto/OpenEmbedded's opkg + err: '' + - id: install_vim_updatecache + input: + name: vim-fuller + state: present + update_cache: true + output: + msg: installed 1 package(s) + mocks: + run_command: + - command: [/testbin/opkg, --version] + environ: *env-def + rc: 0 + out: '' + err: '' + - command: [/testbin/opkg, update] + environ: *env-def + rc: 0 + out: '' + err: '' + - command: [/testbin/opkg, list-installed, vim-fuller] + environ: *env-def + rc: 0 + out: '' + err: '' + - command: [/testbin/opkg, install, vim-fuller] + environ: *env-def + rc: 0 + out: | + Multiple packages (libgcc1 and libgcc1) providing same name marked HOLD or PREFER. Using latest. + Installing vim-fuller (9.0-1) to root... + Downloading https://downloads.openwrt.org/snapshots/packages/x86_64/packages/vim-fuller_9.0-1_x86_64.ipk + Installing terminfo (6.4-2) to root... + Downloading https://downloads.openwrt.org/snapshots/packages/x86_64/base/terminfo_6.4-2_x86_64.ipk + Installing libncurses6 (6.4-2) to root... + Downloading https://downloads.openwrt.org/snapshots/packages/x86_64/base/libncurses6_6.4-2_x86_64.ipk + Configuring terminfo. + Configuring libncurses6. + Configuring vim-fuller. + err: '' + - command: [/testbin/opkg, list-installed, vim-fuller] + environ: *env-def + rc: 0 + out: "vim-fuller - 9.0-1 \n" # This output has the extra space at the end, to satisfy the behaviour of Yocto/OpenEmbedded's opkg + err: '' diff --git a/tests/unit/plugins/modules/test_puppet.yaml b/tests/unit/plugins/modules/test_puppet.yaml index 44cfb98d6f2..df813c6231b 100644 --- a/tests/unit/plugins/modules/test_puppet.yaml +++ b/tests/unit/plugins/modules/test_puppet.yaml @@ -7,228 +7,228 @@ anchors: environ: &env-def {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: false} test_cases: -- id: puppet_agent_plain - input: {} - output: - changed: false - mocks: - run_command: - - command: [/testbin/puppet, config, print, agent_disabled_lockfile] - environ: *env-def - rc: 0 - out: "blah, anything" - err: "" - - command: - - /testbin/timeout - - -s - - "9" - - 30m - - /testbin/puppet - - agent - - --onetime - - --no-daemonize - - --no-usecacheonfailure - - --no-splay - - --detailed-exitcodes - - --verbose - - --color - - "0" - environ: *env-def - rc: 0 - out: "" - err: "" -- id: puppet_agent_certname - input: - certname: potatobox - output: - changed: false - mocks: - run_command: - - command: [/testbin/puppet, config, print, agent_disabled_lockfile] - environ: *env-def - rc: 0 - out: "blah, anything" - err: "" - - command: - - /testbin/timeout - - -s - - "9" - - 30m - - /testbin/puppet - - agent - - --onetime - - --no-daemonize - - --no-usecacheonfailure - - --no-splay - - --detailed-exitcodes - - --verbose - - --color - - "0" - - --certname=potatobox - environ: *env-def - rc: 0 - out: "" - err: "" -- id: puppet_agent_tags_abc - input: - tags: [a, b, c] - output: - changed: false - mocks: - run_command: - - command: [/testbin/puppet, config, print, agent_disabled_lockfile] - environ: *env-def - rc: 0 - out: "blah, anything" - err: "" - - command: - - /testbin/timeout - - -s - - "9" - - 30m - - /testbin/puppet - - agent - - --onetime - - --no-daemonize - - --no-usecacheonfailure - - --no-splay - - --detailed-exitcodes - - --verbose - - --color - - "0" - - --tags - - a,b,c - environ: *env-def - rc: 0 - out: "" - err: "" -- id: puppet_agent_skip_tags_def - input: - skip_tags: [d, e, f] - output: - changed: false - mocks: - run_command: - - command: [/testbin/puppet, config, print, agent_disabled_lockfile] - environ: *env-def - rc: 0 - out: "blah, anything" - err: "" - - command: - - /testbin/timeout - - -s - - "9" - - 30m - - /testbin/puppet - - agent - - --onetime - - --no-daemonize - - --no-usecacheonfailure - - --no-splay - - --detailed-exitcodes - - --verbose - - --color - - "0" - - --skip_tags - - d,e,f - environ: *env-def - rc: 0 - out: "" - err: "" -- id: puppet_agent_noop_false - input: - noop: false - output: - changed: false - mocks: - run_command: - - command: [/testbin/puppet, config, print, agent_disabled_lockfile] - environ: *env-def - rc: 0 - out: "blah, anything" - err: "" - - command: - - /testbin/timeout - - -s - - "9" - - 30m - - /testbin/puppet - - agent - - --onetime - - --no-daemonize - - --no-usecacheonfailure - - --no-splay - - --detailed-exitcodes - - --verbose - - --color - - "0" - - --no-noop - environ: *env-def - rc: 0 - out: "" - err: "" -- id: puppet_agent_noop_true - input: - noop: true - output: - changed: false - mocks: - run_command: - - command: [/testbin/puppet, config, print, agent_disabled_lockfile] - environ: *env-def - rc: 0 - out: "blah, anything" - err: "" - - command: - - /testbin/timeout - - -s - - "9" - - 30m - - /testbin/puppet - - agent - - --onetime - - --no-daemonize - - --no-usecacheonfailure - - --no-splay - - --detailed-exitcodes - - --verbose - - --color - - "0" - - --noop - environ: *env-def - rc: 0 - out: "" - err: "" -- id: puppet_agent_waitforlock - input: - waitforlock: 30 - output: - changed: false - mocks: - run_command: - - command: [/testbin/puppet, config, print, agent_disabled_lockfile] - environ: *env-def - rc: 0 - out: "blah, anything" - err: "" - - command: - - /testbin/timeout - - -s - - "9" - - 30m - - /testbin/puppet - - agent - - --onetime - - --no-daemonize - - --no-usecacheonfailure - - --no-splay - - --detailed-exitcodes - - --verbose - - --color - - "0" - - --waitforlock - - "30" - environ: *env-def - rc: 0 - out: "" - err: "" + - id: puppet_agent_plain + input: {} + output: + changed: false + mocks: + run_command: + - command: [/testbin/puppet, config, print, agent_disabled_lockfile] + environ: *env-def + rc: 0 + out: blah, anything + err: '' + - command: + - /testbin/timeout + - -s + - '9' + - 30m + - /testbin/puppet + - agent + - --onetime + - --no-daemonize + - --no-usecacheonfailure + - --no-splay + - --detailed-exitcodes + - --verbose + - --color + - '0' + environ: *env-def + rc: 0 + out: '' + err: '' + - id: puppet_agent_certname + input: + certname: potatobox + output: + changed: false + mocks: + run_command: + - command: [/testbin/puppet, config, print, agent_disabled_lockfile] + environ: *env-def + rc: 0 + out: blah, anything + err: '' + - command: + - /testbin/timeout + - -s + - '9' + - 30m + - /testbin/puppet + - agent + - --onetime + - --no-daemonize + - --no-usecacheonfailure + - --no-splay + - --detailed-exitcodes + - --verbose + - --color + - '0' + - --certname=potatobox + environ: *env-def + rc: 0 + out: '' + err: '' + - id: puppet_agent_tags_abc + input: + tags: [a, b, c] + output: + changed: false + mocks: + run_command: + - command: [/testbin/puppet, config, print, agent_disabled_lockfile] + environ: *env-def + rc: 0 + out: blah, anything + err: '' + - command: + - /testbin/timeout + - -s + - '9' + - 30m + - /testbin/puppet + - agent + - --onetime + - --no-daemonize + - --no-usecacheonfailure + - --no-splay + - --detailed-exitcodes + - --verbose + - --color + - '0' + - --tags + - a,b,c + environ: *env-def + rc: 0 + out: '' + err: '' + - id: puppet_agent_skip_tags_def + input: + skip_tags: [d, e, f] + output: + changed: false + mocks: + run_command: + - command: [/testbin/puppet, config, print, agent_disabled_lockfile] + environ: *env-def + rc: 0 + out: blah, anything + err: '' + - command: + - /testbin/timeout + - -s + - '9' + - 30m + - /testbin/puppet + - agent + - --onetime + - --no-daemonize + - --no-usecacheonfailure + - --no-splay + - --detailed-exitcodes + - --verbose + - --color + - '0' + - --skip_tags + - d,e,f + environ: *env-def + rc: 0 + out: '' + err: '' + - id: puppet_agent_noop_false + input: + noop: false + output: + changed: false + mocks: + run_command: + - command: [/testbin/puppet, config, print, agent_disabled_lockfile] + environ: *env-def + rc: 0 + out: blah, anything + err: '' + - command: + - /testbin/timeout + - -s + - '9' + - 30m + - /testbin/puppet + - agent + - --onetime + - --no-daemonize + - --no-usecacheonfailure + - --no-splay + - --detailed-exitcodes + - --verbose + - --color + - '0' + - --no-noop + environ: *env-def + rc: 0 + out: '' + err: '' + - id: puppet_agent_noop_true + input: + noop: true + output: + changed: false + mocks: + run_command: + - command: [/testbin/puppet, config, print, agent_disabled_lockfile] + environ: *env-def + rc: 0 + out: blah, anything + err: '' + - command: + - /testbin/timeout + - -s + - '9' + - 30m + - /testbin/puppet + - agent + - --onetime + - --no-daemonize + - --no-usecacheonfailure + - --no-splay + - --detailed-exitcodes + - --verbose + - --color + - '0' + - --noop + environ: *env-def + rc: 0 + out: '' + err: '' + - id: puppet_agent_waitforlock + input: + waitforlock: 30 + output: + changed: false + mocks: + run_command: + - command: [/testbin/puppet, config, print, agent_disabled_lockfile] + environ: *env-def + rc: 0 + out: blah, anything + err: '' + - command: + - /testbin/timeout + - -s + - '9' + - 30m + - /testbin/puppet + - agent + - --onetime + - --no-daemonize + - --no-usecacheonfailure + - --no-splay + - --detailed-exitcodes + - --verbose + - --color + - '0' + - --waitforlock + - '30' + environ: *env-def + rc: 0 + out: '' + err: '' diff --git a/tests/unit/plugins/modules/test_xfconf.yaml b/tests/unit/plugins/modules/test_xfconf.yaml index f306bfdfa06..2ba274fdfb2 100644 --- a/tests/unit/plugins/modules/test_xfconf.yaml +++ b/tests/unit/plugins/modules/test_xfconf.yaml @@ -14,224 +14,224 @@ anchors: Please report bugs to . test_cases: -- id: test_missing_input - input: {} - output: - failed: true - msg: "missing required arguments: channel, property" -- id: test_property_set_property - input: - channel: xfwm4 - property: /general/inactive_opacity - state: present - value_type: int - value: 90 - output: - changed: true - previous_value: '100' - type: int - value: '90' - version: "4.18.1" - mocks: - run_command: - - command: [/testbin/xfconf-query, --version] - environ: *env-def - rc: 0 - out: *version-output - err: "" - - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/inactive_opacity] - environ: *env-def - rc: 0 - out: "100\n" - err: "" - - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/inactive_opacity, --create, --type, int, --set, '90'] - environ: *env-def - rc: 0 - out: "" - err: "" -- id: test_property_set_property_same_value - input: - channel: xfwm4 - property: /general/inactive_opacity - state: present - value_type: int - value: 90 - output: - changed: false - previous_value: '90' - type: int - value: '90' - version: "4.18.1" - mocks: - run_command: - - command: [/testbin/xfconf-query, --version] - environ: *env-def - rc: 0 - out: *version-output - err: "" - - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/inactive_opacity] - environ: *env-def - rc: 0 - out: "90\n" - err: "" - - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/inactive_opacity, --create, --type, int, --set, '90'] - environ: *env-def - rc: 0 - out: "" - err: "" -- id: test_property_set_property_bool_false - input: - channel: xfce4-session - property: /general/SaveOnExit - state: present - value_type: bool - value: false - output: - changed: true - previous_value: 'true' - type: bool - value: 'False' - version: "4.18.1" - mocks: - run_command: - - command: [/testbin/xfconf-query, --version] - environ: *env-def - rc: 0 - out: *version-output - err: "" - - command: [/testbin/xfconf-query, --channel, xfce4-session, --property, /general/SaveOnExit] - environ: *env-def - rc: 0 - out: "true\n" - err: "" - - command: [/testbin/xfconf-query, --channel, xfce4-session, --property, /general/SaveOnExit, --create, --type, bool, --set, 'false'] - environ: *env-def - rc: 0 - out: "false\n" - err: "" -- id: test_property_set_array - input: - channel: xfwm4 - property: /general/workspace_names - state: present - value_type: string - value: [A, B, C] - output: - changed: true - previous_value: [Main, Work, Tmp] - type: [string, string, string] - value: [A, B, C] - version: "4.18.1" - mocks: - run_command: - - command: [/testbin/xfconf-query, --version] - environ: *env-def - rc: 0 - out: *version-output - err: "" - - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names] - environ: *env-def - rc: 0 - out: "Value is an array with 3 items:\n\nMain\nWork\nTmp\n" - err: "" - - command: - - /testbin/xfconf-query - - --channel - - xfwm4 - - --property - - /general/workspace_names - - --create - - --force-array - - --type - - string - - --set - - A - - --type - - string - - --set - - B - - --type - - string - - --set - - C - environ: *env-def - rc: 0 - out: "" - err: "" -- id: test_property_set_array_to_same_value - input: - channel: xfwm4 - property: /general/workspace_names - state: present - value_type: string - value: [A, B, C] - output: - changed: false - previous_value: [A, B, C] - type: [string, string, string] - value: [A, B, C] - version: "4.18.1" - mocks: - run_command: - - command: [/testbin/xfconf-query, --version] - environ: *env-def - rc: 0 - out: *version-output - err: "" - - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names] - environ: *env-def - rc: 0 - out: "Value is an array with 3 items:\n\nA\nB\nC\n" - err: "" - - command: - - /testbin/xfconf-query - - --channel - - xfwm4 - - --property - - /general/workspace_names - - --create - - --force-array - - --type - - string - - --set - - A - - --type - - string - - --set - - B - - --type - - string - - --set - - C - environ: *env-def - rc: 0 - out: "" - err: "" -- id: test_property_reset_value - input: - channel: xfwm4 - property: /general/workspace_names - state: absent - output: - changed: true - previous_value: [A, B, C] - type: - value: - version: "4.18.1" - mocks: - run_command: - - command: [/testbin/xfconf-query, --version] - environ: *env-def - rc: 0 - out: *version-output - err: "" - - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names] - environ: *env-def - rc: 0 - out: "Value is an array with 3 items:\n\nA\nB\nC\n" - err: "" - - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names, --reset] - environ: *env-def - rc: 0 - out: "" - err: "" + - id: test_missing_input + input: {} + output: + failed: true + msg: 'missing required arguments: channel, property' + - id: test_property_set_property + input: + channel: xfwm4 + property: /general/inactive_opacity + state: present + value_type: int + value: 90 + output: + changed: true + previous_value: '100' + type: int + value: '90' + version: 4.18.1 + mocks: + run_command: + - command: [/testbin/xfconf-query, --version] + environ: *env-def + rc: 0 + out: *version-output + err: '' + - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/inactive_opacity] + environ: *env-def + rc: 0 + out: "100\n" + err: '' + - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/inactive_opacity, --create, --type, int, --set, '90'] + environ: *env-def + rc: 0 + out: '' + err: '' + - id: test_property_set_property_same_value + input: + channel: xfwm4 + property: /general/inactive_opacity + state: present + value_type: int + value: 90 + output: + changed: false + previous_value: '90' + type: int + value: '90' + version: 4.18.1 + mocks: + run_command: + - command: [/testbin/xfconf-query, --version] + environ: *env-def + rc: 0 + out: *version-output + err: '' + - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/inactive_opacity] + environ: *env-def + rc: 0 + out: "90\n" + err: '' + - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/inactive_opacity, --create, --type, int, --set, '90'] + environ: *env-def + rc: 0 + out: '' + err: '' + - id: test_property_set_property_bool_false + input: + channel: xfce4-session + property: /general/SaveOnExit + state: present + value_type: bool + value: false + output: + changed: true + previous_value: 'true' + type: bool + value: 'False' + version: 4.18.1 + mocks: + run_command: + - command: [/testbin/xfconf-query, --version] + environ: *env-def + rc: 0 + out: *version-output + err: '' + - command: [/testbin/xfconf-query, --channel, xfce4-session, --property, /general/SaveOnExit] + environ: *env-def + rc: 0 + out: "true\n" + err: '' + - command: [/testbin/xfconf-query, --channel, xfce4-session, --property, /general/SaveOnExit, --create, --type, bool, --set, 'false'] + environ: *env-def + rc: 0 + out: "false\n" + err: '' + - id: test_property_set_array + input: + channel: xfwm4 + property: /general/workspace_names + state: present + value_type: string + value: [A, B, C] + output: + changed: true + previous_value: [Main, Work, Tmp] + type: [string, string, string] + value: [A, B, C] + version: 4.18.1 + mocks: + run_command: + - command: [/testbin/xfconf-query, --version] + environ: *env-def + rc: 0 + out: *version-output + err: '' + - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names] + environ: *env-def + rc: 0 + out: "Value is an array with 3 items:\n\nMain\nWork\nTmp\n" + err: '' + - command: + - /testbin/xfconf-query + - --channel + - xfwm4 + - --property + - /general/workspace_names + - --create + - --force-array + - --type + - string + - --set + - A + - --type + - string + - --set + - B + - --type + - string + - --set + - C + environ: *env-def + rc: 0 + out: '' + err: '' + - id: test_property_set_array_to_same_value + input: + channel: xfwm4 + property: /general/workspace_names + state: present + value_type: string + value: [A, B, C] + output: + changed: false + previous_value: [A, B, C] + type: [string, string, string] + value: [A, B, C] + version: 4.18.1 + mocks: + run_command: + - command: [/testbin/xfconf-query, --version] + environ: *env-def + rc: 0 + out: *version-output + err: '' + - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names] + environ: *env-def + rc: 0 + out: "Value is an array with 3 items:\n\nA\nB\nC\n" + err: '' + - command: + - /testbin/xfconf-query + - --channel + - xfwm4 + - --property + - /general/workspace_names + - --create + - --force-array + - --type + - string + - --set + - A + - --type + - string + - --set + - B + - --type + - string + - --set + - C + environ: *env-def + rc: 0 + out: '' + err: '' + - id: test_property_reset_value + input: + channel: xfwm4 + property: /general/workspace_names + state: absent + output: + changed: true + previous_value: [A, B, C] + type: + value: + version: 4.18.1 + mocks: + run_command: + - command: [/testbin/xfconf-query, --version] + environ: *env-def + rc: 0 + out: *version-output + err: '' + - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names] + environ: *env-def + rc: 0 + out: "Value is an array with 3 items:\n\nA\nB\nC\n" + err: '' + - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names, --reset] + environ: *env-def + rc: 0 + out: '' + err: '' diff --git a/tests/unit/plugins/modules/test_xfconf_info.yaml b/tests/unit/plugins/modules/test_xfconf_info.yaml index 8e7ae667c4b..d4d0deb39f2 100644 --- a/tests/unit/plugins/modules/test_xfconf_info.yaml +++ b/tests/unit/plugins/modules/test_xfconf_info.yaml @@ -14,114 +14,114 @@ anchors: Please report bugs to . test_cases: -- id: test_simple_property_get - input: - channel: xfwm4 - property: /general/inactive_opacity - output: - value: '100' - is_array: false - version: "4.18.1" - mocks: - run_command: - - command: [/testbin/xfconf-query, --version] - environ: *env-def - rc: 0 - out: *version-output - err: "" - - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/inactive_opacity] - environ: *env-def - rc: 0 - out: "100\n" - err: "" -- id: test_simple_property_get_nonexistent - input: - channel: xfwm4 - property: /general/i_dont_exist - output: - version: "4.18.1" - mocks: - run_command: - - command: [/testbin/xfconf-query, --version] - environ: *env-def - rc: 0 - out: *version-output - err: "" - - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/i_dont_exist] - environ: *env-def - rc: 1 - out: "" - err: 'Property "/general/i_dont_exist" does not exist on channel "xfwm4".\n' -- id: test_property_no_channel - input: - property: /general/i_dont_exist - output: - failed: true - msg: "missing parameter(s) required by 'property': channel" -- id: test_property_get_array - input: - channel: xfwm4 - property: /general/workspace_names - output: - is_array: true - value_array: [Main, Work, Tmp] - version: "4.18.1" - mocks: - run_command: - - command: [/testbin/xfconf-query, --version] - environ: *env-def - rc: 0 - out: *version-output - err: "" - - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names] - environ: *env-def - rc: 0 - out: "Value is an array with 3 items:\n\nMain\nWork\nTmp\n" - err: "" -- id: get_channels - input: {} - output: - channels: [a, b, c] - version: "4.18.1" - mocks: - run_command: - - command: [/testbin/xfconf-query, --version] - environ: *env-def - rc: 0 - out: *version-output - err: "" - - command: [/testbin/xfconf-query, --list] - environ: *env-def - rc: 0 - out: "Channels:\n a\n b\n c\n" - err: "" -- id: get_properties - input: - channel: xfwm4 - output: - properties: - - /general/wrap_cycle - - /general/wrap_layout - - /general/wrap_resistance - - /general/wrap_windows - - /general/wrap_workspaces - - /general/zoom_desktop - version: "4.18.1" - mocks: - run_command: - - command: [/testbin/xfconf-query, --version] - environ: *env-def - rc: 0 - out: *version-output - err: "" - - command: [/testbin/xfconf-query, --list, --channel, xfwm4] - environ: *env-def - rc: 0 - out: | - /general/wrap_cycle - /general/wrap_layout - /general/wrap_resistance - /general/wrap_windows - /general/wrap_workspaces - /general/zoom_desktop - err: "" + - id: test_simple_property_get + input: + channel: xfwm4 + property: /general/inactive_opacity + output: + value: '100' + is_array: false + version: 4.18.1 + mocks: + run_command: + - command: [/testbin/xfconf-query, --version] + environ: *env-def + rc: 0 + out: *version-output + err: '' + - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/inactive_opacity] + environ: *env-def + rc: 0 + out: "100\n" + err: '' + - id: test_simple_property_get_nonexistent + input: + channel: xfwm4 + property: /general/i_dont_exist + output: + version: 4.18.1 + mocks: + run_command: + - command: [/testbin/xfconf-query, --version] + environ: *env-def + rc: 0 + out: *version-output + err: '' + - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/i_dont_exist] + environ: *env-def + rc: 1 + out: '' + err: Property "/general/i_dont_exist" does not exist on channel "xfwm4".\n + - id: test_property_no_channel + input: + property: /general/i_dont_exist + output: + failed: true + msg: "missing parameter(s) required by 'property': channel" + - id: test_property_get_array + input: + channel: xfwm4 + property: /general/workspace_names + output: + is_array: true + value_array: [Main, Work, Tmp] + version: 4.18.1 + mocks: + run_command: + - command: [/testbin/xfconf-query, --version] + environ: *env-def + rc: 0 + out: *version-output + err: '' + - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names] + environ: *env-def + rc: 0 + out: "Value is an array with 3 items:\n\nMain\nWork\nTmp\n" + err: '' + - id: get_channels + input: {} + output: + channels: [a, b, c] + version: 4.18.1 + mocks: + run_command: + - command: [/testbin/xfconf-query, --version] + environ: *env-def + rc: 0 + out: *version-output + err: '' + - command: [/testbin/xfconf-query, --list] + environ: *env-def + rc: 0 + out: "Channels:\n a\n b\n c\n" + err: '' + - id: get_properties + input: + channel: xfwm4 + output: + properties: + - /general/wrap_cycle + - /general/wrap_layout + - /general/wrap_resistance + - /general/wrap_windows + - /general/wrap_workspaces + - /general/zoom_desktop + version: 4.18.1 + mocks: + run_command: + - command: [/testbin/xfconf-query, --version] + environ: *env-def + rc: 0 + out: *version-output + err: '' + - command: [/testbin/xfconf-query, --list, --channel, xfwm4] + environ: *env-def + rc: 0 + out: | + /general/wrap_cycle + /general/wrap_layout + /general/wrap_resistance + /general/wrap_windows + /general/wrap_workspaces + /general/zoom_desktop + err: ''