Issue with pexpect, python module.
Pexpect fails to do expected behavior if the length of the command is greater than 65.
#!/usr/bin/pythonimport pexpectsshCmd='ssh root@15.186.22.105'prompt='[root@user ~]#'ConnectToClient=pexpect.spawn(sshCmd)ConnectToClient.expect('password')ConnectToClient.send('abcd')ConnectToClient.expect(prompt)ConnectToClient.send('echo abcdefghijklmnopqrst111111111111111111111111111111111111111111111111111111111 ')ConnectToClient.expect(prompt) ---> PASScommand = 'echo abcdefghijklmnopqrst111111111111111111111111111111111111111111111111111111111'ConnectToClient.expect(command, prompt)
While expecting ":", the command (.*) prompt
--->FAILS if the length of command is greater than 65.
expect_str = "%s(.*)%s" % (command, self._default_prompt)