[Pkg-shadow-commits] r1687 - debian/trunk/tests/su/01
nekral-guest at alioth.debian.org
nekral-guest at alioth.debian.org
Sun Jan 6 19:52:18 UTC 2008
Author: nekral-guest
Date: 2008-01-06 19:52:18 +0000 (Sun, 06 Jan 2008)
New Revision: 1687
Added:
debian/trunk/tests/su/01/run_su.exp
Removed:
debian/trunk/tests/su/01/run_su
Log:
Add language extension for run_su (run_su.exp).
Deleted: debian/trunk/tests/su/01/run_su
===================================================================
--- debian/trunk/tests/su/01/run_su 2008-01-06 19:49:24 UTC (rev 1686)
+++ debian/trunk/tests/su/01/run_su 2008-01-06 19:52:18 UTC (rev 1687)
@@ -1,47 +0,0 @@
-#!/usr/bin/expect
-
-set timeout 2
-
-if {$argc != 3} {
- puts "usage: run_su <user> <password> <prompt>"
- exit 1
-}
-
-set user [lindex $argv 0]
-set password [lindex $argv 1]
-set prompt [lindex $argv 2]
-
-# First, switch to the testsuite user
-# (otherwise, no password will be asked)
-spawn /bin/su testsuite
-expect "$ " ;# Wait for the prompt
-send "id\r" ;# Verify we are really testsuite
-expect {
- timeout {
- puts "\ntimeout...FAIL"
- exit 1
- }
- "uid=424243(testsuite) gid=424243 groups=424243"
-}
-
-send "su $user\r" ;# Switch to the user
-expect "Password: " ;# Wait for the Password: prompt
-# Wait a little bit more (su is not ready to receive the password)
-sleep 0.1
-send "$password\r" ;# Send the password
-
-expect {
- # Wait for the new prompt
- "$prompt" {
- send "id\r" ;# Verify the id
- expect {
- -re "\\($user\\).*\\($user\\).*\\($user\\)" {
- puts "PASS"
- exit 0
- }
- }
- }
-}
-
-puts "\ntimeout...FAIL"
-exit 1
Copied: debian/trunk/tests/su/01/run_su.exp (from rev 1485, debian/trunk/tests/su/01/run_su)
===================================================================
--- debian/trunk/tests/su/01/run_su.exp (rev 0)
+++ debian/trunk/tests/su/01/run_su.exp 2008-01-06 19:52:18 UTC (rev 1687)
@@ -0,0 +1,47 @@
+#!/usr/bin/expect
+
+set timeout 2
+
+if {$argc != 3} {
+ puts "usage: run_su <user> <password> <prompt>"
+ exit 1
+}
+
+set user [lindex $argv 0]
+set password [lindex $argv 1]
+set prompt [lindex $argv 2]
+
+# First, switch to the testsuite user
+# (otherwise, no password will be asked)
+spawn /bin/su testsuite
+expect "$ " ;# Wait for the prompt
+send "id\r" ;# Verify we are really testsuite
+expect {
+ timeout {
+ puts "\ntimeout...FAIL"
+ exit 1
+ }
+ "uid=424243(testsuite) gid=424243 groups=424243"
+}
+
+send "su $user\r" ;# Switch to the user
+expect "Password: " ;# Wait for the Password: prompt
+# Wait a little bit more (su is not ready to receive the password)
+sleep 0.1
+send "$password\r" ;# Send the password
+
+expect {
+ # Wait for the new prompt
+ "$prompt" {
+ send "id\r" ;# Verify the id
+ expect {
+ -re "\\($user\\).*\\($user\\).*\\($user\\)" {
+ puts "PASS"
+ exit 0
+ }
+ }
+ }
+}
+
+puts "\ntimeout...FAIL"
+exit 1
More information about the Pkg-shadow-commits
mailing list