|
Packit |
857059 |
# BEGIN_ICS_COPYRIGHT8 ****************************************
|
|
Packit |
857059 |
#
|
|
Packit |
857059 |
# Copyright (c) 2015, Intel Corporation
|
|
Packit |
857059 |
#
|
|
Packit |
857059 |
# Redistribution and use in source and binary forms, with or without
|
|
Packit |
857059 |
# modification, are permitted provided that the following conditions are met:
|
|
Packit |
857059 |
#
|
|
Packit |
857059 |
# * Redistributions of source code must retain the above copyright notice,
|
|
Packit |
857059 |
# this list of conditions and the following disclaimer.
|
|
Packit |
857059 |
# * Redistributions in binary form must reproduce the above copyright
|
|
Packit |
857059 |
# notice, this list of conditions and the following disclaimer in the
|
|
Packit |
857059 |
# documentation and/or other materials provided with the distribution.
|
|
Packit |
857059 |
# * Neither the name of Intel Corporation nor the names of its contributors
|
|
Packit |
857059 |
# may be used to endorse or promote products derived from this software
|
|
Packit |
857059 |
# without specific prior written permission.
|
|
Packit |
857059 |
#
|
|
Packit |
857059 |
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
Packit |
857059 |
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
Packit |
857059 |
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
Packit |
857059 |
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
|
Packit |
857059 |
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
Packit |
857059 |
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
Packit |
857059 |
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
Packit |
857059 |
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
Packit |
857059 |
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
Packit |
857059 |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit |
857059 |
#
|
|
Packit |
857059 |
# END_ICS_COPYRIGHT8 ****************************************
|
|
Packit |
857059 |
|
|
Packit |
857059 |
# [ICS VERSION STRING: unknown]
|
|
Packit |
857059 |
|
|
Packit |
857059 |
# This is an expect (tcl) library of procedures to aid install testing
|
|
Packit |
857059 |
|
|
Packit |
857059 |
## tcl procedures to support testing of install:
|
|
Packit |
857059 |
## =============================================
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc install_cleanup { } {
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## install_cleanup
|
|
Packit |
857059 |
## -------------------
|
|
Packit |
857059 |
## cleanup temp files and logs in preparation for a new install scenario
|
|
Packit |
857059 |
## during an rlogin session
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## Usage:
|
|
Packit |
857059 |
## install_cleanup
|
|
Packit |
857059 |
## Additional Information:
|
|
Packit |
857059 |
## Must have run target_rlogin and target_su before this
|
|
Packit |
857059 |
## Returns:
|
|
Packit |
857059 |
## 0 - success
|
|
Packit |
857059 |
## -code error on failure
|
|
Packit |
857059 |
|
|
Packit |
857059 |
unix_cmd 60 0 "rm -f /var/log/ics_ib.log"
|
|
Packit |
857059 |
unix_cmd 60 0 "rm -f /var/log/opa.log"
|
|
Packit |
857059 |
unix_cmd 60 0 "rm -f /var/log/opamon"
|
|
Packit |
857059 |
unix_cmd 200 0 "rm -rf IntelOPA-Basic.*"
|
|
Packit |
857059 |
unix_cmd 200 0 "rm -rf IntelOPA-IFS.*"
|
|
Packit |
857059 |
unix_cmd 200 0 "rm -rf IntelOPA-Tools*"
|
|
Packit |
857059 |
unix_cmd 200 0 "rm -rf IntelOPA-Tests.*"
|
|
Packit |
857059 |
unix_cmd 60 0 "rm -rf /tmp/opa.log.len /tmp/ics_ib.log.len"
|
|
Packit |
857059 |
|
|
Packit |
857059 |
return 0
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc install_saveloglen { } {
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## install_saveloglen
|
|
Packit |
857059 |
## -------------------
|
|
Packit |
857059 |
## save log length for use to verify install results
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## Usage:
|
|
Packit |
857059 |
## install_saveloglen
|
|
Packit |
857059 |
## Additional Information:
|
|
Packit |
857059 |
## Must have run target_rlogin and target_su before this
|
|
Packit |
857059 |
## Returns:
|
|
Packit |
857059 |
## 0 - success
|
|
Packit |
857059 |
## -code error on failure
|
|
Packit |
857059 |
|
|
Packit |
857059 |
foreach log {/var/log/opa.log /var/log/ics_ib.log} {
|
|
Packit |
857059 |
set log_len "/tmp/[exec basename $log].len"
|
|
Packit |
857059 |
# use sed to get rid of white space
|
|
Packit |
857059 |
unix_cmd 60 0 "cat $log 2>/dev/null|wc -l | sed -e 's/\[ \\t]//g' > $log_len"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
return 0
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc install_rmloglen { } {
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## install_rmloglen
|
|
Packit |
857059 |
## -------------------
|
|
Packit |
857059 |
## remove log length files created by install_saveloglen
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## Usage:
|
|
Packit |
857059 |
## install_rmloglen
|
|
Packit |
857059 |
## Additional Information:
|
|
Packit |
857059 |
## Must have run target_rlogin and target_su before this
|
|
Packit |
857059 |
## Returns:
|
|
Packit |
857059 |
## 0 - success
|
|
Packit |
857059 |
## -code error on failure
|
|
Packit |
857059 |
|
|
Packit |
857059 |
unix_cmd 60 0 "rm -f /tmp/opa.log.len"
|
|
Packit |
857059 |
unix_cmd 60 0 "rm -f /tmp/ics_ib.log.len"
|
|
Packit |
857059 |
|
|
Packit |
857059 |
return 0
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc install_expect_drivers { driver_list { skip_done 0 }} {
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## install_expect_drivers
|
|
Packit |
857059 |
## ----------------------
|
|
Packit |
857059 |
## Check the proper drivers are loaded during an rlogin session
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## Usage:
|
|
Packit |
857059 |
## install_expect_drivers driver_list [skip_done]
|
|
Packit |
857059 |
## Arguments:
|
|
Packit |
857059 |
## driver_list - list of drivers/ULP names
|
|
Packit |
857059 |
## skip_done - skip wait for 'Done Installing IB' message
|
|
Packit |
857059 |
## 0=wait for message
|
|
Packit |
857059 |
## 1=don't wait for message, default is 0
|
|
Packit |
857059 |
## Returns:
|
|
Packit |
857059 |
## 0 - success
|
|
Packit |
857059 |
## -code error on failure
|
|
Packit |
857059 |
## Additional Information:
|
|
Packit |
857059 |
## Does not care what order the drivers are loaded in
|
|
Packit |
857059 |
|
|
Packit |
857059 |
expect_progress 600 { "Preparing" "Building" } { "Installing" {OPA Software} } {
|
|
Packit |
857059 |
"Unable"
|
|
Packit |
857059 |
"Error"
|
|
Packit |
857059 |
"Failure"
|
|
Packit |
857059 |
"invalid"
|
|
Packit |
857059 |
"Usage"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
set list {}
|
|
Packit |
857059 |
foreach driver $driver_list {
|
|
Packit |
857059 |
lappend list "Installing $driver"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
if { "$list" != "" } {
|
|
Packit |
857059 |
# allow 5 minutes per Driver
|
|
Packit |
857059 |
expect_progress_orderless 300 { "Preparing" "Building" "installing" "Updating" "Copying" } 0 $list {
|
|
Packit |
857059 |
"Unable"
|
|
Packit |
857059 |
"Error"
|
|
Packit |
857059 |
"Failure"
|
|
Packit |
857059 |
"invalid"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
if { ! $skip_done } {
|
|
Packit |
857059 |
# "Unable" message could occur if A0 HCA being installed
|
|
Packit |
857059 |
# allow some extra time for depmod and firmware update
|
|
Packit |
857059 |
# firmware update can be slow on MAC or if pciconf1 device is used
|
|
Packit |
857059 |
expect_progress 300 { {[0-9]} "---" "Updating" "Copying" "installing" } { {Done Installing OPA} } {
|
|
Packit |
857059 |
"Error"
|
|
Packit |
857059 |
"Failure"
|
|
Packit |
857059 |
"invalid"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
return 0
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc install_uninstall { {uninstall 1} {remove_config 0} { dir "" } } {
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## install_uninstall
|
|
Packit |
857059 |
## -----------------
|
|
Packit |
857059 |
## uninstall any existing version of IB software on the system during an rlogin session
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## Usage:
|
|
Packit |
857059 |
## install_uninstall [ uninstall [remove_config [dir]] ]
|
|
Packit |
857059 |
## Arguments:
|
|
Packit |
857059 |
## uninstall - should existing installation be uninstalled, default is yes
|
|
Packit |
857059 |
## remove_config - should existing config files be removed, default is no
|
|
Packit |
857059 |
## dir - directory to find uninstall in (default is to only use
|
|
Packit |
857059 |
## opaconfig/ics_ib)
|
|
Packit |
857059 |
## Returns:
|
|
Packit |
857059 |
## 0 - success
|
|
Packit |
857059 |
## -code error on failure
|
|
Packit |
857059 |
|
|
Packit |
857059 |
set toolsdir /usr/lib/opa/tools
|
|
Packit |
857059 |
|
|
Packit |
857059 |
if { $uninstall } {
|
|
Packit |
857059 |
# use ics_ib to remove if possible
|
|
Packit |
857059 |
unix_cmd 240 "" {if [ -f /sbin/opaconfig ]; then /sbin/opaconfig -u; elif [ -f /sbin/ics_ib ]; then /sbin/ics_ib -u; fi }
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
if { $uninstall && "$dir" != "" } {
|
|
Packit |
857059 |
unix_cmd 240 "" "test -d $dir && (cd $dir; ./INSTALL -u )"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
if { $remove_config } {
|
|
Packit |
857059 |
set target_os_type [target_get_os_type]
|
|
Packit |
857059 |
|
|
Packit |
857059 |
unix_cmd 60 "" {rm -rf /etc/opa /etc/sysconfig/ipoib.cfg /etc/sysconfig/ics_srp.cfg /etc/sysconfig/ics_inic.cfg /etc/sysconfig/mpi.param /etc/sysconfig/mpi.param.safe /etc/sysconfig/mpi.param.microbench $toolsdir/opafastfabric.conf /etc/dat.conf}
|
|
Packit |
857059 |
unix_cmd 60 "" {rm -rf /etc/opa-fm/opafm.xml /etc/infiniband/openib.conf /etc/opamon.conf}
|
|
Packit |
857059 |
unix_cmd 60 "" {rm -rf /etc/sysconfig/network-scripts/ifcfg-eioc[0-9]* /etc/sysconfig/network-scripts/ifcfg-ib[0-9]*}
|
|
Packit |
857059 |
unix_cmd 60 "" {rm -rf /etc/sysconfig/network/ifcfg-eioc[0-9]* /etc/sysconfig/network/ifcfg-ib[0-9]*}
|
|
Packit |
857059 |
unix_cmd 60 "" {rm -rf /etc/dapl}
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
return 0
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc install_getready { target {uninstall 1} { remove_config 0 } { cleanup 1 } { dir "" }} {
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## install_getready
|
|
Packit |
857059 |
## ----------------
|
|
Packit |
857059 |
## prepare for an install test by login'ing
|
|
Packit |
857059 |
## cleaning up from any prior install, uninstalling any prior software
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## Usage:
|
|
Packit |
857059 |
## install_getready target [uninstall [remove_config [cleanup [dir] ]]]
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## Arguments:
|
|
Packit |
857059 |
## target - hostname to rlogin to
|
|
Packit |
857059 |
## uninstall - should existing installation be uninstalled, default is yes
|
|
Packit |
857059 |
## remove_config - should existing config files be removed, default is no
|
|
Packit |
857059 |
## cleanup - should existing installation files and install logs be removed, default is yes
|
|
Packit |
857059 |
## dir - directory to find uninstall in (default is to only use
|
|
Packit |
857059 |
## opaconfig/ics_ib)
|
|
Packit |
857059 |
## Returns:
|
|
Packit |
857059 |
## 0 - success
|
|
Packit |
857059 |
## -code error om failure
|
|
Packit |
857059 |
## Additional Information:
|
|
Packit |
857059 |
## setup file is sent to /tmp/mysetup.stp
|
|
Packit |
857059 |
|
|
Packit |
857059 |
global env
|
|
Packit |
857059 |
|
|
Packit |
857059 |
# become root user on target system
|
|
Packit |
857059 |
target_root_sh $target
|
|
Packit |
857059 |
|
|
Packit |
857059 |
install_uninstall $uninstall $remove_config $dir
|
|
Packit |
857059 |
|
|
Packit |
857059 |
if { $cleanup } {
|
|
Packit |
857059 |
install_cleanup
|
|
Packit |
857059 |
} else {
|
|
Packit |
857059 |
install_saveloglen
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
return 0
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc install_all { target drivers {uninstall 1} {remove_config 0 } {cleanup 1} {cd_device ""} {release ""} { install_opt "-a" } { from_dir "." } {product "IntelOPA-Basic"}} {
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## install_all
|
|
Packit |
857059 |
## -----------------
|
|
Packit |
857059 |
## perform a basic installation of all drivers
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## Usage:
|
|
Packit |
857059 |
## install_all target drivers [uninstall [remove_config [cleanup [cd_device [release [install_opt [from_dir]]]]]]]
|
|
Packit |
857059 |
## Arguments:
|
|
Packit |
857059 |
## target - hostname to rlogin to
|
|
Packit |
857059 |
## drivers - list of driver names expected to be installed
|
|
Packit |
857059 |
## uninstall - should existing installation be uninstalled, default is yes
|
|
Packit |
857059 |
## remove_config - should existing config files be removed, default is no
|
|
Packit |
857059 |
## cleanup - should existing installation files and install logs be removed, default is yes
|
|
Packit |
857059 |
## cd_device - CD device to load from, default is ftp from get_ftp_dir
|
|
Packit |
857059 |
## release - if ! "", scp $product.$release.tgz to target and install
|
|
Packit |
857059 |
## install_opt - install options, default is "-a"
|
|
Packit |
857059 |
## from_dir - where to get $product.*.tgz for scp install
|
|
Packit |
857059 |
## Returns:
|
|
Packit |
857059 |
## 0 - success
|
|
Packit |
857059 |
## -code error on failure
|
|
Packit |
857059 |
## Additional Information:
|
|
Packit |
857059 |
## This establishes and closes an rlogin session
|
|
Packit |
857059 |
|
|
Packit |
857059 |
global env
|
|
Packit |
857059 |
|
|
Packit |
857059 |
if { "$cd_device" == "" && "$release" == "" } {
|
|
Packit |
857059 |
# will untar below into this directory
|
|
Packit |
857059 |
set dir [get_install_dir "$product"]
|
|
Packit |
857059 |
} elseif { "$cd_device" != "" } {
|
|
Packit |
857059 |
set dir $cd_device
|
|
Packit |
857059 |
} else {
|
|
Packit |
857059 |
log_message "scp $from_dir/$product.$release.tgz root@\[$target\]:"
|
|
Packit |
857059 |
if { [ catch { exec scp $from_dir/$product.$release.tgz root@\[$target\]: } err_str2 ] != 0 } {
|
|
Packit |
857059 |
error "scp $from_dir/$product.$release.tgz root@\[$target\]: failed: $err_str2"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
set dir $product.$release
|
|
Packit |
857059 |
# can't cleanup, will remove the file we just copied
|
|
Packit |
857059 |
set cleanup 0
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
install_getready $target $uninstall $remove_config $cleanup $dir
|
|
Packit |
857059 |
|
|
Packit |
857059 |
if { "$cd_device" == "" && "$release" == "" } {
|
|
Packit |
857059 |
if { ! [ info exists env(CFG_FTP_SERVER) ]
|
|
Packit |
857059 |
|| "$env(CFG_FTP_SERVER)" == ""} {
|
|
Packit |
857059 |
fail_test "Release version not specified"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
# Fast Fabric always sets release and sets CFG_FTP_SERVER=""
|
|
Packit |
857059 |
# hence for fast fabric we never use ftp
|
|
Packit |
857059 |
set release [get_release]
|
|
Packit |
857059 |
scp_get_file "$env(CFG_SCP_SERVER)" "$env(CFG_SCP_USERID)" "[get_ftp_dir $target]/$product.$release.tgz" "$product.$release.tgz"
|
|
Packit |
857059 |
send_unix_cmd "tar xvfz $product.$release.tgz; echo DONE"
|
|
Packit |
857059 |
expect_progress 120 { "doc" "include" "config" "bin" "lib" } { "echo DONE" "DONE" } { "Error " "No such" }
|
|
Packit |
857059 |
check_exit_status 360 0
|
|
Packit |
857059 |
} elseif { "$cd_device" == "" && "$release" != "" } {
|
|
Packit |
857059 |
unix_cmd 200 0 "rm -rf $product.$release"
|
|
Packit |
857059 |
send_unix_cmd "tar xvfz $product.$release.tgz; echo DONE"
|
|
Packit |
857059 |
expect_progress 120 { "doc" "include" "config" "bin" "lib" } { "echo DONE" "DONE" } { "Error " "No such" }
|
|
Packit |
857059 |
check_exit_status 360 0
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
unix_cmd 60 0 "cd $dir"
|
|
Packit |
857059 |
send_unix_cmd "./INSTALL $install_opt"
|
|
Packit |
857059 |
|
|
Packit |
857059 |
set_timeout 60
|
|
Packit |
857059 |
|
|
Packit |
857059 |
install_expect_drivers "$drivers"
|
|
Packit |
857059 |
|
|
Packit |
857059 |
check_exit_status 60 0
|
|
Packit |
857059 |
|
|
Packit |
857059 |
install_check_logs
|
|
Packit |
857059 |
|
|
Packit |
857059 |
install_rmloglen
|
|
Packit |
857059 |
|
|
Packit |
857059 |
child_cleanup
|
|
Packit |
857059 |
|
|
Packit |
857059 |
return 0
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc install_check_logs { { log_list { /var/log/ics_ib.log /var/log/opa.log } } { retcode "1" } } {
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## install_check_logs
|
|
Packit |
857059 |
## -----------------
|
|
Packit |
857059 |
## check there are no errors or warnings in the installation log
|
|
Packit |
857059 |
## during an rlogin session
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## Usage:
|
|
Packit |
857059 |
## install_check_logs [log_list] [retcode]
|
|
Packit |
857059 |
## Arguments:
|
|
Packit |
857059 |
## log_list - list of log filenames to get, default is opa.log ics_ib.log
|
|
Packit |
857059 |
## retcode - expected return code from egrep, 0=errors/warnings in log
|
|
Packit |
857059 |
## 1=no errors/warnings in log, defaults to 1
|
|
Packit |
857059 |
## Returns:
|
|
Packit |
857059 |
## 0 - success
|
|
Packit |
857059 |
## -code error on failure
|
|
Packit |
857059 |
|
|
Packit |
857059 |
foreach log $log_list {
|
|
Packit |
857059 |
send_unix_cmd "\[ -f $log \];"
|
|
Packit |
857059 |
if { [ get_exit_status 60 ] == 0 } {
|
|
Packit |
857059 |
set log_len "/tmp/[exec basename $log].len"
|
|
Packit |
857059 |
send_unix_cmd "\[ -s $log_len \];"
|
|
Packit |
857059 |
if { [ get_exit_status 60 ] == 0 } {
|
|
Packit |
857059 |
# allow Unable due to message for A0 HCA
|
|
Packit |
857059 |
unix_cmd 60 $retcode "tail -n +`cat $log_len` $log|egrep 'Abort|corrupted|Can not'"
|
|
Packit |
857059 |
} else {
|
|
Packit |
857059 |
unix_cmd 60 $retcode "egrep 'Abort|corrupted|Can not' $log"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
return 0
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc install_getready2 { target } {
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## install_getready2
|
|
Packit |
857059 |
## ----------------
|
|
Packit |
857059 |
## prepare for an install test by login'ing
|
|
Packit |
857059 |
## cleaning up from any prior install
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## Usage:
|
|
Packit |
857059 |
## install_getready2 target
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## Arguments:
|
|
Packit |
857059 |
## target - hostname to rlogin to
|
|
Packit |
857059 |
## Returns:
|
|
Packit |
857059 |
## 0 - success
|
|
Packit |
857059 |
## -code error om failure
|
|
Packit |
857059 |
|
|
Packit |
857059 |
# become root user on target system
|
|
Packit |
857059 |
target_root_sh $target $usercode $password $root_password
|
|
Packit |
857059 |
|
|
Packit |
857059 |
install_cleanup
|
|
Packit |
857059 |
|
|
Packit |
857059 |
return 0
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc install_get_logs { target { log_list { ics_ib.log opa.log } } { log_dir /var/log } } {
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## install_get_logs
|
|
Packit |
857059 |
## ------------------------
|
|
Packit |
857059 |
## Get the various installation log file
|
|
Packit |
857059 |
##
|
|
Packit |
857059 |
## Usage:
|
|
Packit |
857059 |
## install_get_logs target [log_list] [log_dir]
|
|
Packit |
857059 |
## Arguments:
|
|
Packit |
857059 |
## target - hostname to rlogin to
|
|
Packit |
857059 |
## log_list - list of log filenames to get, default is opa.log ics_ib.log
|
|
Packit |
857059 |
## log_dir - directory to get log files from, default is /var/log
|
|
Packit |
857059 |
## Additional Information:
|
|
Packit |
857059 |
## The login session to the target system is terminated to allow an
|
|
Packit |
857059 |
## ftp to occur to transfer the file
|
|
Packit |
857059 |
## This is intended for use as a failure_code handler for test cases
|
|
Packit |
857059 |
## Errors in getting the log files are ignored (in case the logs don't
|
|
Packit |
857059 |
## exist)
|
|
Packit |
857059 |
## The log files gotten are of the form:
|
|
Packit |
857059 |
## $log_dir/$log
|
|
Packit |
857059 |
## where $log is an individual entry in log_list
|
|
Packit |
857059 |
## They are transfered to:
|
|
Packit |
857059 |
## $test_tmp/$log
|
|
Packit |
857059 |
|
|
Packit |
857059 |
global env
|
|
Packit |
857059 |
global test_tmp
|
|
Packit |
857059 |
|
|
Packit |
857059 |
# ignore errors in case the log doesn't exist
|
|
Packit |
857059 |
foreach log $log_list {
|
|
Packit |
857059 |
# cleanup any previous sessions
|
|
Packit |
857059 |
catch { child_cleanup }
|
|
Packit |
857059 |
#catch { ftp_mget_files $target $env(CFG_USERNAME) $env(CFG_PASSWORD) $log_dir $log $test_tmp ascii }
|
|
Packit |
857059 |
catch { exec scp root@\[$target\]:$log_dir/$log $test_tmp/ }
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
# cleanup any previous sessions
|
|
Packit |
857059 |
catch { child_cleanup }
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|