X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=pcucontrol%2Fmodels%2Fexp%2FDRAC.exp;h=fc83df77f87e6f89ab3c8a01bf5cc3dffa958fe2;hb=a61c58edd1ccb50d01456ecc3f93d2436b470cba;hp=35e91840c8a98e19a7e9daf80e73f0f510de5be3;hpb=fec28d68cc164e581c476ee93fd4b4b68ef939fd;p=pcucontrol.git diff --git a/pcucontrol/models/exp/DRAC.exp b/pcucontrol/models/exp/DRAC.exp index 35e9184..fc83df7 100755 --- a/pcucontrol/models/exp/DRAC.exp +++ b/pcucontrol/models/exp/DRAC.exp @@ -36,9 +36,9 @@ if { "$method" == "ssh" } { "Could not resolve hostname" { send_user "DRAC ssh: $expect_out(0,string)"; exit } "Connection timed out" { send_user "DRAC ssh: $expect_out(0,string)"; exit } -re "Received disconnect.*" { send_user "DRAC ssh: $expect_out(0,string)"; exit} - -re "\\$|/.*>|\[$user\]#" { send "\r"; } - timeout { send_user "DRAC ssh: timeout" ; exit; } - eof { if { $cont == 1 } { send_user "DRAC ssh failed twice"; exit ; } ; set cont 1 } + -re "\\$|/.*>|.*$user.*#" { send "\r"; } + timeout { send_user "DRAC ssh: timeout\n" ; exit; } + eof { if { $cont == 1 } { send_user "DRAC ssh failed twice\n"; exit ; } ; set cont 1 } } if { $cont == 0 } { break; } @@ -47,15 +47,15 @@ if { "$method" == "ssh" } { if { "$dryrun" == "True" } { expect { -re "\\$|/.*>" { send "racadm getsysinfo\r"; } - -re "\[$user\]#" { send "getsysinfo\r" } + -re ".*$user.*#" { send "getsysinfo\r" } } } else { expect { -re "\\$|/.*>" { send "racadm serveraction powercycle\r"; } - -re "\[$user\]#" { send "serveraction powercycle\r" } + -re ".*$user.*#" { send "serveraction powercycle\r" } } } - expect -re "\\$|/.*>|\[$user\]#" { send "exit\r"; } + expect -re "\\$|/.*>|.*$user.*#" { send "exit\r"; } expect eof { send_user "$reset_msg\n" } @@ -84,18 +84,18 @@ if { "$method" == "ssh" } { -re "ERROR:.*" { send_user "DRAC: $expect_out(0,string)"; exit } -re "UserName:|username:" { send "$user\r" ; exp_continue }; -re "Password:|password:" { send "$password\r" }; - timeout { send_user "DRAC: timeout" ; exit } - eof { send_user "DRAC: early EOF"; exit ; } + timeout { send_user "DRAC: timeout\n" ; exit } + eof { send_user "DRAC: early EOF\n"; exit ; } } expect { -re "Authentication failed.*" { send_user "DRAC: $expect_out(0,string)"; exit } -re "This.*not support remote RACADM" { send_user "DRAC: $expect_out(0,string)" ; exit } -re "ERROR: The syntax of the command specified is not correct." { set cont 1 } - -re "INVALID ARGUMENT" { send_user "DRAC: received 'INVALID ARGUMENT'"; exit } + -re "INVALID ARGUMENT" { send_user "DRAC: received 'INVALID ARGUMENT'\n"; exit } -re "RAC Information:" { sleep .1; } - timeout { send_user "DRAC: timeout" ; exit } - eof { send_user "DRAC: early EOF"; exit ; } + timeout { send_user "DRAC: timeout\n" ; exit } + eof { send_user "DRAC: early EOF\n"; exit ; } #-re "ERROR:.*" { send_user "DRAC: $expect_out(0,string)"; exit } } if { $cont == 0 } { break; } @@ -105,7 +105,7 @@ if { "$method" == "ssh" } { expect { -re "Power Status.*" { sleep .1; } -re "RAC Firmware.*" { sleep .1; } - eof { send_user "DRAC: early EOF"; exit ; } + eof { send_user "DRAC: early EOF\n"; exit ; } } expect eof { send_user "$reset_msg\n" } }