Here is my function:
def ExecuteList(self, myChild, intf):
for cmd, rsp, timeout in zip(self.myCommandList, self.myResponseList, self.myTimeout): # zip allows you to iterate through multiple list in parallel.
try:
myChild.sendline(cmd)
time.sleep(2)
myChild.expect(rsp, float(timeout))
time.sleep(2)
except pexpect.TIMEOUT:
return -1
intf.captureBuffer1(myChild.before)
return 0
I get an EOF exception thrown at at myChild.expect(rsp, float(timeout))
I am running the command python test.py sample.txt
and looking for a certain match from the incoming response. But the problem is myChild.expect
command only reads up to 4K bytes of the file. Anything above after the 4K mark of the file the EOF exception is raised, when it shouldn't. I am unsure why it's only reading the file up to 4K bytes and not anymore.
My timeout is 15 seconds.