@@ -69,6 +69,20 @@ class OpSystemState():
69
69
POWERING_OFF = 7
70
70
UNKNOWN_BAD = 8 # special case, use set_state to place system in hold for later goto
71
71
72
+ table_strings = {'UNKNOWN' : UNKNOWN ,
73
+ 'OFF' : OFF ,
74
+ 'IPLing' : IPLing ,
75
+ 'PETITBOOT' : PETITBOOT ,
76
+ 'PETITBOOT_SHELL' : PETITBOOT_SHELL ,
77
+ 'BOOTING' : BOOTING ,
78
+ 'OS' : OS ,
79
+ 'POWERING_OFF' : POWERING_OFF ,
80
+ 'UNKNOWN_BAD' : UNKNOWN_BAD ,
81
+ }
82
+ table_string = ""
83
+ for i in sorted (table_strings .values ()):
84
+ table_string = table_string + table_strings .keys ()[table_strings .values ().index (i )] + "=" + str (i ) + " "
85
+
72
86
class OpTestSystem (object ):
73
87
74
88
## Initialize this object
@@ -350,10 +364,12 @@ def goto_state(self, state):
350
364
raise unittest .SkipTest ("OpTestSystem running QEMU/Mambo so skipping OpSystemState.OS test" )
351
365
if (self .state == OpSystemState .UNKNOWN ):
352
366
log .debug ("OpTestSystem CHECKING CURRENT STATE and TRANSITIONING for TARGET STATE: %s" % (state ))
367
+ log .debug (" *** {}" .format (OpSystemState .table_string ))
353
368
self .state = self .run_DETECT (state )
354
369
log .debug ("OpTestSystem CURRENT DETECTED STATE: %s" % (self .state ))
355
370
356
371
log .debug ("OpTestSystem START STATE: %s (target %s)" % (self .state , state ))
372
+ log .debug (" *** {}" .format (OpSystemState .table_string ))
357
373
never_unknown = False
358
374
while 1 :
359
375
if self .stop == 1 :
@@ -368,6 +384,7 @@ def goto_state(self, state):
368
384
self .util .clear_state (self )
369
385
self .previous_state = self .state
370
386
log .debug ("OpTestSystem TRANSITIONED TO: %s" % (self .state ))
387
+ log .debug (" *** {}" .format (OpSystemState .table_string ))
371
388
if self .state == state :
372
389
break ;
373
390
if never_unknown and self .state == OpSystemState .UNKNOWN :
@@ -536,12 +553,14 @@ def wait_for_it(self, **kwargs):
536
553
else :
537
554
x += 1
538
555
log .debug ("\n *** WaitForIt CURRENT STATE \" {:02}\" TARGET STATE \" {:02}\" \n "
556
+ " *** {}\n "
539
557
" *** WaitForIt working on transition\n "
540
558
" *** Expect Buffer ID={}\n "
541
559
" *** Current loop iteration \" {:02}\" - Reconnect attempts \" {:02}\" - loop_max \" {:02}\" \n "
542
560
" *** WaitForIt timeout interval \" {:02}\" seconds - Stale buffer check every \" {:02}\" times\n "
543
561
" *** WaitForIt variables \" {}\" \n "
544
562
" *** WaitForIt Refresh=\" {}\" Buffer Kicker=\" {}\" - Kill Cord=\" {:02}\" \n " .format (self .state , self .target_state ,
563
+ OpSystemState .table_string ,
545
564
hex (id (sys_pty )), x , reconnect_count , kwargs ['loop_max' ], kwargs ['timeout' ], kwargs ['threshold' ],
546
565
sorted (kwargs ['expect_dict' ].keys ()), kwargs ['refresh' ], kwargs ['buffer_kicker' ], self .kill_cord ))
547
566
if (x >= kwargs ['loop_max' ]):
0 commit comments