From af1635af0c27a27c20e95cc3cbefb55defd363cc Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 28 Oct 2015 16:37:13 +0000 Subject: [PATCH] Testing: autotest: Introduce "loginas" No functional change. Signed-off-by: Ian Jackson --- tests/autotest | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/tests/autotest b/tests/autotest index a999b32..40d6a57 100755 --- a/tests/autotest +++ b/tests/autotest @@ -53,15 +53,16 @@ proc submitform-expect {wanttxt} { epage $wanttxt } -fillformfield alice -fillformfield bogus -send "\t" -submitform-expect "wrong password" +proc loginas {user {password sesame} {wanttxt ACCESSGRANTED}} { + fillformfield $user + fillformfield $password + send "\t" + submitform-expect $wanttxt +} + +loginas alice bogus "wrong password" -fillformfield alice -fillformfield sesame -send "\t" -submitform-expect "ACCESSGRANTED" +loginas alice etxt {path = '/Tsuffix'} @@ -74,20 +75,15 @@ submitform-expect "You have been logged out" send "B\x10/Make sponges\r" submitform-expect "You need to log in" -fillformfield bob -fillformfield sesame -send "\t" -submitform-expect "ACCESSGRANTED" +loginas bob send "/Logout\r" submitform-expect "You have been logged out" send "/Log in again\r" submitform-expect "need to log in" -fillformfield bob -fillformfield sesame -send "\t" -submitform-expect "ACCESSGRANTED" + +loginas bob send "BBB\x10/Make sponges\r" submitform-expect "Login session interrupted" -- 2.30.2