th_traffic_tests.soc (3771B)
1 # 2 # This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 3 # 4 # Copyright 2007-2019 Broadcom Inc. All rights reserved. 5 # 6 # Tomahawk Sanity - traffic tests 7 # 8 # Script to run traffic tests. Will be invoked by nightly regression 9 # infrastructure to verify various TH port configurations. 10 11 # Set run command script not to fail on errors reported by commands 12 # this allows the script to continue if a test fails 13 set rcerror=false 14 15 # Set up test mode: don't stop on errors, show progress on each test 16 tm -stoponerror +progress 17 # Unselect all 18 ts -* 19 20 echo "testsuite: started: sanity" 21 time 'rcload rc.soc' 22 23 # We need to print out port status since any cabling effects results. 24 *:ps 25 26 #Display some useful information 27 date 28 ver 29 soc 30 31 # Re-initialize to clean up of various read/wrires to MMU memories 32 set rct=true 33 rcload rc.soc 34 counter off 35 l2mode off 36 linkscan off 37 memscan off 38 39 #MAC Loopback 40 echo "Testing MAC Loopback - 10 Gb/s all XE ports" 41 tr 18 PortBitMap=xe 42 $done 43 44 echo "Testing MAC Loopback - 100 Gb/s all CE ports" 45 tr 18 PortBitMap=ce 46 $done 47 48 echo "Testing MAC Loopback - 106 Gb/s all HG ports" 49 tr 18 PortBitMap=hg 50 $done 51 52 #PHY Loopback 53 echo "Testing PHY Loopback - 10 Gb/s all XE ports" 54 tr 19 PortBitMap=xe 55 $done 56 57 echo "Testing PHY Loopback - 100 Gb/s all CE ports" 58 tr 19 PortBitMap=ce 59 $done 60 61 echo "Testing PHY Loopback - 106 Gb/s all HG ports" 62 tr 19 PortBitMap=hg 63 $done 64 65 echo "Running MAC loopback V2 on all ports ..." 66 tr 48 PortBitMap=ce,xe 67 $done 68 69 echo "Running PHY loopback V2 on all ports ..." 70 tr 49 PortBitMap=ce,xe 71 $done 72 73 #Internal snake Loopback 74 if !$?BCM56968_A0 && !$?BCM56968_B0 \ 75 'echo "Running internal snake on all ports, MAC loopback ..."; tr 39 LoopbackMode=MAC snakepath=TWOways; $done' 76 77 if !$?BCM56968_A0 && !$?BCM56968_B0 \ 78 'echo "Running internal snake on all ports, PHY loopback ..."; tr 39 LoopbackMode=PHY snakepath=TWOways; $done' 79 80 #Due to the profile management limitation Only support maximum 127 ports for the test; 81 #When there are 128 ports for the TH/TH+. PortSelectMode are uese to choose the 127 ports 82 #PortSelectMode=0(default):use 127 ports begin with firt port in ascending order for the new snake test 83 #PortSelectMode=1: use 127 ports begin with last port in descending order for the new snake test 84 #other PortSelectMode execpt 0 and 1 are invalid 85 if !$?BCM56968_A0 && !$?BCM56968_B0 \ 86 'echo "Running internal snake on all ports, MAC loopback PortSelectMode=1 ..."; tr 39 LoopbackMode=MAC snakepath=TWOways PortSelectMode=1; $done' 87 88 if !$?BCM56968_A0 && !$?BCM56968_B0 \ 89 'echo "Running internal snake on all ports, PHY loopback PortSelectMode=1 ..."; tr 39 LoopbackMode=PHY snakepath=TWOways PortSelectMode=1; $done' 90 91 92 if $?BCM56968_A0 || $?BCM56968_B0 \ 93 'echo "Running internal snake on all XE ports, MAC loopback ..."; tr 39 LoopbackMode=MAC snakepath=TWOways PortBitMap=xe; $done' 94 95 if $?BCM56968_A0 || $?BCM56968_B0 \ 96 'echo "Running internal snake on all XE ports, PHY loopback ..."; tr 39 LoopbackMode=PHY snakepath=TWOways PortBitMap=xe; $done' 97 98 #Traffic Test 99 echo "Running Traffic Test in MAC mode on XE ports..." 100 tr 72 RunMode=MAC PortBitMap=xe 101 $done 102 103 echo "Running Traffic Test in PHY mode on XE ports..." 104 tr 72 RunMode=PHY PortBitMap=xe 105 $done 106 107 echo "Running Traffic Test in MAC mode on CE ports..." 108 tr 72 RunMode=MAC PortBitMap=ce 109 $done 110 111 echo "Running Traffic Test in PHY mode on CE ports..." 112 tr 72 RunMode=PHY PortBitMap=ce 113 $done 114 115 # Show status 116 date 117 tl 118 local returnCode $? 119 120 echo Tests Complete. Reinitializing ... 121 config refresh 122 rcload rc.soc 123 counter off 124 l2mode off 125 126 # We want to show the return code from the tl command which 127 # lists the results. The automated test infrastructure keys off of this 128 # value 129 echo "testsuite: finished: sanity: $returnCode"