import cream_testing, blah_testing, cream_regression import time local_copy_of_blah_config = cream_regression.get_file_from_ce( "/etc/blah.config", "/tmp") #ret_val = INITIALIZED, NOT_PRESENT, or NOT_INITIALIZED ret_val = cream_regression.check_parameter(local_copy_of_blah_config, "bupdater_use_bhist_for_killed") print "bupdater_use_bhist_for_killed = " + ret_val + " Should be INITIALIZED" print "Creating proxy ..." cream_testing.create_proxy("sarabINFN", "dteam") print "Creating jdl" jdl_fname = cream_testing.sleep_jdl("dteam", "300", "/tmp") print "Submitting job " + jdl_fname cream_job_id = cream_testing.submit_job( jdl_fname, "cream-48.pd.infn.it:8443/cream-lsf-cert") print cream_job_id time.sleep(60) print "Verifying status of job " + cream_job_id cream_regression.job_status_should_be_in( cream_job_id, ['PENDING', 'RUNNING', 'REALLY-RUNNING']) print "Cancelling job " + cream_job_id cream_testing.cancel_job(cream_job_id) print "Sleeping 200sec"
# Wait for 1 minute: you should see that the bupdater and bnotifier have been restarted. import cream_regression, blah_regression, cream_testing import re, time, sys blparser_with_updater_and_notifier = cream_regression.get_yaim_param("BLPARSER_WITH_UPDATER_NOTIFIER") print "blparser_with_updater_and_notifier = " + blparser_with_updater_and_notifier 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`"
import cream_testing, blah_testing, cream_regression import time local_copy_of_blah_config = cream_regression.get_file_from_ce("/etc/blah.config", "/tmp") #ret_val = INITIALIZED, NOT_PRESENT, or NOT_INITIALIZED ret_val = cream_regression.check_parameter(local_copy_of_blah_config, "bupdater_use_bhist_for_killed") print "bupdater_use_bhist_for_killed = " + ret_val + " Should be INITIALIZED" print "Creating proxy ..." cream_testing.create_proxy("sarabINFN","dteam") print "Creating jdl" jdl_fname = cream_testing.sleep_jdl("dteam","300", "/tmp") print "Submitting job " + jdl_fname cream_job_id = cream_testing.submit_job(jdl_fname, "cream-48.pd.infn.it:8443/cream-lsf-cert" ) print cream_job_id time.sleep(60) print "Verifying status of job " + cream_job_id cream_regression.job_status_should_be_in(cream_job_id, ['PENDING', 'RUNNING', 'REALLY-RUNNING']) print "Cancelling job " + cream_job_id cream_testing.cancel_job(cream_job_id) print "Sleeping 200sec" time.sleep(200) job_num = blah_testing.get_job_num_from_jid(cream_job_id)