-1

I have two test cases in log file ActivateJob and GetJOBStatus as below, my perl script currently set to PASS as default and it searches for Error in the below test cases, if it finds error in the below it makes test case as FAIL. For GetJOBStatus test case if it is ACTIVE script as to sleep for couple of mins and it as to perform GetJOBStatus again and if it is success test case as to be passed or else fail. How can i perform sleep and search for active in GetJOBStatus test case.. ply help me out... thanks in advance..

==============log file===================

Date and Time is:Thu, 20-06-2013 06:04:19
Line 4 Command:ActivateJob(Job=Test_Abort_New1);
Answer:
ActivateFTSJobResult = Success
COMPLETED

Date and Time is:Thu, 20-06-2013 06:04:19
Line 5 Command:GetJOBStatus(Job=Test_Abort_New1);
Answer:
GetJOBStatusResult = NELabel,Status,ErrorReason,Progress,CurrentUnit,Total
TSS_320_1,ACTIVE,No Error,0,BACKUP.DSC,0
COMPLETED
amon
  • 57,091
  • 2
  • 89
  • 149
user1954970
  • 409
  • 1
  • 5
  • 14

1 Answers1

0

In order to check for a string in a file, you have to

  1. open the file using open
  2. read the file using <>
  3. search the file using m//
  4. close the file

In order to sleep (for a seconds), you have to sleep(a)

Keep in mind that unless you perform seek on your filehandle, you will have to close and then re-open it in order for it to reach the beginning.

As for you specific question, it appears to be implemented as an example in the seek perldoc

choroba
  • 231,213
  • 25
  • 204
  • 289
levengli
  • 1,091
  • 7
  • 18