diff --git a/src/Script_ABC_Blanton/1_Blanton_Script_A.ttl b/src/Script_ABC_Blanton/1_Blanton_Script_A.ttl index f7afb01..5f226cd 100644 --- a/src/Script_ABC_Blanton/1_Blanton_Script_A.ttl +++ b/src/Script_ABC_Blanton/1_Blanton_Script_A.ttl @@ -1,6 +1,6 @@ ; ============================================================================= ; Script A for Blanton -; Version : V1.0.4 +; Version : V1.0.5 ; Date : 2026-08-21 ; Author : ETWen ; ============================================================================= @@ -22,6 +22,9 @@ ; ScriptA Remove empty Check History block ; ScriptA/B Disable lldp + config save before traffic (silent MAC) ; ScriptB Add sfputil lpmode off Ethernet513/514 +; V1.0.5 2026-08-21 config.ttl Add SWB_UNIT0/SWB_UNIT1 (+derived swb_any/swb_opt) +; utils/wait_init.ttl Follow config.ttl SWB_UNIT0/SWB_UNIT1 +; ScriptA/B/C Traffic follows SWB_UNIT: -u 0 / -u 1 / skip ; ============================================================================= include "config.ttl" @@ -124,22 +127,33 @@ sendln "config feature state lldp disabled" wait prompt_sonic_root sendln "config save -y" -wait prompt_sonic_root -sendln "blanton_traffic_linespeed ps" -wait prompt_sonic_root -sendln "blanton_traffic_linespeed init" -wait prompt_sonic_root -sendln "blanton_traffic_linespeed clear" -wait prompt_sonic_root -pause 15 -sendln "blanton_traffic_linespeed show" -wait prompt_sonic_root -sendln "blanton_traffic_linespeed start" -wait prompt_sonic_root -pause 15 -sendln "blanton_traffic_linespeed stop" -wait prompt_sonic_root -sendln "blanton_traffic_linespeed report" +; swb_any / swb_opt come from config.ttl: "" both units, " -u 0" or " -u 1" +; when only one is populated, and the whole block is skipped when neither is. +if swb_any = 1 then + wait prompt_sonic_root + sprintf2 tl_cmd 'blanton_traffic_linespeed ps%s' swb_opt + sendln tl_cmd + wait prompt_sonic_root + sprintf2 tl_cmd 'blanton_traffic_linespeed init%s' swb_opt + sendln tl_cmd + wait prompt_sonic_root + sprintf2 tl_cmd 'blanton_traffic_linespeed clear%s' swb_opt + sendln tl_cmd + wait prompt_sonic_root + pause 15 + sprintf2 tl_cmd 'blanton_traffic_linespeed show%s' swb_opt + sendln tl_cmd + wait prompt_sonic_root + sprintf2 tl_cmd 'blanton_traffic_linespeed start%s' swb_opt + sendln tl_cmd + wait prompt_sonic_root + pause 15 + sprintf2 tl_cmd 'blanton_traffic_linespeed stop%s' swb_opt + sendln tl_cmd + wait prompt_sonic_root + sprintf2 tl_cmd 'blanton_traffic_linespeed report%s' swb_opt + sendln tl_cmd +endif ; ========== Show Power on uptime ========== wait prompt_sonic_root diff --git a/src/Script_ABC_Blanton/2_Blanton_Script_B.ttl b/src/Script_ABC_Blanton/2_Blanton_Script_B.ttl index 6e7ba83..10a4922 100644 --- a/src/Script_ABC_Blanton/2_Blanton_Script_B.ttl +++ b/src/Script_ABC_Blanton/2_Blanton_Script_B.ttl @@ -70,17 +70,25 @@ sendln "config feature state lldp disabled" wait prompt_sonic_root sendln "config save -y" -wait prompt_sonic_root -sendln "blanton_traffic_linespeed ps" -wait prompt_sonic_root -sendln "blanton_traffic_linespeed init" -wait prompt_sonic_root -sendln "blanton_traffic_linespeed clear" -wait prompt_sonic_root -pause 15 -sendln "blanton_traffic_linespeed show" -wait prompt_sonic_root -sendln "blanton_traffic_linespeed start" +; swb_any / swb_opt come from config.ttl +if swb_any = 1 then + wait prompt_sonic_root + sprintf2 tl_cmd 'blanton_traffic_linespeed ps%s' swb_opt + sendln tl_cmd + wait prompt_sonic_root + sprintf2 tl_cmd 'blanton_traffic_linespeed init%s' swb_opt + sendln tl_cmd + wait prompt_sonic_root + sprintf2 tl_cmd 'blanton_traffic_linespeed clear%s' swb_opt + sendln tl_cmd + wait prompt_sonic_root + pause 15 + sprintf2 tl_cmd 'blanton_traffic_linespeed show%s' swb_opt + sendln tl_cmd + wait prompt_sonic_root + sprintf2 tl_cmd 'blanton_traffic_linespeed start%s' swb_opt + sendln tl_cmd +endif diff --git a/src/Script_ABC_Blanton/3_Blanton_Script_C.ttl b/src/Script_ABC_Blanton/3_Blanton_Script_C.ttl index 9a3ba41..7e4c248 100644 --- a/src/Script_ABC_Blanton/3_Blanton_Script_C.ttl +++ b/src/Script_ABC_Blanton/3_Blanton_Script_C.ttl @@ -43,10 +43,15 @@ wait prompt_sonic_root sendln "cat ~/hammer/tools/log.stress_ssd" ; ========== CHECK Traffic counters ========== -wait prompt_sonic_root -sendln "blanton_traffic_linespeed stop" -wait prompt_sonic_root -sendln "blanton_traffic_linespeed report" +; swb_any / swb_opt come from config.ttl +if swb_any = 1 then + wait prompt_sonic_root + sprintf2 tl_cmd 'blanton_traffic_linespeed stop%s' swb_opt + sendln tl_cmd + wait prompt_sonic_root + sprintf2 tl_cmd 'blanton_traffic_linespeed report%s' swb_opt + sendln tl_cmd +endif wait prompt_sonic_root sendln "show reboot-cause" diff --git a/src/Script_ABC_Blanton/config.ttl b/src/Script_ABC_Blanton/config.ttl index b4122d7..6dad08b 100644 --- a/src/Script_ABC_Blanton/config.ttl +++ b/src/Script_ABC_Blanton/config.ttl @@ -7,6 +7,37 @@ strTestcase="ENV" ;ENV,EMC,Margin...etc EN_Margin = 0 ; 1: Enable Margin Test, 0: Disable Margin Test EN_log = 1 ; 1: Enable log, 0: Disable log + +;================================================================ +; Switch Unit Population +;================================================================ +SWB_UNIT0 = 1 ; 1 = this DUT has switch unit 0, wait for it ; 0 = skip +SWB_UNIT1 = 1 ; 1 = this DUT has switch unit 1, wait for it ; 0 = skip + +; --- derived from the two flags above; do not edit -------------- +; swb_any : 0 = no switch unit at all -> skip every traffic block +; swb_opt : suffix appended to each blanton_traffic_linespeed call +; "" both units -> tool default TL_UNITS="0 1" +; " -u 0" unit 0 only +; " -u 1" unit 1 only +swb_any = 0 +swb_opt = "" +if SWB_UNIT0 = 1 then + swb_any = 1 +endif +if SWB_UNIT1 = 1 then + swb_any = 1 +endif +if SWB_UNIT0 = 1 then + if SWB_UNIT1 = 0 then + swb_opt = " -u 0" + endif +endif +if SWB_UNIT0 = 0 then + if SWB_UNIT1 = 1 then + swb_opt = " -u 1" + endif +endif ;================================================================ ; Prompt Definitions ;================================================================ diff --git a/src/Script_ABC_Blanton/utils/wait_init.ttl b/src/Script_ABC_Blanton/utils/wait_init.ttl index 108a1c8..87202bb 100644 --- a/src/Script_ABC_Blanton/utils/wait_init.ttl +++ b/src/Script_ABC_Blanton/utils/wait_init.ttl @@ -7,11 +7,12 @@ ; Wait until every switch unit ENABLED below reports more than WT_MIN ports up: ; bcmcmd -n -c ps | grep -w up | wc -l ; -; The DUT is not always fully populated, so declare what this bench has: -; both units -> WT_UNIT0 = 1 , WT_UNIT1 = 1 -; unit 0 only -> WT_UNIT0 = 1 , WT_UNIT1 = 0 -; unit 1 only -> WT_UNIT0 = 0 , WT_UNIT1 = 1 -; no unit -> WT_UNIT0 = 0 , WT_UNIT1 = 0 (bypass, returns immediately) +; The DUT is not always fully populated. Which units exist is declared ONCE in +; config.ttl, so the traffic blocks in Script A/B/C and this wait agree: +; both units -> SWB_UNIT0 = 1 , SWB_UNIT1 = 1 +; unit 0 only -> SWB_UNIT0 = 1 , SWB_UNIT1 = 0 +; unit 1 only -> SWB_UNIT0 = 0 , SWB_UNIT1 = 1 +; no unit -> SWB_UNIT0 = 0 , SWB_UNIT1 = 0 (bypass, returns immediately) ; ; Enter : prompt of the previous command is NOT consumed. ; Exit : a command has been sent, prompt NOT consumed (caller does the wait). @@ -30,10 +31,11 @@ ; V3.0.0 2026-08-21 Add WT_UNIT0 / WT_UNIT1 so a partly populated DUT can ; be declared: wait on the enabled units only, and bypass ; entirely when neither is set. +; V3.1.0 2026-08-21 Take the population from SWB_UNIT0 / SWB_UNIT1 in +; config.ttl instead of local copies, so this wait and the +; traffic blocks cannot drift apart. ; ============================================================================= -; ---- edit these for the bench ---------------------------------------------- -WT_UNIT0 = 1 ; 1 = this DUT has switch unit 0, wait for it ; 0 = skip -WT_UNIT1 = 1 ; 1 = this DUT has switch unit 1, wait for it ; 0 = skip +; ---- which units to wait for: SWB_UNIT0 / SWB_UNIT1, set in config.ttl ------ WT_MIN = 216 ; an enabled unit must report MORE than this many ports up WT_INTERVAL = 10 ; seconds between polls ; ----------------------------------------------------------------------------- @@ -42,8 +44,8 @@ timeout = 60 ; per-wait cap; bcmcmd ps is not instant wait prompt_sonic_root ; nothing declared -> bypass -if WT_UNIT0 = 0 then - if WT_UNIT1 = 0 then +if SWB_UNIT0 = 0 then + if SWB_UNIT1 = 0 then goto NO_UNITS endif endif @@ -51,7 +53,7 @@ endif :WAIT_PORTS wt_ok = 1 -if WT_UNIT0 = 1 then +if SWB_UNIT0 = 1 then wt_up0 = 0 sendln "echo PORTS0=$(bcmcmd -n 0 -c ps | grep -w up | wc -l)" waitregex "PORTS0=[ ]*([0-9]+)" @@ -64,7 +66,7 @@ if WT_UNIT0 = 1 then endif endif -if WT_UNIT1 = 1 then +if SWB_UNIT1 = 1 then wt_up1 = 0 sendln "echo PORTS1=$(bcmcmd -n 1 -c ps | grep -w up | wc -l)" waitregex "PORTS1=[ ]*([0-9]+)"