Exemplo n.º 1
0
import datetime, os, shutil, re

print "Get yaim_conf_param CREAM_CONCURRENCY_LEVEL value"
cream_concurrency_level_old = cream_regression.get_cream_concurrency_level_from_yaim_conf()
print "CREAM_CONCURRENCY_LEVEL = " + cream_concurrency_level_old

#cream_concurrency_level_old = 50

 Save a local copy of services
now = datetime.datetime.now()
suffix = now.strftime("%Y%m%d_%M%S")
os.mkdir("/tmp/tmp_" + suffix)
local_copy_of_services = cream_regression.get_file_from_ce("/root/siteinfo/services/glite-creamce", "/tmp/tmp_" + suffix)

print "Saving services file on a local copy _save"
cream_regression.exec_local_command("cp " + local_copy_of_services +  " " + local_copy_of_services + "_save")

# Reconfigure the CE with a different value of CREAM_CONCURRENCY_LEVEL
print "Changing configuration parameter ... "
cream_concurrency_level_new = int(cream_concurrency_level_old) + 50
cream_regression.change_conf_param_in_file("/root/siteinfo/services/glite-creamce", "CREAM_CONCURRENCY_LEVEL", str(cream_concurrency_level_new))

print "Re-configure running yaim"
cream_regression.configure_ce_by_yaim("/root/siteinfo/site-info.def")

#cream_concurrency_level_new = 100
print "Check CREAM_CONCURRENCY_LEVEL in configuration file"
local_copy_config_file = cream_regression.get_file_from_ce("/etc/glite-ce-cream/cream-config.xml", "/tmp")
#local_copy_config_file = "/tmp/local_copy_of_a_cream_file"
print "Conf file = " + local_copy_config_file
ce_host = "cream-48.pd.infn.it"
admin_name = 'root'
tester_home = os.environ['HOME']
my_utils = testsuite_utils.Utils()
cmd_mng = testsuite_utils.CommandMng()

print "++++++++ Get local copy of file and save it"
now = datetime.datetime.now()
suffix = now.strftime("%Y%m%d_%M%S")
os.mkdir("/tmp/tmp_" + suffix)

local_copy_of_ComputingShare_ldif = cream_regression.get_file_from_ce("/var/lib/bdii/gip/ldif/ComputingShare.ldif", "/tmp/tmp_" + suffix)

print "++++++++ Saving services file on a local copy _save"
cream_regression.exec_local_command("cp " + local_copy_of_ComputingShare_ldif +  " " + local_copy_of_ComputingShare_ldif + "_save")

print "++++++++ Modify the file" 
with open(local_copy_of_ComputingShare_ldif, "a") as myfile:
    myfile.write("GLUE2PolicyRule:\n")

myfile.close()

print "++++++++ Put modified file on ce"
my_utils.put_file_on_ce(local_copy_of_ComputingShare_ldif, "/var/lib/bdii/gip/ldif/ComputingShare.ldif")

print "++++++++ Exec the test"

cmd = "/var/lib/bdii/gip/plugin/glite-info-dynamic-scheduler-wrapper"
try:
    out, err = cmd_mng.exec_remote_command(cmd)
print "sandbox_path_value_old = " + sandbox_path_value_old

# Verify that the job is finished (it should be in a terminal state)
print "Getting final job status ... "
final_job_status = cream_testing.get_final_status(cream_job_id)
print "Final job status = " + final_job_status

cream_regression.exec_remote_command("service tomcat5 stop")

now = datetime.datetime.now()
suffix = now.strftime("%Y%m%d_%M%S")
os.mkdir("/tmp/tmp_" + suffix)
local_copy_of_services = cream_regression.get_file_from_ce("/root/sarab_devel/siteinfo/services/glite-creamce", "/tmp/tmp_" + suffix)

print "Saving services file on a local copy _save"
cream_regression.exec_local_command("cp " + local_copy_of_services +  " " + local_copy_of_services + "_save")

# Reconfigure the CE with a different value of CREAM_SANDBOX_PATH
print "Changing configuration parameter ... "
cream_regression.change_conf_param_in_file("/root/sarab_devel/siteinfo/services/glite-creamce", "CREAM_SANDBOX_PATH", "/tmp/cream_sanbox_x")


print "Reconfiguring cream ce ... "
cream_regression.run_yaim_func("/root/sarab_devel/siteinfo/site-info.def", "config_cream_ce")

# Get db username and password
print "Get db username and password from CE"
db_usr_name, db_usr_pass = cream_regression.get_cream_db_user_password_from_config()

# Try, with the JobDBAdminPurger.sh script, to purge the submitted job
print "Running jobDBAdminPurger.sh ... "
Exemplo n.º 4
0
admin_name = 'root'
tester_home = os.environ['HOME']
my_utils = testsuite_utils.Utils()
cmd_mng = testsuite_utils.CommandMng()

print "++++++++ Get local copy of file and save it"
now = datetime.datetime.now()
suffix = now.strftime("%Y%m%d_%M%S")
os.mkdir("/tmp/tmp_" + suffix)

local_copy_of_ComputingShare_ldif = cream_regression.get_file_from_ce(
    "/var/lib/bdii/gip/ldif/ComputingShare.ldif", "/tmp/tmp_" + suffix)

print "++++++++ Saving services file on a local copy _save"
cream_regression.exec_local_command("cp " + local_copy_of_ComputingShare_ldif +
                                    " " + local_copy_of_ComputingShare_ldif +
                                    "_save")

print "++++++++ Modify the file"
with open(local_copy_of_ComputingShare_ldif, "a") as myfile:
    myfile.write("GLUE2PolicyRule:\n")

myfile.close()

print "++++++++ Put modified file on ce"
my_utils.put_file_on_ce(local_copy_of_ComputingShare_ldif,
                        "/var/lib/bdii/gip/ldif/ComputingShare.ldif")

print "++++++++ Exec the test"

cmd = "/var/lib/bdii/gip/plugin/glite-info-dynamic-scheduler-wrapper"