How to avoid stdin into logging in python
I am running python file which logins to remote machine1 and run some commands and logins to remote machine2 and run same commands. Capture the outputs into a logfile(using logging).It also compares output and say pass or fail.
But when those commands are getting executed, if I press enter any key , even that will be logged. Hence it makes difference in output , which leads to testcase fail even though its pass.
command ran : for i in {1..10} ; do sleep 1;ls file1 2&> /dev/null; done;ls file1;
While this was executed ,pressed key enter, 444
logfile:
running on machine1...
ls: file1: No such file or directory
running on machine2...
444^M
^M
^M
^M
^M
^M
^M
ls: file1: No such file or directory^M
testcase failed
Last edited by sahana12; 11-02-2012 at 02:48 PM.
Reason: output was wrong
|