We find that sometimes "spawn /bin/su -l $USER1 -c whoami"
may return two lines:
"Attempting to create directory /home/su_usr2/perl5"
"su_usr2"
So the uncompleted "su_usr2" string match the first line,
but we expect to match the second line here.
So, fix it to match "su_usr2\r" instead.

Reported-by: DAN LI <[email protected]>
Signed-off-by: Wanlong Gao <[email protected]>
---
 testcases/commands/su/su01_s1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/commands/su/su01_s1 b/testcases/commands/su/su01_s1
index 4439bde..b50ebdf 100755
--- a/testcases/commands/su/su01_s1
+++ b/testcases/commands/su/su01_s1
@@ -320,7 +320,7 @@ expect {
   "Password:" {
     send "$USER1_PASSWORD\r"
     expect {
-                               "$USER1" { set i_am_correct 1 }
+                               "$USER1\r" { set i_am_correct 1 }
     }
   }
 }
-- 
1.8.2.242.g8617715


------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to