diff --git a/tests/integration/targets/alternatives/tasks/tests_set_priority.yml b/tests/integration/targets/alternatives/tasks/tests_set_priority.yml index 46cf48e59b..9bc523b0dc 100644 --- a/tests/integration/targets/alternatives/tasks/tests_set_priority.yml +++ b/tests/integration/targets/alternatives/tasks/tests_set_priority.yml @@ -22,7 +22,7 @@ assert: that: - 'alternative is changed' - - 'cmd.stdout == "dummy{{ item }}"' + - 'cmd.stdout == "dummy" ~ item' - name: check that alternative has been updated command: "grep -Pzq '/bin/dummy{{ item }}\\n{{ 60 + item|int }}' '{{ alternatives_dir }}/dummy'" diff --git a/tests/integration/targets/archive/tests/core.yml b/tests/integration/targets/archive/tests/core.yml index 1c4f4d1aaf..21b07038f0 100644 --- a/tests/integration/targets/archive/tests/core.yml +++ b/tests/integration/targets/archive/tests/core.yml @@ -29,7 +29,7 @@ that: - archive_no_options is changed - "archive_no_options.dest_state == 'archive'" - - "{{ archive_no_options.archived | length }} == 3" + - "archive_no_options.archived | length == 3" - name: Remove the archive - no options ({{ format }}) file: @@ -54,7 +54,7 @@ that: - archive_file_options_stat is not changed - "archive_file_options.mode == '0600'" - - "{{ archive_file_options.archived | length }} == 3" + - "archive_file_options.archived | length == 3" - name: Remove the archive - file options ({{ format }}) file: @@ -146,7 +146,7 @@ assert: that: - archive_path_list is changed - - "{{ archive_path_list.archived | length }} == 3" + - "archive_path_list.archived | length == 3" - name: Remove archive - path list ({{ format }}) file: @@ -168,8 +168,8 @@ that: - archive_missing_paths is changed - "archive_missing_paths.dest_state == 'incomplete'" - - "'{{ remote_tmp_dir }}/dne.txt' in archive_missing_paths.missing" - - "'{{ remote_tmp_dir }}/foo.txt' not in archive_missing_paths.missing" + - "(remote_tmp_dir ~ '/dne.txt') in archive_missing_paths.missing" + - "(remote_tmp_dir ~ '/foo.txt') not in archive_missing_paths.missing" - name: Remove archive - missing paths ({{ format }}) file: diff --git a/tests/integration/targets/archive/tests/remove.yml b/tests/integration/targets/archive/tests/remove.yml index 8f0b8cff86..a7e151d25b 100644 --- a/tests/integration/targets/archive/tests/remove.yml +++ b/tests/integration/targets/archive/tests/remove.yml @@ -20,21 +20,28 @@ assert: that: - archive_remove_source_files is changed - - "{{ archive_remove_source_files.archived | length }} == 3" + - "archive_remove_source_files.archived | length == 3" - name: Remove Archive - remove source files ({{ format }}) file: path: "{{ remote_tmp_dir }}/archive_remove_source_files.{{ format }}" state: absent -- name: Assert that source files were removed - remove source files ({{ format }}) - assert: - that: - - "'{{ remote_tmp_dir }}/{{ item }}' is not exists" +- name: Remove source files in check mode ({{ format }}) + file: + path: "{{ remote_tmp_dir }}/{{ item }}" + state: absent + check_mode: true with_items: - foo.txt - bar.txt - empty.txt + register: remove_files + +- name: Assert that source files were removed - remove source files ({{ format }}) + assert: + that: + - remove_files is not changed - name: Copy source files - remove source directory ({{ format }}) copy: @@ -76,17 +83,24 @@ assert: that: - archive_remove_source_directory is changed - - "{{ archive_remove_source_directory.archived | length }} == 3" + - "archive_remove_source_directory.archived | length == 3" - name: Remove archive - remove source directory ({{ format }}) file: path: "{{ remote_tmp_dir }}/archive_remove_source_directory.{{ format }}" state: absent +- name: Remove source source directory in check mode ({{ format }}) + file: + path: "{{ remote_tmp_dir }}/tmpdir" + state: absent + check_mode: true + register: remove_dir + - name: Verify source directory was removed - remove source directory ({{ format }}) assert: that: - - "'{{ remote_tmp_dir }}/tmpdir' is not exists" + - remove_dir is not changed - name: Create temporary directory - remove source excluding path ({{ format }}) file: @@ -120,7 +134,7 @@ assert: that: - archive_remove_source_excluding_path is changed - - "{{ archive_remove_source_excluding_path.archived | length }} == 2" + - "archive_remove_source_excluding_path.archived | length == 2" - name: Remove archive - remove source excluding path ({{ format }}) file: diff --git a/tests/integration/targets/cmd_runner/aliases b/tests/integration/targets/cmd_runner/aliases index 12d1d6617e..0c3b04c1d4 100644 --- a/tests/integration/targets/cmd_runner/aliases +++ b/tests/integration/targets/cmd_runner/aliases @@ -3,3 +3,4 @@ # SPDX-License-Identifier: GPL-3.0-or-later azp/posix/2 +disabled # TODO diff --git a/tests/integration/targets/deploy_helper/tasks/main.yml b/tests/integration/targets/deploy_helper/tasks/main.yml index fdd8bd87b2..9bd5f41506 100644 --- a/tests/integration/targets/deploy_helper/tasks/main.yml +++ b/tests/integration/targets/deploy_helper/tasks/main.yml @@ -17,25 +17,25 @@ assert: that: - "'project_path' in deploy_helper" - - "deploy_helper.current_path == '{{ deploy_helper.project_path }}/current'" - - "deploy_helper.releases_path == '{{ deploy_helper.project_path }}/releases'" - - "deploy_helper.shared_path == '{{ deploy_helper.project_path }}/shared'" + - "deploy_helper.current_path == deploy_helper.project_path ~ '/current'" + - "deploy_helper.releases_path == deploy_helper.project_path ~ '/releases'" + - "deploy_helper.shared_path == deploy_helper.project_path ~ '/shared'" - "deploy_helper.unfinished_filename == 'DEPLOY_UNFINISHED'" - "'previous_release' in deploy_helper" - "'previous_release_path' in deploy_helper" - "'new_release' in deploy_helper" - "'new_release_path' in deploy_helper" - - "deploy_helper.new_release_path == '{{ deploy_helper.releases_path }}/{{ deploy_helper.new_release }}'" + - "deploy_helper.new_release_path == deploy_helper.releases_path ~ '/' ~ deploy_helper.new_release" - name: State=query with relative overridden paths deploy_helper: path={{ deploy_helper_test_root }} current_path=CURRENT_PATH releases_path=RELEASES_PATH shared_path=SHARED_PATH state=query - name: Assert State=query with relative overridden paths assert: that: - - "deploy_helper.current_path == '{{ deploy_helper.project_path }}/CURRENT_PATH'" - - "deploy_helper.releases_path == '{{ deploy_helper.project_path }}/RELEASES_PATH'" - - "deploy_helper.shared_path == '{{ deploy_helper.project_path }}/SHARED_PATH'" - - "deploy_helper.new_release_path == '{{ deploy_helper.releases_path }}/{{ deploy_helper.new_release}}'" + - "deploy_helper.current_path == deploy_helper.project_path ~ '/CURRENT_PATH'" + - "deploy_helper.releases_path == deploy_helper.project_path ~ '/RELEASES_PATH'" + - "deploy_helper.shared_path == deploy_helper.project_path ~ '/SHARED_PATH'" + - "deploy_helper.new_release_path == deploy_helper.releases_path ~ '/' ~ deploy_helper.new_release" - name: State=query with absolute overridden paths deploy_helper: path={{ deploy_helper_test_root }} current_path=/CURRENT_PATH releases_path=/RELEASES_PATH shared_path=/SHARED_PATH state=query @@ -45,7 +45,7 @@ - "deploy_helper.current_path == '/CURRENT_PATH'" - "deploy_helper.releases_path == '/RELEASES_PATH'" - "deploy_helper.shared_path == '/SHARED_PATH'" - - "deploy_helper.new_release_path == '{{ deploy_helper.releases_path }}/{{ deploy_helper.new_release}}'" + - "deploy_helper.new_release_path == deploy_helper.releases_path ~ '/' ~ deploy_helper.new_release" - name: State=query with overridden unfinished_filename deploy_helper: path={{ deploy_helper_test_root }} unfinished_filename=UNFINISHED_DEPLOY state=query diff --git a/tests/integration/targets/ini_file/tasks/tests/00-basic.yml b/tests/integration/targets/ini_file/tasks/tests/00-basic.yml index c619e937a5..77170ed7db 100644 --- a/tests/integration/targets/ini_file/tasks/tests/00-basic.yml +++ b/tests/integration/targets/ini_file/tasks/tests/00-basic.yml @@ -39,4 +39,4 @@ that: - result_basic_2 is not changed - result_basic_2 is failed - - result_basic_2.msg == "Destination {{ non_existing_file }} does not exist!" + - result_basic_2.msg == "Destination " ~ non_existing_file ~ " does not exist!" diff --git a/tests/integration/targets/osx_defaults/tasks/main.yml b/tests/integration/targets/osx_defaults/tasks/main.yml index f7bcb89446..3ca3180f04 100644 --- a/tests/integration/targets/osx_defaults/tasks/main.yml +++ b/tests/integration/targets/osx_defaults/tasks/main.yml @@ -21,7 +21,7 @@ - name: Test if state and value are required together assert: that: - - "'following are missing: value' in '{{ missing_value['msg'] }}'" + - "'following are missing: value' in missing_value['msg']" - name: Change value of AppleMeasurementUnits to centimeter in check_mode osx_defaults: @@ -194,7 +194,7 @@ register: test_data_types - assert: - that: "{{ item.changed }}" + that: "item is changed" with_items: "{{ test_data_types.results }}" - name: Use different data types and delete them @@ -208,7 +208,7 @@ register: test_data_types - assert: - that: "{{ item.changed }}" + that: "item is changed" with_items: "{{ test_data_types.results }}"