#NEWLINE# def test_jut_jobs_connect_on_persistent_job( self ) : #NEWLINE# #INDENT# '\n        verify we can reconnect to a persistent job\n\n        ' #NEWLINE# with temp_jut_tools_home ( ) : #NEWLINE# #INDENT# configuration = config . get_default ( ) #NEWLINE# app_url = configuration [ 'app_url' ] #NEWLINE# process = jut ( 'config' , 'add' , '-u' , 'jut-tools-user03' , '-p' , 'bigdata' , '-a' , app_url , '-d' ) #NEWLINE# process . expect_status ( 0 ) #NEWLINE# process = jut ( 'run' , '--name' , 'Persistent Job #3' , '-p' , ( 'emit -limit 10000 | put source_type="event", foo="bar"| (write -space "%s"; keep foo | pass)' % JutJobsTests . test_space ) ) #NEWLINE# process . expect_status ( 0 ) #NEWLINE# job_id = process . read_output ( ) . strip ( ) #NEWLINE# process = jut ( 'jobs' , 'connect' , job_id , '-f' , 'text' ) #NEWLINE# process . expect_output ( 'bar\n' ) #NEWLINE# process . expect_output ( 'bar\n' ) #NEWLINE# process . expect_output ( 'bar\n' ) #NEWLINE# process . expect_output ( 'bar\n' ) #NEWLINE# process . expect_output ( 'bar\n' ) #NEWLINE# process . send_signal ( signal . SIGTERM ) #NEWLINE# process . expect_status ( ( - signal . SIGTERM ) ) #NEWLINE# process = jut ( 'jobs' , 'kill' , job_id , '-y' ) #NEWLINE# process . expect_status ( 0 ) #NEWLINE# process . expect_eof ( ) #NEWLINE# process = jut ( 'jobs' , 'list' ) #NEWLINE# process . expect_status ( 0 ) #NEWLINE# process . expect_error ( 'No running jobs' )