th_sanity.soc (5365B)
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 7 # 8 # Script to run all available tests as quickly as possible. 9 # For testing basic sanity of new drivers, simulators, chips, etc. 10 # Port config assumes few 10G XE ports (including mgmt), 11 # few 100G CE ports and few HG[106] ports. 12 # By default use config: $SDK/rc/config_th_28x100_4x106.bcm 13 14 # Set run command script not to fail on errors reported by commands 15 # this allows the script to continue if a test fails 16 set rcerror=false 17 18 # Set up test mode: don't stop on errors, show progress on each test 19 tm -stoponerror +progress 20 # Unselect all 21 ts -* 22 23 echo "testsuite: started: sanity" 24 time 'rcload rc.soc' 25 counter off 26 l2mode off 27 28 # We need to print out port status since any cabling effects results. 29 *:ps 30 31 if $?1 'local full_test 1' 32 33 # Avoid link messages while testing 34 linkscan off 35 36 init soc 37 local done 'echo " Done"' 38 39 #Display some useful information 40 date 41 ver 42 soc 43 44 #Start Test 45 echo "Running PCI Compliance ..." 46 tr 2 47 $done 48 49 echo "Running PCI S-Channel Buf ..." 50 tr 4 51 $done 52 53 54 echo "Running Register reset defaults ..." 55 tr 1 56 $done 57 58 init soc 59 init misc 60 echo "Running Register read/write ..." 61 tr 3 mask64 62 $done 63 64 rcload rc.soc 65 counter off 66 l2mode off 67 linkscan off 68 memscan off 69 70 echo "Running CPU Benchmarks ..." 71 tr 21 72 $done 73 74 set rct=false 75 echo "Running memory tests ..." 76 if $?tomahawk_plus \ 77 'rcload thplus_memtest.soc' \ 78 else \ 79 'rcload th_memtest.soc' \ 80 81 $done 82 # Re-initialize to clean up of various read/wrires to MMU memories 83 set rct=true 84 rcload rc.soc 85 counter off 86 l2mode off 87 linkscan off 88 memscan off 89 90 echo "Running counter width verification test ..." 91 tr 30 92 $done 93 94 echo "Running counter read/write test ..." 95 tr 31 96 $done 97 98 #Hashing tests - TBD 99 #tr 55 100 101 echo "Running MDIO Linkscan test" 102 tr 60 103 $done 104 105 echo "Testing CPU DMA loopback ..." 106 tr 17 107 $done 108 109 echo "Testing CPU DMA, Scatter/Gather Reload ..." 110 #tr 22 111 $done 112 113 echo "Testing CPU DMA, Scatter/Gather Simple ..." 114 #tr 23 115 $done 116 117 echo "Testing CPU DMA, Scatter/Gather Random ..." 118 #tr 24 119 $done 120 121 #MAC Loopback 122 echo "Testing MAC Loopback - 10 Gb/s all XE ports" 123 tr 18 PortBitMap=xe Speed=10G 124 $done 125 126 echo "Testing MAC Loopback - 100 Gb/s all CE ports" 127 tr 18 PortBitMap=ce Speed=100G 128 $done 129 130 echo "Testing MAC Loopback - 106 Gb/s all HG ports" 131 tr 18 PortBitMap=hg Speed=106G 132 $done 133 134 #PHY Loopback 135 echo "Testing PHY Loopback - 10 Gb/s all XE ports" 136 tr 19 PortBitMap=xe Speed=10G 137 $done 138 139 echo "Testing PHY Loopback - 100 Gb/s all CE ports" 140 tr 19 PortBitMap=ce Speed=100G 141 $done 142 143 echo "Testing PHY Loopback - 106 Gb/s all HG ports" 144 tr 19 PortBitMap=hg Speed=106G 145 $done 146 147 echo "Running MAC loopback V2 on all ports ..." 148 tr 48 PortBitMap=ce,xe 149 $done 150 151 echo "Running PHY loopback V2 on all ports ..." 152 tr 49 PortBitMap=ce,xe 153 $done 154 155 #Internal snake Loopback 156 echo "Running internal snake on all XE ports, MAC loopback ..." 157 tr 39 LoopbackMode=MAC snakepath=TWOways PortBitMap=xe 158 $done 159 160 echo "Running internal snake on all XE ports, PHY loopback ..." 161 tr 39 LoopbackMode=PHY snakepath=TWOways PortBitMap=xe 162 $done 163 164 echo "Running internal snake on all CE ports, MAC loopback ..." 165 tr 39 LoopbackMode=MAC snakepath=TWOways PortBitMap=ce 166 $done 167 168 echo "Running internal snake on all CE ports, PHY loopback ..." 169 tr 39 LoopbackMode=PHY snakepath=TWOways PortBitMap=ce 170 $done 171 172 #Traffic Test 173 echo "Running Traffic Test in MAC mode on CE ports..." 174 tr 72 RunMode=MAC PortBitMap=ce 175 $done 176 177 echo "Running Traffic Test in PHY mode on CE ports..." 178 tr 72 RunMode=PHY PortBitMap=ce 179 $done 180 181 echo "Running Software BUS BUFFER Error Recovery Test ..." 182 linkscan off 183 tr 143 184 $done 185 186 echo "Running Software Error Recovery Test ..." 187 linkscan off 188 tr 144 189 190 # if you have cable with following paring 191 # xe0-xe4, xe1-xe5, xe2-xe6, xe3-xe7 192 # xe8-xe12, xe9-xe13, xe10-xe14, xe11-xe15 193 # ... 194 # xe56-xe60, xe57-xe61, xe58-xe62, xe59-xe63 195 # 196 # tr 72 rm=external pbm=xe0,xe4 an=f sp=10g 197 # tr 72 rm=external pbm=xe1,xe5 an=f sp=10g 198 # tr 72 rm=external pbm=xe2,xe6 an=f sp=10g 199 # tr 72 rm=external pbm=xe3,xe7 an=f sp=10g 200 # tr 72 rm=external pbm=xe8,xe12 an=f sp=10g 201 # tr 72 rm=external pbm=xe9,xe13 an=f sp=10g 202 # tr 72 rm=external pbm=xe10,xe14 an=f sp=10g 203 # tr 72 rm=external pbm=xe11,xe15 an=f sp=10g 204 # ... 205 # tr 72 rm=external pbm=xe56,xe60 an=f sp=10g 206 # tr 72 rm=external pbm=xe57,xe61 an=f sp=10g 207 # tr 72 rm=external pbm=xe58,xe62 an=f sp=10g 208 # tr 72 rm=external pbm=xe59,xe63 an=f sp=10g 209 210 # if you have cable with following paring 211 # xe0-xe4, xe1-xe5, xem-xe6, xe3-xe7 212 # xe8-xe12, xe9-xe13, xe10-xe14, xe11-xe15 213 # ... 214 # xe56-xe60, xe57-xe61, xe58-xe62, xe59-xe63 215 # echo "Running external loopback ..." 216 # tr 20 tpbm=xe0-xe3 di=4 an=f s=10g 217 # tr 20 tpbm=xe8-xe11 di=4 an=f s=10g 218 # tr 20 tpbm=xe16-xe19 di=4 an=f s=10g 219 # tr 20 tpbm=xe24-xe27 di=4 an=f s=10g 220 # tr 20 tpbm=xe32-xe35 di=4 an=f s=10g 221 # tr 20 tpbm=xe40-xe43 di=4 an=f s=10g 222 # tr 20 tpbm=xe48-xe51 di=4 an=f s=10g 223 # tr 20 tpbm=xe56-xe59 di=4 an=f s=10g 224 # $done 225 226 # Show status 227 date 228 tl 229 local returnCode $? 230 231 echo Tests Complete. Reinitializing ... 232 config refresh 233 rcload rc.soc 234 counter off 235 l2mode off 236 237 # We want to show the return code from the tl command which 238 # lists the results. The automated test infrastructure keys off of this 239 # value 240 echo "testsuite: finished: sanity: $returnCode"