Beispiel #1
0
def run(utils):

    bug='28642'

    logging.info("Start regression test for bug %s"%(bug))
    
    logging.info("Submit the job and wait to finish")

    utils.use_external_jdl("%s.jdl"%(bug))

    JOBID=Job_utils.submit_wait_finish(utils,"")

    Job_utils.output_normal_job(utils,JOBID)

    #Check job output
    logging.info("Check if the output files are correctly retrieved")

    if os.path.isfile("%s/input1.txt"%(utils.get_job_output_dir())) & os.path.isfile("%s/env.out"%(utils.get_job_output_dir())) & os.path.isfile("%s/env.err"%(utils.get_job_output_dir())) :
          logging.info("Output files are collectly retrieved")
    else:
          logging.error("Output files are not correctly retrieved")
          raise GeneralError("","Output files are not correctly retrieved")

    #Check the content of env.out file
    logging.info("Check the content of the env.out file")

    result=utils.run_command_continue_on_error("cat %s/env.out"%(utils.get_job_output_dir()))

    if result.find("LD_LIBRARY_PATH=.") != -1 :
        logging.info("Environment variable LD_LIBRARY_PATH has value '.' as expected")
    else:
      logging.error("Error value of environment variable LD_LIBRARY_PATH")
      raise GeneralError("","Error !!! Error value of environment variable LD_LIBRARY_PATH")
       
    logging.info("End of regression test for bug %s",bug)
Beispiel #2
0
def run(utils):

    bug='38359'

    logging.info("Start regression test for bug %s"%(bug))

    logging.warning("To verify this bug you need access to WMS. You have to set WMS_USERNAME and WMS_PASSOWRD attributes at configuration file")

    ssh=utils.open_ssh(utils.get_WMS(),utils.get_Username(),utils.get_Password())

    logging.info("Set MaxOutputSandoxSize=100; to glite_wms.conf at WMS")

    logging.info("Set MaxOutputSandboxSize=100; to glite_wms.conf at WMS")

    utils.change_remote_file(ssh,"/etc/glite-wms/glite_wms.conf", ['MaxOutputSandboxSize'],['*'],['100'])

    logging.info("Restart Workload Manager glite-wms-wm")
    utils.execute_remote_cmd(ssh,"/etc/init.d/glite-wms-wm restart")

    logging.info("Submit the job and wait to finish")

    utils.use_external_jdl("%s.jdl"%(bug))

    JOBID=Job_utils.submit_wait_finish(utils,"")

    logging.info("Get job output")

    Job_utils.output_normal_job(utils,JOBID)

    #Check job output
    logging.info("Check if the output files are correctly retrieved")

    if os.path.isfile("%s/test.err"%(utils.get_job_output_dir())) & os.path.isfile("%s/test.out"%(utils.get_job_output_dir())) & os.path.isfile("%s/out1"%(utils.get_job_output_dir())) & os.path.isfile("%s/out2.tail"%(utils.get_job_output_dir())) & os.path.isfile("%s/out3"%(utils.get_job_output_dir())) & os.path.isfile("%s/out4.tail"%(utils.get_job_output_dir())) :
          logging.info("Output files are collectly retrieved")
    else:
          logging.error("Output files are not correctly retrieved")
          utils.execute_remote_cmd(ssh, "cp -f /etc/glite-wms/glite_wms.conf.bak /etc/glite-wms/glite_wms.conf")
          utils.execute_remote_cmd(ssh,"/etc/init.d/glite-wms-wm restart")
          ssh.close()
          raise GeneralError("","Output files are not correctly retrieved")

    #Check the content of env.out file
    logging.info("Check output files size")

    if int(os.path.getsize("%s/out1"%(utils.get_job_output_dir()))) != 50 or int(os.path.getsize("%s/out3"%(utils.get_job_output_dir()))) !=50 or int(os.path.getsize("%s/out2.tail"%(utils.get_job_output_dir())))!=0 or int(os.path.getsize("%s/out4.tail"%(utils.get_job_output_dir())))!=0 or int(os.path.getsize("%s/test.out"%(utils.get_job_output_dir())))!=0 or int(os.path.getsize("%s/test.err"%(utils.get_job_output_dir())))!=0 :
          logging.error("Output files do not have the expected sizes.")
          utils.execute_remote_cmd(ssh, "cp -f /etc/glite-wms/glite_wms.conf.bak /etc/glite-wms/glite_wms.conf")
          utils.execute_remote_cmd(ssh,"/etc/init.d/glite-wms-wm restart")
          ssh.close()
          raise GeneralError("","Output files do not have the expected sizes")
   
    logging.info("Restore the initial glite_wms.conf file")

    utils.execute_remote_cmd(ssh, "cp -f /etc/glite-wms/glite_wms.conf.bak /etc/glite-wms/glite_wms.conf")
   
    utils.execute_remote_cmd(ssh,"/etc/init.d/glite-wms-wm restart")
    
    ssh.close()
    
    logging.info("End of regression test for bug %s"%(bug))
Beispiel #3
0
def run(utils):

    bug='36536'

    logging.info("Start regression test for bug %s"%(bug))

    logging.warning("To verify this bug you need access to LBProxy DATABASE. You have to set USERNAME and PASSWORD attributes at configuration file")

    if utils.WMS_USERNAME=='' or utils.WMS_PASSWORD=='' or utils.USERNAME=='' or utils.PASSWORD=='' :
        logging.error("Missing required variables (WMS_USERNAME,WMS_PASSWORD,USERNAME,PASSWORD) from configuration file")
        raise GeneralError("Missing required variables","To verify this bug it is necessary to set WMS_USERNAME,WMS_PASSWORD,USERNAME and PASSWORD in the configuration file")


    ssh=utils.open_ssh(utils.get_WMS(),utils.get_Username(),utils.get_Password())

    logging.info("Prepare and submit a simple job")

    utils.use_utils_jdl()
    utils.set_jdl(utils.get_jdl_file())

    JOBID=Job_utils.submit_wait_finish(utils,"")
    
    logging.info("Create SQL script file")

    utils.execute_remote_cmd(ssh,"echo \"SELECT * FROM jobs WHERE dg_jobid like '%%%s%%';\" > /root/test.sql"%(JOBID))

    logging.info("Retrieve the job record from LBProxy database")

    mysql_cmd="mysql -u %s --password=%s lbserver20 < /root/test.sql"%(utils.USERNAME,utils.PASSWORD)

    output=utils.execute_remote_cmd(ssh,mysql_cmd)

    if output.find(JOBID)==-1:
        logging.error("Unable to retrieve the job record from LBProxy datasse for job id:%s"%(JOBID))
        raise GeneralError("Retrieve job record from LBProxy database","Unable to retrieve the job record from LBProxy datasse for job id:%s"%(JOBID))

    logging.info("Get job output")

    Job_utils.output_normal_job(utils,JOBID)

    #Check LBProxy
    logging.info("Check again the job record in LBProxy database")

    output=utils.execute_remote_cmd(ssh,mysql_cmd)

    if output.find(JOBID)!=-1:
        logging.error("Job's record in LBProxy database has not been removed.")
        raise GeneralError("","Job's record in LBProxy database has not been removed.")
    
    logging.info("End of regression test for bug %s"%(bug))