summaryrefslogtreecommitdiffstats
path: root/support/testing/tests/package/sample_python_pexpect.py
diff options
context:
space:
mode:
authorRicardo Martincoski <ricardo.martincoski@gmail.com>2018-11-16 01:57:29 -0200
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>2018-11-23 22:05:46 +0100
commitcdad4bf6aa58b50182e3ae3e61e1550dd7769090 (patch)
tree2b73686ab44c688d8b97daca1cc6d1409c46e534 /support/testing/tests/package/sample_python_pexpect.py
parent756dd5f132ffe75b727e32df8648b95672e5493a (diff)
downloadbuildroot-cdad4bf6aa58b50182e3ae3e61e1550dd7769090.tar.gz
buildroot-cdad4bf6aa58b50182e3ae3e61e1550dd7769090.zip
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>
Diffstat (limited to 'support/testing/tests/package/sample_python_pexpect.py')
-rw-r--r--support/testing/tests/package/sample_python_pexpect.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/support/testing/tests/package/sample_python_pexpect.py b/support/testing/tests/package/sample_python_pexpect.py
new file mode 100644
index 0000000000..cfe395fc29
--- /dev/null
+++ b/support/testing/tests/package/sample_python_pexpect.py
@@ -0,0 +1,8 @@
+import pexpect
+
+p = pexpect.spawn(["login"])
+p.expect("login:")
+p.sendline("wrong")
+p.expect("Password:")
+p.sendline("wrong")
+p.expect("Login incorrect")
OpenPOWER on IntegriCloud