def test_notifications_for_suspended_resumed_jobs():

    print "Creating proxy ..."
    cream_testing.create_proxy("sarabINFN","dteam")

    print "Creating jdl"
    jdl_fname = cream_testing.sleep_jdl("dteam","300", "/tmp")


    # With PBS and SGE it is possible to suspend only IDLE (i.e. not yet running) jobs.
    # To perform the test, first saturate the batch system, second submit the job which
    # willbe under test.
    # At the end of the test cancel all submitted job to free the batch system
    print "Saturating batch system"
    job_ids_list = blah_testing.saturate_batch_system()

    print "Submitting job " + jdl_fname
    cream_job_id = cream_testing.submit_job(jdl_fname, "cream-06.pd.infn.it:8443/cream-pbs-cert" )
    print cream_job_id
    print "Sleeping 1min"
    time.sleep(60)

    print "Verifying status of job " + cream_job_id
    cream_regression.job_status_should_be_in(cream_job_id, ['IDLE'])

    print "Suspending job ..."
    cream_testing.suspend_job(cream_job_id)

    print "Sleeping 10sec"
    time.sleep(10)

    #check if job suspended on batch system. It is enough check status and verify it is 'HELD'
    print "Verifying status of job " + cream_job_id + ". Should be in 'HELD'"
    cream_regression.job_status_should_be_in(cream_job_id, ['HELD'])
  
    #count = int(len(job_ids_list)/4) 
    #print "Sleep " + str(count) + "sec"
    #time.sleep(count)
    
    print "Cancel job saturating batch system"
    blah_testing.cancel_list_of_jobs(job_ids_list)

    print "Sleeping 5 min ..."
    time.sleep(300)

    print "Resuming job ..."
    cream_testing.resume_job(cream_job_id)

    print "Getting final job status ... "
    final_job_status = cream_testing.get_final_status(cream_job_id)
    print "Final job status = " + final_job_status

    print "Sleeping 30sec"
    time.sleep(30)

    job_num = blah_testing.get_job_num_from_jid(cream_job_id)
    
    blah_parser_log_file_name = blah_testing.get_blah_parser_log_file_name()
    local_blah_parser_log_file = cream_regression.get_file_from_ce(blah_parser_log_file_name, "/tmp")
    
    print "Sleeping 6min."
    time.sleep(360)

    print "Get notifications list in blah parser log file local copy"
    notifications_list = blah_testing.get_notifications_in_blah_parser_log(local_blah_parser_log_file, job_num)

    print notifications_list

    print blah_testing.check_notifications_for_resumed(notifications_list)

    print "Cancelling all jobs..."
    cream_testing.cancel_all_jobs("cream-06.pd.infn.it:8443")
예제 #2
0
if not blparser_with_updater_and_notifier:
    print "Changing configuration parameter ... "
    cream_regression.change_conf_param_in_file("/root/sarab_devel/siteinfo/services/glite-creamce", "BLPARSER_WITH_UPDATER_NOTIFIER", "true")
 
config_file = cream_regression.get_file_from_ce("/etc/blah.config", "/tmp")
is_initialized = cream_regression.check_parameter(config_file, "blah_check_children_interval")
if is_initialized != "INITIALIZED":
    print "KO - parameter blah_check_children_interval not initialized in /etc/blah.config"
    sys.exit()

print "Create proxy"
cream_testing.create_proxy("sarabINFN","dteam")

print "Clear the ce deleting al jobs"
cream_testing.cancel_all_jobs("cream-06.pd.infn.it:8443")

print "Re-configure the ce"
cream_regression.configure_ce_by_yaim("/root/sarab_devel/siteinfo/site-info.def")

print "Find bupdater and bnotifier pids in `cat /var/blah/blah_bupdater.pid` and `cat /var/blah/blah_bnotifier.pid`"

blah_regression.kill_remote_process_with_pid_file("/var/blah/blah_bupdater.pid")
blah_regression.kill_remote_process_with_pid_file("/var/blah/blah_bnotifier.pid")

time.sleep(61)

if blah_regression.remote_process_is_alive("/usr/bin/BUpdater"):
    print "/usr/bin/BUpdater OK"
else:
    print "/usr/bin/BUpdater KO"
예제 #3
0
def test_notifications_for_suspended_resumed_jobs():

    print "Creating proxy ..."
    cream_testing.create_proxy("sarabINFN", "dteam")

    print "Creating jdl"
    jdl_fname = cream_testing.sleep_jdl("dteam", "300", "/tmp")

    # With PBS and SGE it is possible to suspend only IDLE (i.e. not yet running) jobs.
    # To perform the test, first saturate the batch system, second submit the job which
    # willbe under test.
    # At the end of the test cancel all submitted job to free the batch system
    print "Saturating batch system"
    job_ids_list = blah_testing.saturate_batch_system()

    print "Submitting job " + jdl_fname
    cream_job_id = cream_testing.submit_job(
        jdl_fname, "cream-06.pd.infn.it:8443/cream-pbs-cert")
    print cream_job_id
    print "Sleeping 1min"
    time.sleep(60)

    print "Verifying status of job " + cream_job_id
    cream_regression.job_status_should_be_in(cream_job_id, ['IDLE'])

    print "Suspending job ..."
    cream_testing.suspend_job(cream_job_id)

    print "Sleeping 10sec"
    time.sleep(10)

    #check if job suspended on batch system. It is enough check status and verify it is 'HELD'
    print "Verifying status of job " + cream_job_id + ". Should be in 'HELD'"
    cream_regression.job_status_should_be_in(cream_job_id, ['HELD'])

    #count = int(len(job_ids_list)/4)
    #print "Sleep " + str(count) + "sec"
    #time.sleep(count)

    print "Cancel job saturating batch system"
    blah_testing.cancel_list_of_jobs(job_ids_list)

    print "Sleeping 5 min ..."
    time.sleep(300)

    print "Resuming job ..."
    cream_testing.resume_job(cream_job_id)

    print "Getting final job status ... "
    final_job_status = cream_testing.get_final_status(cream_job_id)
    print "Final job status = " + final_job_status

    print "Sleeping 30sec"
    time.sleep(30)

    job_num = blah_testing.get_job_num_from_jid(cream_job_id)

    blah_parser_log_file_name = blah_testing.get_blah_parser_log_file_name()
    local_blah_parser_log_file = cream_regression.get_file_from_ce(
        blah_parser_log_file_name, "/tmp")

    print "Sleeping 6min."
    time.sleep(360)

    print "Get notifications list in blah parser log file local copy"
    notifications_list = blah_testing.get_notifications_in_blah_parser_log(
        local_blah_parser_log_file, job_num)

    print notifications_list

    print blah_testing.check_notifications_for_resumed(notifications_list)

    print "Cancelling all jobs..."
    cream_testing.cancel_all_jobs("cream-06.pd.infn.it:8443")