This change does not guarantee elimination of false PASS results,
but it makes them somewhat less likely to occur by matching sshd-like
Permission denied line. The regexp doesn't use ^ or $ or any kind of
more precise matching due to numerous problems with `expect' handling
the more complicated regexp strings across versions.

Signed-off-by: Jiri Jaburek <[email protected]>
---
 testcases/network/tcp_cmds/ssh/ssh01_s1 | 6 +++---
 testcases/network/tcp_cmds/ssh/ssh02_s1 | 6 +++---
 testcases/network/tcp_cmds/ssh/ssh03_s1 | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/testcases/network/tcp_cmds/ssh/ssh01_s1 
b/testcases/network/tcp_cmds/ssh/ssh01_s1
index e64bbf0..c1cc127 100755
--- a/testcases/network/tcp_cmds/ssh/ssh01_s1
+++ b/testcases/network/tcp_cmds/ssh/ssh01_s1
@@ -50,10 +50,10 @@ while 1 {
 
         "Are you sure you want to continue connecting (yes/no)?" { exp_send 
"yes\r"}
         "assword:" {exp_send "$PASSWD\r"}
-        "Permission denied" {
+        -re "Permission denied (.*)\." {
             send_user "SSH would not allow $RUSER to login with invalid 
password, Test Passed \n"
             send_user "\nTEST_PASSED\n"
-            break
+            exit 0
         }
         "$RUSER" {
             send_user "SSH allowed $RUSER to login with invalid pass, Test 
Failed \n"
@@ -63,4 +63,4 @@ while 1 {
     sleep 1
 }
 
-exit 0
+exit 1
diff --git a/testcases/network/tcp_cmds/ssh/ssh02_s1 
b/testcases/network/tcp_cmds/ssh/ssh02_s1
index 724ef97..d49e1e9 100755
--- a/testcases/network/tcp_cmds/ssh/ssh02_s1
+++ b/testcases/network/tcp_cmds/ssh/ssh02_s1
@@ -51,10 +51,10 @@ while 1 {
 
         "Are you sure you want to continue connecting (yes/no)?" { exp_send 
"yes\r"}
         "assword:" {exp_send "$PASSWD\r"}
-        "Permission denied" {
+        -re "Permission denied (.*)\." {
             send_user "SSH would not allow $RUSER to login with invalid 
password, Test Passed \n"
             send_user "\nTEST_PASSED\n"
-            break
+            exit 0
         }
         "$RUSER" {
             send_user "SSH allowed $RUSER to login with invalid pass, Test 
Failed \n"
@@ -64,4 +64,4 @@ while 1 {
     sleep 1
 }
 
-exit 0
+exit 1
diff --git a/testcases/network/tcp_cmds/ssh/ssh03_s1 
b/testcases/network/tcp_cmds/ssh/ssh03_s1
index 9463a7f..bf6aada 100755
--- a/testcases/network/tcp_cmds/ssh/ssh03_s1
+++ b/testcases/network/tcp_cmds/ssh/ssh03_s1
@@ -48,16 +48,16 @@ while 1 {
 
         "Are you sure you want to continue connecting (yes/no)?" { exp_send 
"yes\r"}
         "assword:" {exp_send "$PASSWD\r"}
-        "Permission denied" {
+        -re "Permission denied (.*)\." {
             send_user "\nSSH would not allow $RUSER to login, Test FAILED \n"
             exit 1
         }
         "$RUSER" {
             send_user "SSH allowed $RUSER to login, Test PASSED \n"
-            break
+            exit 0
         }
     }
     sleep 1
 }
 
-exit 0
+exit 1
-- 
1.8.3.1


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to