<s> import eucaops <EOL> from eutester . eutestcase import EutesterTestCase <EOL> import time <EOL> class MyTestCase ( EutesterTestCase ) : <EOL> def __init__ ( self , config_file = None , password = None ) : <EOL> self . setuptestcase ( ) <EOL> self . setup_parser ( ) <EOL> self . parser . add_argument ( "<STR_LIT>" , default = <NUM_LIT> ) <EOL> self . get_args ( ) <EOL> def clean_method ( self ) : <EOL> self . debug ( '<STR_LIT>' ) <EOL> pass <EOL> def wait_for_services_operational ( self , timeout = None ) : <EOL> """<STR_LIT>""" <EOL> timeout = timeout or self . args . timeout <EOL> last_err = "<STR_LIT>" <EOL> elapsed = <NUM_LIT:0> <EOL> start = time . time ( ) <EOL> self . tester = None <EOL> while ( not self . tester and elapsed < timeout ) : <EOL> elapsed = int ( time . time ( ) - start ) <EOL> self . status ( '<STR_LIT>' + str ( elapsed ) ) <EOL> try : <EOL> self . tester = eucaops . Eucaops ( config_file = self . args . config_file , password = self . args . password ) <EOL> except Exception , e : <EOL> tb = eucaops . Eucaops . get_traceback ( ) <EOL> last_err = str ( tb ) + "<STR_LIT:\n>" + str ( e ) <EOL> print '<STR_LIT>' + last_err + '<STR_LIT:\n>' <EOL> if not self . tester : <EOL> raise Exception ( str ( last_err ) + '<STR_LIT>' + str ( elapsed ) ) <EOL> timeout = timeout - elapsed <EOL> self . status ( '<STR_LIT>' + str ( timeout ) ) <EOL> self . tester . service_manager . wait_for_all_services_operational ( timeout ) <EOL> self . status ( '<STR_LIT>' ) <EOL> self . tester . service_manager . print_services_list ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> testcase = MyTestCase ( ) <EOL> list = testcase . args . tests or [ "<STR_LIT>" ] <EOL> unit_list = [ ] <EOL> for test in list : <EOL> unit_list . append ( testcase . create_testunit_by_name ( test ) ) <EOL> result = testcase . run_test_case_list ( unit_list , clean_on_exit = False ) <EOL> exit ( result ) </s>
