Only wrap run/sudo/local if inside 'with expecting(..)' block.
Add support for single quotes in run/sudo/local command.
Fix the test to fail

* Sometimes Input/output error occurs pexpect in response to the output of ps.
* It has not been backed up env because a shallow copy.