Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. Begin of A_HL_INT_GPRS_CGDSCONT_0000
  2. Passed
  3. End of A_HL_INT_GPRS_CGDSCONT_0000
  4. Begin of A_HL_INT_GPRS_CGDCONT_0002
  5. FAILED
  6. End of A_HL_INT_GPRS_CGDCONT_0002
  7.  
  8. #! /bin/bash
  9. echo "Enter the logfilename : "
  10. read logfilename
  11. echo "Entered name : $logfilename"
  12. echo "outside the while loop"
  13. let success=0
  14. let failure=0
  15. let total=0
  16. DONE=false
  17. until $DONE; do
  18. read line || DONE=true
  19. echo "$line" | grep "Begin of "
  20. if (echo "$line" | grep -i "PASSED") then
  21. ((success++))
  22. fi
  23. if (echo "$line" | grep -i "FAILED") then
  24. ((failure++))
  25. fi
  26. if (echo "$line" | grep "End of ") then
  27. ((total++))
  28. fi
  29. done < "$logfilename"
  30. echo "Total testcases : $total"
  31. echo "Total testcase with Success : $success"
  32. echo "Total testcase with Failure : $failure"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement