Generalize "verify_command" function and use it for all tests