ansible/test/integration/targets/pause/pause-5.yml
Sam Doran 1c20029694
Fix ctrl+c in pause module and add tests ()
* Fix all cases with pause and ctrl+c
 - naked:
	- pause:
 - with prompt
	- pause: prompt=hi
 - time wait
	- pause: seconds=60
 - time wait with prompt
	- pause: seconds=60 prompt=hi


Fixes 

* Use curses to control stdout
* Use curses to clear lines on interactive input
* Validate input for echo parameter and fail nicely if invalid
* Add integration tests for pause module using pexpect
* Use try except when trying to determine erase sequence to account for lack of TTY in containers in tests
* Improve output validation for regular paus test
* Accept two digit precision for pause length in test
* Check for seconds when seconds is specificed, minutes when minutes is specified
* Add test for no TTY mode

Co-authored by: Toshio Kuratomi <a.badger@gmail.com>
Co-authored by: Brian Coca <brian.coca+git@gmail.com>
2018-05-21 10:04:43 -04:00

35 lines
741 B
YAML

- name: Test pause module echo output
hosts: testhost
become: no
gather_facts: no
tasks:
- pause:
echo: yes
prompt: Enter some text
register: results
- name: Ensure that input was captured
assert:
that:
- results.user_input == 'hello there'
- pause:
echo: yes
prompt: Enter some text to edit
register: result
- name: Ensure edited input was captured
assert:
that:
- result.user_input == 'hello tommy boy'
- pause:
echo: no
prompt: Enter some text
register: result
- name: Ensure secret input was caputered
assert:
that:
- result.user_input == 'supersecretpancakes'