aboutsummaryrefslogtreecommitdiffstats
path: root/tests/worker.py
diff options
context:
space:
mode:
authorpcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8>2010-11-27 22:12:57 +0000
committerpcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8>2010-11-27 22:12:57 +0000
commit3e0a931b4923652e8a026ae0cf3e6386367dbda9 (patch)
treeb32a0bdce2febdd6eb146a791302e02f58c3f100 /tests/worker.py
parent754a0e45d79ae9252022edd5370bf3fd9f701e5f (diff)
downloadsos-3e0a931b4923652e8a026ae0cf3e6386367dbda9.tar.gz
[tests] worker: SIGINT behaviour almost completely tested
We still need to check that SIGINT when a request is running leads to: - "INTERRUPTED" on stderr; - the flow of execution continuing. git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@1041 ef72aa8b-4018-0410-8976-d6e080ef94d8
Diffstat (limited to 'tests/worker.py')
-rw-r--r--tests/worker.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/worker.py b/tests/worker.py
index 38688fd7..9e186731 100644
--- a/tests/worker.py
+++ b/tests/worker.py
@@ -42,8 +42,26 @@ class PexpectTest(unittest.TestCase):
def test_exit(self):
self.sendlines(['exit'])
self.__finishes_ok__()
+
+ def test_ctrlc_on_cmd_prompt_quits(self):
+ self.sig(SIGINT)
+ self.expect(pexpect.EOF)
+ self.__finishes_ok__()
+
+ def test_ctrlc_when_entering_command_quits(self):
+ # "Mon clavier se blo" -- French reference
+ self.send('glo')
+ self.sig(SIGINT)
self.expect(pexpect.EOF)
+ def test_ctrlc_on_readparms_drops(self):
+ self.sendlines(['exec'])
+ self.sig(SIGINT)
+ self.expect('#0#\r\n')
+ self.sendlines(['glob'])
+ self.sig(SIGINT)
+ self.expect('#0#\r\n')
+
def test_basic_noop(self):
self.sendlines(['noop'])
self.expect('#1#\r\n')