Subrata Modak1 <[EMAIL PROTECTED]> wrote on 05/23/2007 02:10:52 AM: > Please see the following problem reported by "[EMAIL PROTECTED]" regarding > "su01" testcase: > > >> Fw: LTP su01 problems > >> > >> I tried this manually, and the lines below show what happens when > >> a user's password has expired and then an invalid password is given > >> for the Old Password. > >> > >> The difference is it doesn't give the "incorrect password" message > >> until after the wrong password is given twice, while the test expects > >> it on the first attempt. > >> > >> su # su -l junk -c whoami > >> Password change requested. Choose a new password. > >> Old Password: (incorrect password given) > >> Old Password: (incorrect password given) > >> su: incorrect password
I really hate expect! Every time I'm close to getting this test working
it changes behavior. We have to complete our testing soon, and I have
lost a lot of time on this. Is anyone out there an expect expert who can
help me?
The problem is assertion 7, and I found that when this command is used:
spawn /bin/su -l root -c "passwd -e $USER1"
the expected result should be "Password expiry information changed", not
"Password changed." That change got me a little farther. Then when this
command is used:
spawn /bin/su -l $USER1 -c whoami
the message and prompts for the requested password change result. I found
that passing "USER1_PASSWORD" won't result in an "incorrect password"
prompt
because it is looking for the Old Password, and USER1_PASSWORD IS the old
password, so the next prompt is, "New Password" instead of, "Old
Password".
I tried using the following to pass an invalid password, but then the
behavior
changed and now it is just prompting for "Password:" and is trying to su
as
user2 instead of user1. grrrr.
spawn /bin/su -l $USER1 -c whoami
sleep 1
expect {
"Old Password:" {
send "wrong_$USER1_PASSWORD\r"
sleep 1
expect {
"Old Password:" {
send "wrong_$USER1_PASSWORD\r"
sleep 1
expect {
"incorrect password" { set i_am_correct 1 }
}
}
}
}
}
close
I'm sure someone who is more famililar with expect could
easily figure this out, but it is driving be nuts.
Thanks for your (hopefully) help.
Here are the original files:
The assertions are in su01_s1.
su01
Description: Binary data
su01_s1
Description: Binary data
------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/
_______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
