1212TRANSITION_TIMEOUT = timedelta (minutes = 20 )
1313_STATE_TABLE = "CHASSIS_MODULE"
1414
15+
1516# helpers for transition checks
1617def _read_transition_from_dbs (db , name ):
1718 """
@@ -23,7 +24,7 @@ def _read_transition_from_dbs(db, name):
2324 cfg = db .cfgdb .get_entry ("CHASSIS_MODULE" , name ) or {}
2425 flag = cfg .get ("state_transition_in_progress" )
2526 ttyp = cfg .get ("transition_type" )
26- ts = cfg .get ("transition_start_time" )
27+ ts = cfg .get ("transition_start_time" )
2728
2829 if flag is not None or ttyp is not None or ts is not None :
2930 return flag , ttyp , ts
@@ -35,7 +36,7 @@ def _read_transition_from_dbs(db, name):
3536 st = {}
3637 flag2 = st .get ("state_transition_in_progress" )
3738 ttyp2 = st .get ("transition_type" )
38- ts2 = st .get ("transition_start_time" )
39+ ts2 = st .get ("transition_start_time" )
3940 return flag2 , ttyp2 , ts2
4041
4142
@@ -593,6 +594,7 @@ def test_shutdown_triggers_transition_tracking(self):
593594
594595 # Transition flags are tracked in CONFIG_DB now
595596 _assert_transition_if_present (db , "DPU0" , expected_type = "shutdown" )
597+ trans_fvs = db .cfgdb .get_entry ("CHASSIS_MODULE" , "DPU0" )
596598 transition_flag = trans_fvs .get ("state_transition_in_progress" )
597599 transition_type = trans_fvs .get ("transition_type" )
598600 start_time = trans_fvs .get ("transition_start_time" )
@@ -627,6 +629,7 @@ def test_shutdown_triggers_transition_in_progress(self):
627629
628630 # Read back from CONFIG_DB
629631 _assert_transition_if_present (db , "DPU0" , expected_type = "shutdown" )
632+ trans_fvs = db .cfgdb .get_entry ("CHASSIS_MODULE" , "DPU0" )
630633 print (f"state_transition_in_progress:{ trans_fvs .get ('state_transition_in_progress' )} " )
631634 assert trans_fvs .get ('state_transition_in_progress' ) == 'True'
632635 assert 'transition_start_time' in trans_fvs
@@ -657,6 +660,7 @@ def test_shutdown_triggers_transition_timeout(self):
657660
658661 # Read back from CONFIG_DB
659662 _assert_transition_if_present (db , "DPU0" , expected_type = "shutdown" )
663+ trans_fvs = db .cfgdb .get_entry ("CHASSIS_MODULE" , "DPU0" )
660664 print (f"state_transition_in_progress:{ trans_fvs .get ('state_transition_in_progress' )} " )
661665 assert trans_fvs .get ('state_transition_in_progress' ) == 'True'
662666 assert 'transition_start_time' in trans_fvs
@@ -679,6 +683,7 @@ def test_startup_triggers_transition_tracking(self):
679683
680684 # Read from CONFIG_DB
681685 _assert_transition_if_present (db , "DPU0" , expected_type = "shutdown" )
686+ trans_fvs = db .cfgdb .get_entry ("CHASSIS_MODULE" , "DPU0" )
682687 print (f"state_transition_in_progress:{ trans_fvs .get ('state_transition_in_progress' )} " )
683688 assert trans_fvs .get ('state_transition_in_progress' ) == 'True'
684689 assert 'transition_start_time' in trans_fvs
0 commit comments