From 280e622b7999a87832ba3c4d4e36c23a6a569cb6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 27 Oct 2015 18:59:21 +0000 Subject: [PATCH] Testing: Log in Signed-off-by: Ian Jackson --- tests/autotest | 27 ++++++++++++++++++++++----- tests/cgi | 2 +- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/tests/autotest b/tests/autotest index 0d84c63..29863bc 100755 --- a/tests/autotest +++ b/tests/autotest @@ -37,11 +37,28 @@ proc etxt {str} { elog -re $str } -etxt {You need to log in} -etxt {Source available} +proc epage {str} { + etxt $str +} + +epage {You need to log in} + +proc fillformfield {value} { + send "\t\r$value\r" +} + +proc submitform-expect {wanttxt} { + send "\t\r" + etxt "loading file" + epage $wanttxt +} + +fillformfield alice +fillformfield bogus +submitform-expect "wrong password" -send "\t\ralice\r\t\rbogus\r\t\r" -etxt "loading file" -etxt "wrong password" +fillformfield alice +fillformfield sesame +submitform-expect "ACCESSGRANTED" puts ok diff --git a/tests/cgi b/tests/cgi index b73e6aa..1610e8d 100755 --- a/tests/cgi +++ b/tests/cgi @@ -48,7 +48,7 @@ Content-Type: text/html Set-Cookie: $cookie TITLE -

H1

+

ACCESSGRANTED

again

info

-- 2.30.2