chiark / gitweb /
Testing: Break out loginout.at
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 28 Oct 2015 16:51:51 +0000 (16:51 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 28 Oct 2015 16:52:39 +0000 (16:52 +0000)
Same test, but run differently.

This prepares us for multiple different tests.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
tests/README
tests/autotest
tests/loginout.at [new file with mode: 0644]

index 2795798..b13e658 100644 (file)
@@ -1,4 +1,4 @@
-tests/autotest
+tests/autotest tests/loginout.at
 
 REQUEST_METHOD=post CAFTEST_CAF=`pwd` tests/cgi ; echo
 
index 4ba46dc..9c4f9c4 100755 (executable)
@@ -1,5 +1,7 @@
 #!/usr/bin/expect -f
 
+set testfile [lindex $argv 0]
+
 set tt tests/tmp
 
 exec rm -rf $tt
@@ -64,34 +66,6 @@ proc loginas {user {password sesame} {wanttxt ACCESSGRANTED}} {
      submitform-expect $wanttxt
 }
 
-dospawn
-
-loginas alice bogus "wrong password"
-
-loginas alice
-
-etxt {path = '/Tsuffix'}
-
-send "/Make worms\r"
-submitform-expect "MAKING-worms"
-
-send "/Logout\r"
-submitform-expect "You have been logged out"
-
-send "B\x10/Make sponges\r"
-submitform-expect "You need to log in"
-
-loginas bob
-
-send "/Logout\r"
-submitform-expect "You have been logged out"
-
-send "/Log in again\r"
-submitform-expect "need to log in"
-
-loginas bob
-
-send "BBB\x10/Make sponges\r"
-submitform-expect "Login session interrupted"
+source $testfile
 
 puts ok
diff --git a/tests/loginout.at b/tests/loginout.at
new file mode 100644 (file)
index 0000000..64c7f5f
--- /dev/null
@@ -0,0 +1,31 @@
+# -*- Tcl -*-
+
+dospawn
+
+loginas alice bogus "wrong password"
+
+loginas alice
+
+etxt {path = '/Tsuffix'}
+
+send "/Make worms\r"
+submitform-expect "MAKING-worms"
+
+send "/Logout\r"
+submitform-expect "You have been logged out"
+
+send "B\x10/Make sponges\r"
+submitform-expect "You need to log in"
+
+loginas bob
+
+send "/Logout\r"
+submitform-expect "You have been logged out"
+
+send "/Log in again\r"
+submitform-expect "need to log in"
+
+loginas bob
+
+send "BBB\x10/Make sponges\r"
+submitform-expect "Login session interrupted"