|
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 |
#=============================================================================#
|
|
Packit |
857059 |
# Test Suite Description:
|
|
Packit |
857059 |
#-----------------------------------------------------------------------------#
|
|
Packit |
857059 |
## configure
|
|
Packit |
857059 |
## -------
|
|
Packit |
857059 |
## configure 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 |
global chassis
|
|
Packit |
857059 |
# could put cleanup here
|
|
Packit |
857059 |
target_chassis_admin_sh_exit
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
array set ch_config_link_crc {
|
|
Packit |
857059 |
0 "16b"
|
|
Packit |
857059 |
1 "14b_or_16b"
|
|
Packit |
857059 |
2 "48b_or_16b"
|
|
Packit |
857059 |
3 "48b_or_14b_or_16b"
|
|
Packit |
857059 |
4 "per_lane_or_16b"
|
|
Packit |
857059 |
5 "per_lane_or_14b_or_16b"
|
|
Packit |
857059 |
6 "per_lane_or_48b_or_16b"
|
|
Packit |
857059 |
7 "per_lane_or_48b_or_14b_or_16b"
|
|
Packit |
857059 |
-1 "no change"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
array set ch_config_linkwidths {
|
|
Packit |
857059 |
1 1X
|
|
Packit |
857059 |
2 2X
|
|
Packit |
857059 |
3 1X/2X
|
|
Packit |
857059 |
4 3X
|
|
Packit |
857059 |
5 1X/3X
|
|
Packit |
857059 |
6 2X/3X
|
|
Packit |
857059 |
7 1X/2X/3X
|
|
Packit |
857059 |
8 4X
|
|
Packit |
857059 |
9 1X/4X
|
|
Packit |
857059 |
10 2X/4X
|
|
Packit |
857059 |
11 1X/2X/4X
|
|
Packit |
857059 |
12 3X/4X
|
|
Packit |
857059 |
13 1X/3X/4X
|
|
Packit |
857059 |
14 2X/3X/4X
|
|
Packit |
857059 |
15 1X/2X/3X/4X
|
|
Packit |
857059 |
0 "no change"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc ch_get_array_entry { arrayname key } {
|
|
Packit |
857059 |
|
|
Packit |
857059 |
variable $arrayname
|
|
Packit |
857059 |
|
|
Packit |
857059 |
upvar #0 $arrayname myarray
|
|
Packit |
857059 |
|
|
Packit |
857059 |
if {![info exists myarray($key)]} {
|
|
Packit |
857059 |
return "Invalid Input: $key"
|
|
Packit |
857059 |
} else {
|
|
Packit |
857059 |
return $myarray($key)
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc ch_get_ip { ip } {
|
|
Packit |
857059 |
|
|
Packit |
857059 |
if { [string equal "$ip" "0.0.0.0"] == 0 } {
|
|
Packit |
857059 |
return $ip
|
|
Packit |
857059 |
} else {
|
|
Packit |
857059 |
return "not being set"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc ch_get_syslog_facility { facility } {
|
|
Packit |
857059 |
|
|
Packit |
857059 |
if { [string equal "$facility" "-1"] == 0 } {
|
|
Packit |
857059 |
return $facility
|
|
Packit |
857059 |
} else {
|
|
Packit |
857059 |
return "not being set"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc ch_get_syslog_port { port } {
|
|
Packit |
857059 |
|
|
Packit |
857059 |
if { [string equal "$port" "-1"] == 0 } {
|
|
Packit |
857059 |
return $port
|
|
Packit |
857059 |
} else {
|
|
Packit |
857059 |
return "not being set"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc ch_get_tzoffset { offset } {
|
|
Packit |
857059 |
|
|
Packit |
857059 |
if { [string equal "$offset" "100"] == 0 } {
|
|
Packit |
857059 |
return $offset
|
|
Packit |
857059 |
} else {
|
|
Packit |
857059 |
return "not being set"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc ch_get_dst { start end } {
|
|
Packit |
857059 |
|
|
Packit |
857059 |
if { [string equal "$start" "0 0 0"] == 0 } {
|
|
Packit |
857059 |
return "<$start>/<$end>"
|
|
Packit |
857059 |
} else {
|
|
Packit |
857059 |
return "not being set"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
proc ch_get_setname { setname } {
|
|
Packit |
857059 |
|
|
Packit |
857059 |
if { [string equal "$setname" "y"] == 0 } {
|
|
Packit |
857059 |
return "not being set"
|
|
Packit |
857059 |
} else {
|
|
Packit |
857059 |
return "being set to match chassis Ethernet name"
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
test_suite "configure" "configure" "configure all chassis:
|
|
Packit |
857059 |
SYSLOG_SERVER: [ch_get_ip $env(SYSLOG_SERVER)]
|
|
Packit |
857059 |
SYSLOG_PORT: [ch_get_syslog_port $env(SYSLOG_PORT)]
|
|
Packit |
857059 |
SYSLOG_FACILITY: [ch_get_syslog_facility $env(SYSLOG_FACILITY)]
|
|
Packit |
857059 |
NTP_SERVER: [ch_get_ip $env(NTP_SERVER)]
|
|
Packit |
857059 |
TZ_OFFSET: [ch_get_tzoffset $env(TZ_OFFSET)]
|
|
Packit |
857059 |
DST START/END: [ch_get_dst $env(DST_START) $env(DST_END)]
|
|
Packit |
857059 |
LINKWIDTH: [ch_get_array_entry ch_config_linkwidths $env(LINKWIDTH_SETTING)]
|
|
Packit |
857059 |
NODEDESC: [ch_get_setname $env(SET_NAME)]
|
|
Packit |
857059 |
LINKCRCMODE: [ch_get_array_entry ch_config_link_crc $env(LINKCRCMODE)]
|
|
Packit |
857059 |
File: /usr/lib/opa/tools/chassis_configure.exp" suite_setup noop {
|
|
Packit |
857059 |
global chassis
|
|
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 |
parallel chassis $env(CFG_CHASSIS) {
|
|
Packit |
857059 |
set chassis [chassis_strip_slots "$chassis"]
|
|
Packit |
857059 |
local_sh
|
|
Packit |
857059 |
send_unix_cmd "grep $chassis $env(CFG_CFGTEMPDIR)/.chassisSetup.out | grep IP_Addr"
|
|
Packit |
857059 |
set out [expect_list 60 { ": [0-9.]+" } ]
|
|
Packit |
857059 |
regexp {([0-9.]+)} $out c chassisIP
|
|
Packit |
857059 |
local_sh_exit
|
|
Packit |
857059 |
test_case_chassis_configure $chassis $chassisIP
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
}
|