My Script
from __future__ import print_function
import paramiko
ip=''
port=22
username=''
password=''
cmd='./fioautomation.sh'
ssh=paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(ip,port,username,password)
stdin,stdout,stderr=ssh.exec_command(cmd)
for line in iter(lambda:stdout.readline(1024)," "):
print(line, end=" ")
Expectation: To read the output of the script, "automation.sh" simulatenously instead of waiting until the script completes execution to get the output in host machine.
Issue: I can only get the result after the automation.sh script is completed
Note: There is a FIO script inside the "automation.sh" which makes the script run for a quite long time. So I would like to kill the FIO script after a certain time period of running.
It would be helpful if someone helps me with this.
Thanks