@@ -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
@@ -347,10 +361,12 @@ def goto_state(self, state):
347
361
raise unittest .SkipTest ("OpTestSystem running QEMU/Mambo so skipping OpSystemState.OS test" )
348
362
if (self .state == OpSystemState .UNKNOWN ):
349
363
log .debug ("OpTestSystem CHECKING CURRENT STATE and TRANSITIONING for TARGET STATE: %s" % (state ))
364
+ log .debug (" *** {}" .format (OpSystemState .table_string ))
350
365
self .state = self .run_DETECT (state )
351
366
log .debug ("OpTestSystem CURRENT DETECTED STATE: %s" % (self .state ))
352
367
353
368
log .debug ("OpTestSystem START STATE: %s (target %s)" % (self .state , state ))
369
+ log .debug (" *** {}" .format (OpSystemState .table_string ))
354
370
never_unknown = False
355
371
while 1 :
356
372
if self .stop == 1 :
@@ -364,6 +380,7 @@ def goto_state(self, state):
364
380
self .util .clear_state (self )
365
381
self .previous_state = self .state
366
382
log .debug ("OpTestSystem TRANSITIONED TO: %s" % (self .state ))
383
+ log .debug (" *** {}" .format (OpSystemState .table_string ))
367
384
if self .state == state :
368
385
break ;
369
386
if never_unknown and self .state == OpSystemState .UNKNOWN :
@@ -531,11 +548,13 @@ def wait_for_it(self, **kwargs):
531
548
else :
532
549
x += 1
533
550
log .debug ("\n *** WaitForIt CURRENT STATE \" {:02}\" TARGET STATE \" {:02}\" \n "
551
+ " *** {}\n "
534
552
" *** WaitForIt working on transition\n "
535
553
" *** Current loop iteration \" {:02}\" - Reconnect attempts \" {:02}\" - loop_max \" {:02}\" \n "
536
554
" *** WaitForIt timeout interval \" {:02}\" seconds - Stale buffer check every \" {:02}\" times\n "
537
555
" *** WaitForIt variables \" {}\" \n "
538
556
" *** WaitForIt Refresh=\" {}\" Buffer Kicker=\" {}\" - Kill Cord=\" {:02}\" \n " .format (self .state , self .target_state ,
557
+ OpSystemState .table_string ,
539
558
x , reconnect_count , kwargs ['loop_max' ], kwargs ['timeout' ], kwargs ['threshold' ],
540
559
sorted (kwargs ['expect_dict' ].keys ()), kwargs ['refresh' ], kwargs ['buffer_kicker' ], self .kill_cord ))
541
560
if (x >= kwargs ['loop_max' ]):
0 commit comments