Commit 06bdbec0 authored by Jean-Claude BAU's avatar Jean-Claude BAU

WR switch dot-config configurations

parent a84c07b1
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
dev=0
while getopts d option; do
case "${option}" in
d) dev=1; printf "Development flag set.\n"; sleep 2;;
*) exit 1;;
esac
done
TARGET=${TARGET:-ctdwa-774-cxnatest1}
#Get list of tests
declare -a tags
declare -a names
declare -a ptps
read_config() {
while IFS=' ' read -r -a array; do
if [[ "${array[0]}" != "#"* ]] ; then
if [ "${#array[@]}" == "3" ] ; then
tags+=(${array[0]})
name=`echo ${array[1]}| tr '_-' ' ' `
names+=("${name}")
ptps+=(${array[2]})
fi
fi
done < tests.cfg
}
menu_header() {
clear
printf "#################################################\n"
printf "# switch-release_tests / Target=$TARGET\n"
printf "#################################################\n"
printf "#"
}
run_command() {
local cmd=$1
echo $cmd
eval $cmd
}
wait_target_up() {
until ping -c1 ${TARGET} >/dev/null 2>&1; do :; done
echo ${TARGET} is responding to ping ...
}
kill_ppsi() {
local x=""
while [ "$x" != "/wr/bin/ppsi" ]; do
sleep 5
echo "PPSi NOT yet running on target ...."
x=`ssh root@${TARGET} ps ax | grep -o /wr/bin/ppsi 2>/dev/null`
done
echo "PPSi running on target ($x)"
sleep 3
run_command "ssh root@${TARGET} /etc/init.d/ppsi.sh stop"
}
run_test() {
local idx=$1
local tag=${tags[$idx]}
local name=${names[$idx]}
local ptp=${ptps[$idx]}
local dirLocation="root@${TARGET}:/wr/etc/dot-config"
echo "Running test: $tag $name"
run_command "scp dot-config.$tag $dirLocation"
run_command "ssh root@${TARGET} /sbin/reboot"
sleep 5
wait_target_up
if [ "$ptp" == "n" ] ; then
kill_ppsi
fi
echo "Type enter to continue"
IFS= read -r x
}
menu_main() {
while : ; do
menu_header
printf "Start test \n\n"
for i in "${!tags[@]}"; do
ptpStr=""
if [ "${ptps[$i]}" == "n" ] ; then ptpStr="(PTP off)"; fi
printf " %s) %s\n" "$i" "${tags[$i]} ${names[$i]} $ptpStr"
done
printf " q) quit\n\n"
printf " Choice : "
IFS= read -r opt
if [[ $opt =~ ^[0-9]+$ ]] && (( ($opt >= 0) && ($opt <= "${#tags[@]}") )); then
run_test "$opt"
else
if [ "$opt" == "q" ] ; then
exit 0;
fi
fi
done
}
read_config
menu_main
# TestTag TestName PTP[y/n]
2.1.1 FF_Unicast_one_to_one n
2.1.2 FF_Unicast_many_to_many n
2.2.1 VLAN_limited_forwarding n
2.2.2 VLAN_separation_of_traffic n
2.2.5 VLAN_tagging n
2.2.6 VLAN_untagging n
2.2.7 VLAN_snake n
3.1.1 FP_one_to_one_streams_adjacent_ports n
3.1.1 FP_one_to_one_streams_adjacen_ports y
3.1.2 FP_one_to_one_streams_extreme_ports n
3.1.2 FP_one_to_one_streams_extreme_ports y
3.1.3 FP_Unicast_many_to_many_stream n
3.1.3 FP_Unicast_many_to_many_stream y
3.1.4 FP_VLan_broadcast n
3.1.4 FP_VLan_broadcast y
3.1.5 FP_VLan_broadcast_tagging_untagging n
3.1.5 FP_VLan_broadcast_tagging_untagging y
3.2.1 FP_Snake_Uniformly_distributed_load n
3.2.1 FP_Snake_Uniformly_distributed_load y
3.2.2 FP_Snake_Not_Uniformly_distributed_load n
3.2.2 FP_Snake_Not_Uniformly_distributed_load y
3.3.1 FP_FrameStormes_Unicast n
3.3.1 FP_FrameStormes_Unicast y
3.3.2 FP_FrameStormes_VLAN_Bdcast_tag/untag n
3.3.2 FP_FrameStormes_VLAN_Bdcast_tag/untag y
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment