[stable-6] Fix bad expressions in tests (#7627)

* 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)

* Fix osx_defaults tests (#7631)

Fix osx_defaults tests.

(cherry picked from commit dbba0d1956)
This commit is contained in:
Felix Fontein 2023-11-29 07:51:37 +01:00 committed by GitHub
commit 1f60829b9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 42 additions and 27 deletions

View file

@ -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:

View file

@ -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: