kumquat-buildroot/support/testing/tests/package/sample_python_pexpect.py
Ricardo Martincoski cdad4bf6aa support/testing: add python-pexpect tests
Add a simple test case to check the basic usage. Call 'login' and try
wrong user/password, expecting the 'Login incorrect' message.

Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-11-23 22:05:46 +01:00

9 lines
154 B
Python

import pexpect
p = pexpect.spawn(["login"])
p.expect("login:")
p.sendline("wrong")
p.expect("Password:")
p.sendline("wrong")
p.expect("Login incorrect")