diff options
author | Andrew Geissler <andrewg@us.ibm.com> | 2011-11-07 11:51:41 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-11-16 10:56:09 -0600 |
commit | b5e455d063830a51f8282b5c0e857d14dedbaad3 (patch) | |
tree | 2857615f57ca1b56e7a01bb19eefc04ecd865f42 /src/build/hwpf/prcd_compile.tcl | |
parent | b38ef8d4d73eb72e4a2a9b98b046012f3d48ee13 (diff) | |
download | talos-hostboot-b5e455d063830a51f8282b5c0e857d14dedbaad3.tar.gz talos-hostboot-b5e455d063830a51f8282b5c0e857d14dedbaad3.zip |
SCOM Initfile - Check for BSO firewall
- Minor update based on Doug code review comments.
Change-Id: Id71d3478fbd50804f76bbc6676e8854832af2442
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/485
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/build/hwpf/prcd_compile.tcl')
-rwxr-xr-x | src/build/hwpf/prcd_compile.tcl | 53 |
1 files changed, 47 insertions, 6 deletions
diff --git a/src/build/hwpf/prcd_compile.tcl b/src/build/hwpf/prcd_compile.tcl index 184692aa9..744039969 100755 --- a/src/build/hwpf/prcd_compile.tcl +++ b/src/build/hwpf/prcd_compile.tcl @@ -56,9 +56,6 @@ proc mysend { chan val } { puts $chan $val } -#--------------------------------------------------------- -# TBD - No Support Yet -#--------------------------------------------------------- proc telnetResult { telnet } { global telnet_out #puts "Reading $telnet" @@ -75,7 +72,6 @@ proc telnetResult { telnet } { } } - # Wait for p to showup in telnet_out # return 1 if timout else returns 0 proc wait_for { p } { @@ -96,7 +92,7 @@ proc get_fsp_info { fspip fsppassword} { set telnet_out {} # Open telnet session - if {[catch {set telnet [open "|telnet $fspip" r+]} res]} { + if {[catch {set telnet [open "|telnet $fspip" r+]} res]} { puts "Could not telnet to $fspip" return {} } @@ -150,6 +146,45 @@ proc get_fsp_info { fspip fsppassword} { return "$driver:$companion_ip:$nfs_dir" } +proc check_bso { server } { + global telnet_out + set telnet_out {} + + #puts "Input server is $server" + + # Open telnet session + if {[catch {set telnet [open "|telnet $server" r+]} res]} { + puts "Could not telnet to $server" + return {} + } + fconfigure $telnet -buffering none -blocking 0 + + # all output from telnet session captured by telnetResult procedure + # put into telnet_out variable + fileevent $telnet readable [list telnetResult $telnet] + + # Set a timeout of 3 seconds + set timeoutid [after 3000 { + set telnet_out {timeout} + close $telnet + } ] + + while { 1 } { + vwait telnet_out + #puts "OUTPUT: $telnet_out" + if { [string last {BSO} $telnet_out] > 0 } { + puts "BSO Firewall Detected for $server, please authenticate first!" + after cancel $timeoutid + return 1; + } + if { [string compare $telnet_out {timeout}] == 0 } { break } + } + + set telnet_out {} + + return 0 +} + #--------------------------------------------------------- # TBD - No Support Yet #--------------------------------------------------------- @@ -379,6 +414,12 @@ if {[llength $cmds] > 0 } { foreach server $servers { set result "" puts "Trying $server ..." + + # Check for BSO firewall + if {[check_bso $server]} { + exit -1 + } + if {[catch {set sockid [socket $server 7779] } res ] } { set result " $res" puts $result @@ -390,7 +431,7 @@ if {[llength $cmds] > 0 } { # to the server, waiting for a :DONE between each one. ########################################################## # Note that currently we only support fapiTestHwp.C and .H as input - if {$result == ""} { + if {$result == ""} { puts "Connected to $server - Starting Compile" foreach cmd $cmds { if {[info exists verbose]} {puts "Send to hw procedure compiler: $cmd"} |