dsanity.soc (10897B)
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 # Script to run all available tests as quickly as possible. 7 # For testing basic sanity of new drivers, simulators, chips, etc. 8 # 9 # Avoid link messages while testing 10 11 echo "testsuite: started: sanity" 12 # We need to print out port status since any cabling effects results. 13 *:ps 14 15 linkscan off 16 17 # Use expected COS configuration for test 18 config add bcm_num_cos=4 19 20 init 21 init misc 22 23 local done 'echo " Done"' 24 25 # Set run command script not to fail on errors reported by commands 26 # this allows the script to continue if a test fails 27 set rcerror=false 28 29 # Set up test mode: don't stop on errors, show progress on each test 30 tm -stoponerror +progress 31 # Unselect all 32 ts -* 33 34 # Tests Start Here 35 36 echo Running CPU benchmarks ... 37 tr 21 38 $done 39 40 echo Running PCI tests ... 41 tr 2 42 $done 43 44 echo Running register tests ... 45 tr 3 46 $done 47 48 echo Running S-Channel message buffer test ... 49 tr 4 50 $done 51 52 # Note: Memories that are on the same line cannot be BISTed independently 53 if !$?drac15 \ 54 "echo Running BIST on all tables ...; \ 55 init; \ 56 echo \" DEF_IP_HI\"; bist DEF_IP_HI; \ 57 echo \" DEF_IP_LO\"; bist DEF_IP_LO; \ 58 echo \" L2_TABLE\"; bist L2_TABLE; \ 59 echo \" L2MC_TABLE VLAN_STG L3_IPMC\"; \ 60 bist L2MC_TABLE VLAN_STG L3_IPMC; \ 61 echo \" L3INTF VLAN\"; bist L3INTF VLAN; \ 62 echo \" GIMASK GIRULE\"; bist GIMASK GIRULE;\ 63 echo \" CBPDATA0\"; bist CBPDATA0; \ 64 echo \" CBPDATA1\"; bist CBPDATA1; \ 65 echo \" CBPDATA2\"; bist CBPDATA2; \ 66 echo \" CBPDATA3\"; bist CBPDATA3; \ 67 echo \" CBPHEADER\"; bist CBPHEADER; \ 68 echo \" CCP CFAP\"; bist CCP CFAP; \ 69 echo \" XQ 0-13\"; \ 70 bist XQ0 XQ1 XQ2 XQ3 XQ4 XQ5 XQ6 XQ7 XQ8 XQ9 XQ10 XQ11 XQ12 XQ13; \ 71 init" 72 $done 73 74 echo Running Switching Memory tests 75 # Note: Switching memory tests automatically put MMU in debug mode 76 77 echo " DEF_IP_HI"; tr 50 m=DEF_IP_HI; tr 51 m=DEF_IP_HI 78 echo " DEF_IP_HIT_HI"; tr 50 m=DEF_IP_HIT_HI; tr 51 m=DEF_IP_HIT_HI 79 echo " DEF_IP_HIT_LO"; tr 50 m=DEF_IP_HIT_LO; tr 51 m=DEF_IP_HIT_LO 80 if !$?drac15 \ 81 "echo \" DEF_IP_LO\"; tr 50 m=DEF_IP_LO; tr 51 m=DEF_IP_LO" 82 echo " EGRESS_MASK"; tr 50 m=EGRESS_MASK; tr 51 m=EGRESS_MASK 83 echo " GFFPCOUNTERS"; tr 50 m=GFFPCOUNTERS; tr 51 m=GFFPCOUNTERS 84 echo " GFFPPACKETCOUNTERS"; tr 50 m=GFFPPACKETCOUNTERS 85 tr 51 m=GFFPPACKETCOUNTERS 86 echo " GIMASK"; tr 50 m=GIMASK; tr 51 m=GIMASK 87 echo " GIRULE"; tr 50 m=GIRULE; tr 51 m=GIRULE 88 echo " GMETERING"; tr 50 m=GMETERING; tr 51 m=GMETERING 89 echo " L2_TABLE"; tr 50 m=L2_TABLE; tr 51 m=L2_TABLE 90 echo " L2_HIT_BITS"; tr 50 m=L2_HIT_BITS; tr 51 m=L2_HIT_BITS 91 echo " L2MC_TABLE"; tr 50 m=L2MC_TABLE; tr 51 m=L2MC_TABLE 92 echo " L2_STATIC_BITS"; tr 50 m=L2_STATIC_BITS; tr 51 m=L2_STATIC_BITS 93 echo " L2_VALID_BITS"; tr 50 m=L2_VALID_BITS; tr 51 m=L2_VALID_BITS 94 echo " L3_TABLE"; tr 50 m=L3_TABLE; tr 51 m=L3_TABLE 95 echo " L3_HIT_BITS"; tr 50 m=L3_HIT_BITS; tr 51 m=L3_HIT_BITS 96 echo " L3_VALID_BITS"; tr 50 m=L3_VALID_BITS; tr 51 m=L3_VALID_BITS 97 echo " L3INTF"; tr 50 m=L3INTF; tr 51 m=L3INTF 98 echo " L3_IPMC"; tr 50 m=L3_IPMC; tr 51 m=L3_IPMC 99 echo " PORT_MAC_BLOCK"; tr 50 m=PORT_MAC_BLOCK; tr 51 m=PORT_MAC_BLOCK 100 echo " PORT"; tr 50 m=PORT; tr 51 m=PORT 101 echo " VLAN_STG"; tr 50 m=VLAN_STG; tr 51 m=VLAN_STG 102 echo " TRUNK_BITMAP"; tr 50 m=TRUNK_BITMAP; tr 51 m=TRUNK_BITMAP 103 echo " PORT_TRUNK_EGRESS"; tr 50 m=PORT_TRUNK_EGRESS 104 tr 51 m=PORT_TRUNK_EGRESS 105 echo " TRUNK_GROUP"; tr 50 m=TRUNK_GROUP; tr 51 m=TRUNK_GROUP 106 echo " VLAN"; tr 50 m=VLAN; tr 51 m=VLAN 107 if $?drac15 \ 108 "echo \" DSCP\"; tr 50 m=DSCP; tr 51 m=DSCP; \ 109 echo \" L3_ECMP\"; tr 50 m=L3_ECMP; tr 51 m=L3_ECMP; \ 110 echo \" IPMC_GROUP\"; tr 50 m=IPMC_GROUP; tr 51 m=IPMC_GROUP; \ 111 echo \" IPMC_VLAN\"; tr 50 m=IPMC_VLAN; tr 51 m=IPMC_VLAN; \ 112 echo \" VLAN_DATA\"; tr 50 m=VLAN_DATA; tr 51 m=VLAN_DATA; \ 113 echo \" VLAN_MAC\"; tr 50 m=VLAN_MAC; tr 51 m=VLAN_MAC; \ 114 echo \" VLAN_MAC_VALID\"; \ 115 tr 50 m=VLAN_MAC_VALID; \ 116 tr 51 m=VLAN_MAC_VALID; \ 117 echo \" VLAN_PROTOCOL\"; \ 118 tr 50 m=VLAN_PROTOCOL; \ 119 tr 51 m=VLAN_PROTOCOL; \ 120 echo \" VLAN_SUBNET\"; tr 50 m=VLAN_SUBNET; tr 51 m=VLAN_SUBNET" 121 echo " CBPDATA 0-3"; tr 50 m=CBPDATA0; tr 51 m=CBPDATA0 122 tr 50 m=CBPDATA1; tr 51 m=CBPDATA1 123 tr 50 m=CBPDATA2; tr 51 m=CBPDATA2 124 tr 50 m=CBPDATA3; tr 51 m=CBPDATA3 125 echo " CBPHEADER"; tr 50 m=CBPHEADER; tr 51 m=CBPHEADER 126 echo " CCP"; tr 50 m=CCP; tr 51 m=CCP 127 echo " CFAP"; tr 50 m=CFAP; tr 51 m=CFAP 128 if $?feature_ipmc_lookup \ 129 "echo \" EGR_TRUNK_MAP\"; \ 130 tr 50 m=EGR_TRUNK_MAP; tr 51 m=EGR_TRUNK_MAP; \ 131 echo \" SRC_TRUNK_MAP\"; \ 132 tr 50 m=SRC_TRUNK_MAP; tr 51 m=SRC_TRUNK_MAP" 133 if $?feature_mstp_lookup \ 134 "echo \" MSTP_TBL\"; tr 50 m=MSTP_TBL; tr 51 m=MSTP_TBL; \ 135 echo \" ST_PORT_TBL\"; tr 50 m=ST_PORT_TBL; tr 51 m=ST_PORT_TBL" 136 echo " XQ 0-13" 137 for xq=0,13 'tr 50 m=XQ$xq; tr 51 m=XQ$xq' 138 $done 139 140 echo Running Table DMA Tests 141 # Specify a zero count for each test to indicate entire memory. 142 # Otherwise the count from the previous invocation is used. 143 echo " DEF_IP_HI"; tr 71 m=DEF_IP_HI c=0 144 echo " DEF_IP_HIT_HI"; tr 71 m=DEF_IP_HIT_HI c=0 145 echo " DEF_IP_HIT_LO"; tr 71 m=DEF_IP_HIT_LO c=0 146 if !$?drac15 \ 147 "echo \" DEF_IP_LO\"; tr 71 m=DEF_IP_LO c=0" 148 echo " EGRESS_MASK"; tr 71 m=EGRESS_MASK c=0 149 if $?feature_ipmc_lookup \ 150 "echo \" EGR_TRUNK_MAP\"; \ 151 tr 71 m=EGR_TRUNK_MAP c=1" 152 echo " GFFPCOUNTERS"; tr 71 m=GFFPCOUNTERS c=0 153 echo " GFFPPACKETCOUNTERS"; tr 71 m=GFFPPACKETCOUNTERS c=0 154 echo " GMETERING"; tr 71 m=GMETERING c=0 155 echo " L2_TABLE"; tr 71 m=L2_TABLE c=0 156 echo " L2_HIT_BITS"; tr 71 m=L2_HIT_BITS c=0 157 echo " L2MC_TABLE"; tr 71 m=L2MC_TABLE c=0 158 echo " L2_STATIC_BITS"; tr 71 m=L2_STATIC_BITS c=0 159 echo " L2_VALID_BITS"; tr 71 m=L2_VALID_BITS c=0 160 echo " L3_TABLE"; tr 71 m=L3_TABLE c=0 161 echo " L3_HIT_BITS"; tr 71 m=L3_HIT_BITS c=0 162 echo " L3_VALID_BITS"; tr 71 m=L3_VALID_BITS c=0 163 echo " L3INTF"; tr 71 m=L3INTF c=0 164 echo " L3_IPMC"; tr 71 m=L3_IPMC c=0 165 if $?feature_mstp_lookup \ 166 "echo \" MSTP_TBL\"; tr 71 m=MSTP_TBL c=1" 167 echo " PORT_MAC_BLOCK"; tr 71 m=PORT_MAC_BLOCK c=0 168 echo " PORT"; tr 71 m=PORT c=0 169 if $?feature_ipmc_lookup \ 170 "echo \" SRC_TRUNK_MAP\"; tr 71 m=SRC_TRUNK_MAP c=1" 171 if $?feature_mstp_lookup \ 172 "echo \" ST_PORT_TBL\"; tr 71 m=ST_PORT_TBL c=1" 173 echo " VLAN_STG"; tr 71 m=VLAN_STG c=0 174 echo " TRUNK_BITMAP"; tr 71 m=TRUNK_BITMAP c=0 175 echo " PORT_TRUNK_EGRESS"; tr 71 m=PORT_TRUNK_EGRESS c=0 176 echo " TRUNK_GROUP"; tr 71 m=TRUNK_GROUP c=0 177 echo " VLAN"; tr 71 m=VLAN c=0 178 if $?drac15 \ 179 "echo \" DSCP\"; tr 71 m=DSCP c=0; \ 180 echo \" L3_ECMP\"; tr 71 m=L3_ECMP c=0; \ 181 echo \" IPMC_VLAN\"; tr 71 m=IPMC_VLAN c=0; \ 182 echo \" VLAN_DATA\"; tr 71 m=VLAN_DATA c=0; \ 183 echo \" VLAN_MAC\"; tr 71 m=VLAN_MAC c=0; \ 184 echo \" VLAN_MAC_VALID\"; \ 185 tr 71 m=VLAN_MAC_VALID c=0; \ 186 echo \" VLAN_PROTOCOL\"; \ 187 tr 71 m=VLAN_PROTOCOL c=0; \ 188 echo \" VLAN_SUBNET\"; \ 189 tr 71 m=VLAN_SUBNET c=0;" 190 $done 191 192 # Re-initialize to clean up of various read/writes to MMU memories 193 rcload rc.soc 194 linkscan off 195 196 echo Running counter width verification test ... 197 tr 30 198 $done 199 200 echo Running counter read/write test ... 201 tr 31 202 $done 203 204 echo Running L2 insert/delete/lookup test ... 205 tr 32 206 $done 207 208 echo Running L2 overflow insert test ... 209 tr 33 210 $done 211 212 echo Running L2 hash test ... 213 tr 34 214 $done 215 216 echo Running L2 delete by port test ... 217 tr 35 218 $done 219 220 echo Running L2 delete by vlan test ... 221 tr 36 222 $done 223 224 echo Running L3 overflow insert test ... 225 tr 37 226 $done 227 228 echo Running L3 hash test ... 229 tr 38 230 $done 231 232 echo Running MDIO Linkscan test 233 tr 60 readcount=10000 234 $done 235 236 # Loopback Tests 237 # Each test loads rc.soc in case a previous test failed 238 239 echo Testing CPU DMA loopback ... 240 tr 17 c=5 241 $done 242 243 echo Testing CPU DMA, Scatter/Gather Reload ... 244 tr 22 245 $done 246 247 echo Testing CPU DMA, Scatter/Gather Simple ... 248 tr 23 249 $done 250 251 echo Testing CPU DMA, Scatter/Gather Random ... 252 tr 24 253 $done 254 255 #--------- MAC Loopback --------- 256 257 echo Testing MAC Loopback - 10 Mb/s all GE ports 258 tr 18 pbm=ge speed=10 259 260 echo Testing MAC Loopback - 100 Mb/s all GE ports 261 tr 18 pbm=ge speed=100 262 263 echo Testing MAC Loopback - 1000 Mb/s all GE ports 264 tr 18 pbm=ge speed=1000 265 266 echo Testing MAC Loopback - 10000 Mb/s all HG ports 267 tr 18 pbm=hg speed=10G 268 269 $done 270 271 #--------- PHY Loopback --------- 272 273 echo Testing PHY Loopback - 10 Mb/s all GE ports 274 tr 19 pbm=ge speed=10 count=1 275 276 echo Testing PHY Loopback - 100 Mb/s all GE ports 277 tr 19 pbm=ge speed=100 count=1 278 279 echo Testing PHY Loopback - 1000 MB/s all GE ports 280 tr 19 pbm=ge speed=1000 281 282 $done 283 284 #--------- EXT Loopback --------- 285 286 # If you have external loopback cables connected as follows 287 # 1-2, 3-4, 5-6, 7-8, 9-10, 11-12 288 # then you can enable this script to perform external loopback at 289 # different speeds. Before running this script, use: 290 # setenv ext10 1 291 # setenv ext100 1 292 # setenv ext1000 1 293 # or 294 # setenv extall 1 295 296 local fwd 0x555 297 local bwd 0xaaa 298 299 if $?extall \ 300 "local ext10 1; local ext100 1; local ext1000 1" 301 302 if $?ext10 \ 303 "echo Testing External Loopback - 10 MB/s forward; \ 304 tr 20 tpbm=$fwd di=1 speed=10 count=10; \ 305 echo Testing External Loopback - 10 MB/s reverse; \ 306 tr 20 tpbm=$bwd di=-1 speed=10 count=10" 307 308 if $?ext100 \ 309 "echo Testing External Loopback - 100 MB/s forward; \ 310 tr 20 tpbm=$fwd di=1 speed=100 count=10; \ 311 echo Testing External Loopback - 100 MB/s reverse; \ 312 tr 20 tpbm=$bwd di=-1 speed=100 count=10" 313 314 if $?ext1000 \ 315 "echo Testing External Loopback - 1000 MB/s forward; \ 316 tr 20 tpbm=$fwd di=1 speed=1000 count=10; \ 317 echo Testing External Loopback - 1000 MB/s reverse; \ 318 tr 20 tpbm=$bwd di=-1 speed=1000 count=10" 319 320 #--------- INT snake Loopback --------- 321 322 echo "Running internal snake on all ports, MAC loopback ..." 323 tr 39 loopbackmode=mac snakepath=two 324 325 echo "Running internal snake on all ports, PHY loopback ..." 326 tr 39 loopbackmode=phy snakepath=two 327 328 echo "Running MAC loopback V2 on all ports ..." 329 tr 48 smi=103 dmi=42 vlan=5 pi=0x11335577 sendm=single 330 331 echo "Running PHY loopback V2 on all ports ..." 332 tr 49 smi=52 dmi=83 vlan=23 pi=0x01204007 sendm=array 333 334 echo "Testing Filters" 335 rcload rc.soc 336 tr 70 337 338 # Show status 339 tl 340 local returnCode $? 341 342 echo Tests Complete. Reinitializing ... 343 rcload rc.soc 344 345 # We want to show the return code from the tl command which 346 # lists the results. The automated test infrastructure keys off of this 347 # value 348 echo "testsuite: finished: sanity: $returnCode"