/test/integration/roles/test_win_ping/tasks/main.yml

https://github.com/ajanthanm/ansible · YAML · 72 lines · 27 code · 12 blank · 33 comment · 0 complexity · 3182d026a1124cd0b78eae81e9928bfe MD5 · raw file

  1. # test code for the win_ping module
  2. # (c) 2014, Chris Church <chris@ninemoreminutes.com>
  3. # This file is part of Ansible
  4. #
  5. # Ansible is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # Ansible is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
  17. - name: test win_ping
  18. action: win_ping
  19. register: win_ping_result
  20. - name: check win_ping result
  21. assert:
  22. that:
  23. - "not win_ping_result|failed"
  24. - "not win_ping_result|changed"
  25. - "win_ping_result.ping == 'pong'"
  26. - name: test win_ping with data
  27. win_ping: data=blah
  28. register: win_ping_with_data_result
  29. - name: check win_ping result with data
  30. assert:
  31. that:
  32. - "not win_ping_with_data_result|failed"
  33. - "not win_ping_with_data_result|changed"
  34. - "win_ping_with_data_result.ping == 'blah'"
  35. #- name: test local ping (should use default ping)
  36. # local_action: ping
  37. # register: local_ping_result
  38. #- name: check local ping result
  39. # assert:
  40. # that:
  41. # - "not local_ping_result|failed"
  42. # - "not local_ping_result|changed"
  43. # - "local_ping_result.ping == 'pong'"
  44. - name: test win_ping.ps1 with data
  45. win_ping.ps1: data=bleep
  46. register: win_ping_ps1_result
  47. - name: check win_ping.ps1 result with data
  48. assert:
  49. that:
  50. - "not win_ping_ps1_result|failed"
  51. - "not win_ping_ps1_result|changed"
  52. - "win_ping_ps1_result.ping == 'bleep'"
  53. #- name: test win_ping with invalid args
  54. # win_ping: arg=invalid
  55. # register: win_ping_ps1_invalid_args_result
  56. #- name: check that win_ping.ps1 with invalid args fails
  57. # assert:
  58. # that:
  59. # - "win_ping_ps1_invalid_args_result|failed"
  60. # - "win_ping_ps1_invalid_args_result.msg"