X-Git-Url: http://git.onelab.eu/?p=pcucontrol.git;a=blobdiff_plain;f=pcucontrol%2Fmodels%2Fexp%2FHPiLO.exp;fp=pcucontrol%2Fmodels%2Fexp%2FHPiLO.exp;h=dc637aae2c0bebf22dc5fbfbe2f16a28d28b1c01;hp=ec064a50bd1e9d045af67cf31a17612e869e0e09;hb=fec28d68cc164e581c476ee93fd4b4b68ef939fd;hpb=4c1af5526615cf1958b801176c802283d7d4d308 diff --git a/pcucontrol/models/exp/HPiLO.exp b/pcucontrol/models/exp/HPiLO.exp index ec064a5..dc637aa 100755 --- a/pcucontrol/models/exp/HPiLO.exp +++ b/pcucontrol/models/exp/HPiLO.exp @@ -10,21 +10,23 @@ set model [lindex $argv 5] log_user 0 +set path [ file dirname [ file dirname $argv0 ] ] + if { "$method" == "https" } { if { "$dryrun" == "True" } { - set file $path/iloxml/Get_Network.xml + set file $path/hpilo/iloxml/Get_Network.xml } else { - #set file $path/iloxml/Reset_Server.xml - set file $path/iloxml/Get_Network.xml + set file $path/hpilo/iloxml/Reset_Server.xml + #set file $path/hpilo/iloxml/Get_Network.xml } - spawn "$path/locfg.pl" -s $host -u $user -p '$password' -f $file + spawn "$path/hpilo/locfg.pl" -s $host -u $user -p $password -f $file } elseif { "$method" == "ssh" } { if { "$dryrun" == "True" } { set reset_cmd "POWER\r" set reset_msg "Test: No error" } else { - #set reset_cmd "reset\r" - set reset_cmd "POWER\r" + #set reset_cmd "POWER\r" + set reset_cmd "reset\r" set reset_msg "Reset: No error" } spawn ssh $user@$host @@ -41,6 +43,7 @@ if { "$method" == "proxy" || "$method" == "https" } { "MESSAGE='Host power is already ON.'" { send_user "$expect_out(0,string)"} "MESSAGE='Host power is already OFF.'" { send_user "$expect_out(0,string)"} "MESSAGE='Login credentials rejected.'" { send_user "$expect_out(0,string)"} + "MESSAGE='User login name was not found'" { send_user "$expect_out(0,string)"} "" { send_user "Test: No error"} -re "ERROR:.*" { send_user "$expect_out(0,string)" } eof { send_user "Reached EOF without status report: $expect_out(buffer)" } @@ -52,7 +55,9 @@ if { "$method" == "proxy" || "$method" == "https" } { "password: " { send "$password\n" ; exp_continue } "Permission denied" { send_user "HPiLO username/password: $expect_out(0,string)"; exit } "Could not resolve hostname" { send_user "HPiLO hostname: $expect_out(0,string)"; exit } + "Connection timed out" { send_user "HPiLO ssh timeout: $expect_out(0,string)"; exit } "hpiLO-> " { send "cd system1\r" } + eof { send_user "HPiLO early EOF\n"; exit } } expect "hpiLO-> " { send $reset_cmd }