chiark / gitweb /
Testing: autotest: Introduce "loginas"
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 28 Oct 2015 16:37:13 +0000 (16:37 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 28 Oct 2015 16:37:13 +0000 (16:37 +0000)
No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
tests/autotest

index a999b32..40d6a57 100755 (executable)
@@ -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"