# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
- name:run setup to allow skipping OS-specific tests
setup:
gather_subset:min
- name:get tempdir path
- name:get tempdir path
raw:$env:TEMP
raw:$env:TEMP
register:tempdir
register:tempdir
@ -178,36 +182,50 @@
- "test_script_removes_file_again_result is not changed"
- "test_script_removes_file_again_result is not changed"
- "test_script_removes_file_again_result is skipped"
- "test_script_removes_file_again_result is skipped"
# TODO: these tests fail on 2008 (not even R2) with no output. It's related to the default codepage being UTF8- if we force it back to 437, it works fine.
- name:skip batch tests on 6.0 (UTF8 codepage prevents it from working, see https://github.com/ansible/ansible/issues/21915)
# Need to figure out a sane place to do that under the new exec wrapper.
block:
#- name: run simple batch file
- name:run simple batch file
# script: test_script.bat
script:test_script.bat
# register: test_batch_result
register:test_batch_result
#
#- name: check that batch file ran
- name:check that batch file ran
# assert:
assert:
# that:
that:
# - "test_batch_result.rc == 0"
- "test_batch_result.rc == 0"
# - "test_batch_result.stdout"
- "test_batch_result.stdout"
# - "'batch' in test_batch_result.stdout"
- "'batch' in test_batch_result.stdout"
# - "not test_batch_result.stderr"
- "not test_batch_result.stderr"
# - "test_batch_result is not failed"
- "test_batch_result is not failed"
# - "test_batch_result is changed"
- "test_batch_result is changed"
- name:run simple batch file with .cmd extension
#- name: run simple batch file with .cmd extension
script:test_script.cmd
# script: test_script.cmd
register:test_cmd_result
# register: test_cmd_result
#
- name:check that batch file with .cmd extension ran
#- name: check that batch file with .cmd extension ran
assert:
# assert:
that:
# that:
- "test_cmd_result.rc == 0"
# - "test_cmd_result.rc == 0"
- "test_cmd_result.stdout"
# - "test_cmd_result.stdout"
- "'cmd extension' in test_cmd_result.stdout"
# - "'cmd extension' in test_cmd_result.stdout"
- "not test_cmd_result.stderr"
# - "not test_cmd_result.stderr"
- "test_cmd_result is not failed"
# - "test_cmd_result is not failed"
- "test_cmd_result is changed"
# - "test_cmd_result is changed"
- name:run simple batch file with .bat extension that fails
script:fail.bat
ignore_errors:true
register:test_batch_result
- name:check that batch file with .bat extension reported failure