This documentation is for you to do some simple tests to verify the installation after you install LCG-0 middleware.

1. Prerequisite

You should apply for user certificate from your country certification authority (CA). To use the Globus security infrastructure you must have your certificate in PEM format. Create an acount for you on your UI, place the two files "usercert.pem" and "userkey.pem" into a ".globus" directory in your home area. The file permissions for the userkey file should be 0700 for the other 755 is appropriate. At last, you should contact LCG-0 administrator on http://cern.ch/grid-deployment/ to register with LCG VO.

2. Login to your account, run "grid-proxy-init" to create a new proxy for you. It looks like:

$ grid-proxy-init
Your identity: /C=TW/O=AS/OU=IP/CN=Di Qing/Email=dqing@phys.sinica.edu.tw
Enter GRID pass phrase for this identity:***********
Creating proxy .................................. Done
Your proxy is valid until Thu Feb 27 02:26:48 2003


3. Test information provider and information index
ldapsearch -x -H ldap://yourCE.yourDomain:2135 -b "mds-vo-name=local,o=grid"

"yourCE.yourDomain" should be replaced with the hostname of your computing element.

Here is an example of query results for the Computing Element "lxshare0247.cern.ch".

ldapsearch -x -H ldap://yourSE.yourDomain:2135 -b "mds-vo-name=local,o=grid"

"yourSE.yourDomain" should be replaced with the hostname of your storage element.

Here is an example of query results for the Storage Element "lxshare0206.cern.ch".

ldapsearch -x -H ldap://lxshare0246.cern.ch:2170 -b "mds-vo-name=local,o=grid"

Currently, the Resource Broker you will use is located at CERN. Here is an example of query results.

4. Simple test of job submission by globus-job-run command could be:

$ globus-job-run yourMachine.yourDomain /bin/hostname
yourMachine

here, "yourMachine.yourDomain" should be the hostname of your Storage or Computing Element (if you installed it)

5. Test gridftp by globus-url-copy command could be:

$ globus-url-copy file://`pwd`/testfile gsiftp://yourMachine.yourDomain/tmp/testfile

$ globus-job-run yourMachine.yourDomain /bin/ls -al /tmp/testfile
-rw-rw-r--    1 lcg      lcg             0 Feb 26 15:01 /tmp/testfile

here, "yourMachine.yourDomain" should be the hostname of your Storage or Computing Element (if you installed it)

6. Simple job submission

To submit a simple job, hostname.jdl, to your grid system, create the jdl script of the job as follows:

cat > hostname.jdl << EOF
Executable = "/bin/hostname";
Stdoutput = "message.txt";
StdError = "stderror";
OutputSandbox = {"message.txt","stderror"};
EOF

Before submitting your job, you can use dg-job-list-match to check if there are resources which satisfy your jobs as follows:

$ dg-job-list-match hostname.jdl

Connecting to host lxshare0246.cern.ch, port 7771

***************************************************************************
                         COMPUTING ELEMENT IDs LIST
 The following CE(s) matching your job requirements have been found:

- lxshare0247.cern.ch:2119/jobmanager-pbs-workq

***************************************************************************

Then, you can submit job to your grid:

$ dg-job-submit -o jobid -r yourCE.yourdomain/jobmanager-pbs-yourQueue hostname.jdl

Connecting to host lxshare0246.cern.ch, port 7771
Logging to host lxshare0246.cern.ch, port 15830

================================= dg-job-submit Success ==================================
 The job has been successfully submitted to the Resource Broker.
 Use dg-job-status command to check job current status. Your job identifier (dg_jobId) is:
 https://lxshare0246.cern.ch:7846/137.138.145.56/142247266396403?lxshare0246.cern.ch:7771
 The dg_jobId has been saved in the following file:
 /home/dqing/jobid
===========================================================================================

remember to replace "yourCE.yourDomain/jobmanager-pbs-yourQueue" with your Computing Element and related queue. You can use dg-job-status to chech the status of your job.

$ dg-job-status -i jobid


Retrieving Information from LB server https://lxshare0246.cern.ch:7846
Please wait: this operation could take some seconds.


*************************************************************
BOOKKEEPING INFORMATION:

Printing status info for the Job : https://lxshare0246.cern.ch:7846/137.138.145.56/142247266396403?lxshare0246.cern.ch:7771

Some bookkeeping information has not reached the LB server yet.
Missing information should come from GlobusJobmanager

---

dg_JobId                =    https://lxshare0246.cern.ch:7846/137.138.145.56/142247266396403?lxshare0246.cern.ch:7771
Status                  =    OutputReady
Last Update Time (UTC)  =    Wed Feb 26 14:19:40 2003
Job Destination         =    yourCE.yourDomain:2119/jobmanager-pbs-yourQueue
Status Reason           =    terminated
Job Owner               =    /C=TW/O=AS/OU=IP/CN=Di Qing/Email=dqing@phys.sinica.edu.tw
Status Enter Time (UTC) =    Wed Feb 26 14:19:40 2003
*************************************************************

When the status of your job is "OutputReady", you can get the result:

$ dg-job-get-output -i jobid


*****************************************************************************************************
                                JOB GET OUTPUT OUTCOME

 Output sandbox files for the job:
 - https://lxshare0246.cern.ch:7846/137.138.145.56/142247266396403?lxshare0246.cern.ch:7771
 have been successfully retrieved and stored in the directory:
 /tmp/142247266396403

*****************************************************************************************************

And

$ cat /tmp/142247266396403/message.txt
The_machine_name_where_job_is_executed

7. To test the replica manager, create the following replica.jdl job as follows:

cat > replica.jdl << EOF
Executable = "/bin/sh";
Stdoutput = "stdout";
StdError = "stderror";
InputSandbox = {"testrc.sh"};
OutputSandbox = {"stdout","stderror"};
Arguments = "testrc.sh file672.txt yourSE.yourDomain/flatfiles/lcg";
EOF

here, "yourSE.yourDomain" should be the full hostname of your Storage Element, "/flatfiles/lcg" should be the VO storage area on your Storage Element, and also remember to replace filename "file672.txt" with your filename. Use an editor to create the following shell script testrc.sh:

-------- cut here --------
#!/bin/bash
#
#
echo "This is a very simple test for data replica manager tools within a job." >> $1
echo "This job will create a file, $1, and copy it to your SE $2." >> $1
echo "I execute the Replica Manager command"
edg-replica-manager-copyAndRegisterFile -l $1 -s `hostname``pwd`/$1 -d  $2/$1 -c /opt/edg/etc/lcg/rc.conf
exit 0
-------- cut here ----------

Now try to submit this job to your grid system with

$ dg-job-submit -o jobid -r yourCE.Domain/jobmanager-pbs-yourQueue replica.jdl

$ dg-job-status -i jobid

$ dg-job-get-output -i jobid

To check the actual presence of the file on the Storage Element:

$ globus-job-run yourSE.Domain /bin/ls -la /flatfiles/lcg

To query the LCG Replica Catalog, currently located at CERN, use:

ldapsearch -x -H ldap://lxshare0205.cern.ch:9011 -b \
 "lc=LCGCollection,rc=LCGRC,dc=lxshare0205,dc=cern,dc=ch"