mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #7625/3b779eca backport][stable-7] Fix bad expressions in tests (#7628)
Fix bad expressions in tests (#7625)
* Fix bad expressions in tests.
ci_complete
* Disable cmd_runner integration tests.
ci_complete
* Another bad expression.
ci_complete
(cherry picked from commit 3b779ecade
)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
d789351195
commit
5c6053bf79
7 changed files with 43 additions and 28 deletions
|
@ -22,7 +22,7 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- 'alternative is changed'
|
- 'alternative is changed'
|
||||||
- 'cmd.stdout == "dummy{{ item }}"'
|
- 'cmd.stdout == "dummy" ~ item'
|
||||||
|
|
||||||
- name: check that alternative has been updated
|
- name: check that alternative has been updated
|
||||||
command: "grep -Pzq '/bin/dummy{{ item }}\\n{{ 60 + item|int }}' '{{ alternatives_dir }}/dummy'"
|
command: "grep -Pzq '/bin/dummy{{ item }}\\n{{ 60 + item|int }}' '{{ alternatives_dir }}/dummy'"
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
that:
|
that:
|
||||||
- archive_no_options is changed
|
- archive_no_options is changed
|
||||||
- "archive_no_options.dest_state == 'archive'"
|
- "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 }})
|
- name: Remove the archive - no options ({{ format }})
|
||||||
file:
|
file:
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
that:
|
that:
|
||||||
- archive_file_options_stat is not changed
|
- archive_file_options_stat is not changed
|
||||||
- "archive_file_options.mode == '0600'"
|
- "archive_file_options.mode == '0600'"
|
||||||
- "{{ archive_file_options.archived | length }} == 3"
|
- "archive_file_options.archived | length == 3"
|
||||||
|
|
||||||
- name: Remove the archive - file options ({{ format }})
|
- name: Remove the archive - file options ({{ format }})
|
||||||
file:
|
file:
|
||||||
|
@ -146,7 +146,7 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- archive_path_list is changed
|
- archive_path_list is changed
|
||||||
- "{{ archive_path_list.archived | length }} == 3"
|
- "archive_path_list.archived | length == 3"
|
||||||
|
|
||||||
- name: Remove archive - path list ({{ format }})
|
- name: Remove archive - path list ({{ format }})
|
||||||
file:
|
file:
|
||||||
|
@ -168,8 +168,8 @@
|
||||||
that:
|
that:
|
||||||
- archive_missing_paths is changed
|
- archive_missing_paths is changed
|
||||||
- "archive_missing_paths.dest_state == 'incomplete'"
|
- "archive_missing_paths.dest_state == 'incomplete'"
|
||||||
- "'{{ remote_tmp_dir }}/dne.txt' 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"
|
- "(remote_tmp_dir ~ '/foo.txt') not in archive_missing_paths.missing"
|
||||||
|
|
||||||
- name: Remove archive - missing paths ({{ format }})
|
- name: Remove archive - missing paths ({{ format }})
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -20,21 +20,28 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- archive_remove_source_files is changed
|
- 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 }})
|
- name: Remove Archive - remove source files ({{ format }})
|
||||||
file:
|
file:
|
||||||
path: "{{ remote_tmp_dir }}/archive_remove_source_files.{{ format }}"
|
path: "{{ remote_tmp_dir }}/archive_remove_source_files.{{ format }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Assert that source files were removed - remove source files ({{ format }})
|
- name: Remove source files in check mode ({{ format }})
|
||||||
assert:
|
file:
|
||||||
that:
|
path: "{{ remote_tmp_dir }}/{{ item }}"
|
||||||
- "'{{ remote_tmp_dir }}/{{ item }}' is not exists"
|
state: absent
|
||||||
|
check_mode: true
|
||||||
with_items:
|
with_items:
|
||||||
- foo.txt
|
- foo.txt
|
||||||
- bar.txt
|
- bar.txt
|
||||||
- empty.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 }})
|
- name: Copy source files - remove source directory ({{ format }})
|
||||||
copy:
|
copy:
|
||||||
|
@ -76,17 +83,24 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- archive_remove_source_directory is changed
|
- 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 }})
|
- name: Remove archive - remove source directory ({{ format }})
|
||||||
file:
|
file:
|
||||||
path: "{{ remote_tmp_dir }}/archive_remove_source_directory.{{ format }}"
|
path: "{{ remote_tmp_dir }}/archive_remove_source_directory.{{ format }}"
|
||||||
state: absent
|
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 }})
|
- name: Verify source directory was removed - remove source directory ({{ format }})
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- "'{{ remote_tmp_dir }}/tmpdir' is not exists"
|
- remove_dir is not changed
|
||||||
|
|
||||||
- name: Create temporary directory - remove source excluding path ({{ format }})
|
- name: Create temporary directory - remove source excluding path ({{ format }})
|
||||||
file:
|
file:
|
||||||
|
@ -120,7 +134,7 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- archive_remove_source_excluding_path is changed
|
- 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 }})
|
- name: Remove archive - remove source excluding path ({{ format }})
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -3,3 +3,4 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
azp/posix/2
|
azp/posix/2
|
||||||
|
disabled # TODO
|
||||||
|
|
|
@ -17,25 +17,25 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- "'project_path' in deploy_helper"
|
- "'project_path' in deploy_helper"
|
||||||
- "deploy_helper.current_path == '{{ deploy_helper.project_path }}/current'"
|
- "deploy_helper.current_path == deploy_helper.project_path ~ '/current'"
|
||||||
- "deploy_helper.releases_path == '{{ deploy_helper.project_path }}/releases'"
|
- "deploy_helper.releases_path == deploy_helper.project_path ~ '/releases'"
|
||||||
- "deploy_helper.shared_path == '{{ deploy_helper.project_path }}/shared'"
|
- "deploy_helper.shared_path == deploy_helper.project_path ~ '/shared'"
|
||||||
- "deploy_helper.unfinished_filename == 'DEPLOY_UNFINISHED'"
|
- "deploy_helper.unfinished_filename == 'DEPLOY_UNFINISHED'"
|
||||||
- "'previous_release' in deploy_helper"
|
- "'previous_release' in deploy_helper"
|
||||||
- "'previous_release_path' in deploy_helper"
|
- "'previous_release_path' in deploy_helper"
|
||||||
- "'new_release' in deploy_helper"
|
- "'new_release' in deploy_helper"
|
||||||
- "'new_release_path' 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
|
- 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
|
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
|
- name: Assert State=query with relative overridden paths
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- "deploy_helper.current_path == '{{ deploy_helper.project_path }}/CURRENT_PATH'"
|
- "deploy_helper.current_path == deploy_helper.project_path ~ '/CURRENT_PATH'"
|
||||||
- "deploy_helper.releases_path == '{{ deploy_helper.project_path }}/RELEASES_PATH'"
|
- "deploy_helper.releases_path == deploy_helper.project_path ~ '/RELEASES_PATH'"
|
||||||
- "deploy_helper.shared_path == '{{ deploy_helper.project_path }}/SHARED_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.new_release_path == deploy_helper.releases_path ~ '/' ~ deploy_helper.new_release"
|
||||||
|
|
||||||
- name: State=query with absolute overridden paths
|
- 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
|
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.current_path == '/CURRENT_PATH'"
|
||||||
- "deploy_helper.releases_path == '/RELEASES_PATH'"
|
- "deploy_helper.releases_path == '/RELEASES_PATH'"
|
||||||
- "deploy_helper.shared_path == '/SHARED_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
|
- name: State=query with overridden unfinished_filename
|
||||||
deploy_helper: path={{ deploy_helper_test_root }} unfinished_filename=UNFINISHED_DEPLOY state=query
|
deploy_helper: path={{ deploy_helper_test_root }} unfinished_filename=UNFINISHED_DEPLOY state=query
|
||||||
|
|
|
@ -39,4 +39,4 @@
|
||||||
that:
|
that:
|
||||||
- result_basic_2 is not changed
|
- result_basic_2 is not changed
|
||||||
- result_basic_2 is failed
|
- 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!"
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
loop: "{{ initial_lv_status_result.stdout_lines }}"
|
loop: "{{ initial_lv_status_result.stdout_lines }}"
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- "'active' == '{{ item }}'"
|
- "'active' == item"
|
||||||
|
|
||||||
- name: Deactivate volume group
|
- name: Deactivate volume group
|
||||||
lvg:
|
lvg:
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
loop: "{{ activate_lv_status_result.stdout_lines }}"
|
loop: "{{ activate_lv_status_result.stdout_lines }}"
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- "'active' == '{{ item }}'"
|
- "'active' == item"
|
||||||
|
|
||||||
- name: Activate volume group again to verify idempontency
|
- name: Activate volume group again to verify idempontency
|
||||||
lvg:
|
lvg:
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
loop: "{{ activate_partial_lv_status_result.stdout_lines }}"
|
loop: "{{ activate_partial_lv_status_result.stdout_lines }}"
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- "'active' == '{{ item }}'"
|
- "'active' == item"
|
||||||
|
|
||||||
- name: Deactivate volume group in check mode
|
- name: Deactivate volume group in check mode
|
||||||
lvg:
|
lvg:
|
||||||
|
@ -160,4 +160,4 @@
|
||||||
loop: "{{ check_mode_deactivate_lv_status_result.stdout_lines }}"
|
loop: "{{ check_mode_deactivate_lv_status_result.stdout_lines }}"
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- "'active' == '{{ item }}'"
|
- "'active' == item"
|
||||||
|
|
Loading…
Reference in a new issue