|
Packit Service |
4df8fa |
#!/usr/bin/expect -f
|
|
Packit |
857059 |
# BEGIN_ICS_COPYRIGHT8 ****************************************
|
|
Packit |
857059 |
#
|
|
Packit |
857059 |
# Copyright (c) 2015-2017, 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 |
#=============================================================================#
|
|
Packit |
857059 |
# Test Suite Description:
|
|
Packit |
857059 |
#-----------------------------------------------------------------------------#
|
|
Packit |
857059 |
## reboot
|
|
Packit |
857059 |
## -------
|
|
Packit |
857059 |
## reboot all chassis
|
|
Packit |
857059 |
#=============================================================================#
|
|
Packit |
857059 |
|
|
Packit |
857059 |
# manditory setup
|
|
Packit |
857059 |
log_user 0; # disable detailed logging to stdout
|
|
Packit |
857059 |
|
|
Packit |
857059 |
# uncomment the following to debug the test
|
|
Packit |
857059 |
#strace 20
|
|
Packit |
857059 |
#log_user 1
|
|
Packit |
857059 |
#exp_internal 1
|
|
Packit |
857059 |
#cmd_trace on
|
|
Packit |
857059 |
#strace 4
|
|
Packit |
857059 |
|
|
Packit |
857059 |
set install_exit_code 0
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc suite_setup {} {
|
|
Packit |
857059 |
# example of conditional setup
|
|
Packit |
857059 |
#test_execute {load populate} {
|
|
Packit |
857059 |
#do some installation or configuration stuff
|
|
Packit |
857059 |
#}
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc case_setup {} {
|
|
Packit |
857059 |
# setup to do at start of each test case
|
|
Packit |
857059 |
# Usage:
|
|
Packit |
857059 |
# pass as argument to start_suite
|
|
Packit |
857059 |
# Arguments:
|
|
Packit |
857059 |
# None
|
|
Packit |
857059 |
# This procedure will be run at the start of every test case
|
|
Packit |
857059 |
# It provides an opportunity for uniform cleanup/setup for each test case
|
|
Packit |
857059 |
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc case_cleanup { failed } {
|
|
Packit |
857059 |
# cleanup to do after each test case
|
|
Packit |
857059 |
# Usage:
|
|
Packit |
857059 |
# pass as argument to start_suite
|
|
Packit |
857059 |
# Arguments:
|
|
Packit |
857059 |
# failed - set to 1 if test case failed in which case additional
|
|
Packit |
857059 |
# information/files may be desired in test_tmp
|
|
Packit |
857059 |
# set to 0 if test case passed
|
|
Packit |
857059 |
# This procedure will be run at the end of every test case
|
|
Packit |
857059 |
# It provides an opportunity for uniform cleanup after each test case
|
|
Packit |
857059 |
global env
|
|
Packit |
857059 |
|
|
Packit |
857059 |
test_execute {} {
|
|
Packit |
857059 |
if { $failed } {
|
|
Packit |
857059 |
# could put cleanup here
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
test_suite "fmconfig" "update FM config" "update all chassis FM config
|
|
Packit |
857059 |
FM config File: $env(CFG_FMFILE)
|
|
Packit |
857059 |
Action: $env(CFG_FWACTION)
|
|
Packit |
857059 |
Bootstate: $env(CFG_INSTALL_OPTIONS)
|
|
Packit |
857059 |
File: /usr/lib/opa/tools/chassis_fmconfig.exp" suite_setup noop {
|
|
Packit |
857059 |
global env
|
|
Packit |
857059 |
|
|
Packit |
857059 |
# Global Initializations for Test Suite:
|
|
Packit |
857059 |
# --------------------------------------
|
|
Packit |
857059 |
|
|
Packit |
857059 |
# ADD ANY GLOBAL INITIALIZATION HERE, SUCH AS:
|
|
Packit |
857059 |
# set env(MY_ENV_VAR) value
|
|
Packit |
857059 |
# also validate the environment
|
|
Packit |
857059 |
# if the environment is bad call fail_suite "information" abort_now
|
|
Packit |
857059 |
# abort_now should be 0 if it is safe to proceed and simply ignore all
|
|
Packit |
857059 |
# test_case calls. it should be 1 if that is not possible.
|
|
Packit |
857059 |
|
|
Packit |
857059 |
# Procedures used to support Test Suite:
|
|
Packit |
857059 |
# --------------------------------------
|
|
Packit |
857059 |
|
|
Packit |
857059 |
# The actual test cases:
|
|
Packit |
857059 |
# ----------------------
|
|
Packit |
857059 |
|
|
Packit |
857059 |
if { [ test_case "check" "check config file" "check config to be pushed to all chassis
|
|
Packit |
857059 |
Config File: $env(CFG_FMFILE)
|
|
Packit |
857059 |
File: /usr/lib/opa/tools/chassis_fmconfig.exp" case_setup case_cleanup {
|
|
Packit |
857059 |
puts ""
|
|
Packit |
857059 |
set config_file $env(CFG_FMFILE)
|
|
Packit |
857059 |
check_esm_config "$config_file"
|
|
Packit |
857059 |
} ] } {
|
|
Packit |
857059 |
fail_suite "Invalid Config File"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
# We only get here if the config file supplied is valid
|
|
Packit |
857059 |
parallel chassis $env(CFG_CHASSIS) {
|
|
Packit |
857059 |
set chassis [chassis_strip_slots "$chassis"]
|
|
Packit |
857059 |
|
|
Packit |
857059 |
test_case_push_esm_config "$chassis" "$env(CFG_FMFILE)" "$env(CFG_FWACTION)" "$env(CFG_INSTALL_OPTIONS)"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
}
|