[PATCH PM-QA v2 20/25] Improve test conditions to see if a directory or file exists