Thank you,
Indeed is that what I need. I understand that is better to use snippets, but after I cannot interact with the terminal. I have 2 different test units: one for open SSH session works well, but after when I try to send commands to the terminal I have no interaction:
def prepare(self):
# adapters and libraries definitions
self.ADP_SSH = self.findAdapter(name="SSH_ADAPTER")
if self.ADP_SSH is None: Test(self).interrupt("Unable to find the adapter")
pass
def definition(self):
if self.step1.isEnabled():
self.step1.start()
##CAPTURE_SYS>
#SYS_RET1 = self.ADP_SSH.connect()
SYS_RET1 = self.ADP_SSH.doText(text=input('COMMAND'))
if not SYS_RET1:
self.abort("Unable to ")
The adapter is created on the Open SSH :
def prepare(self):
# adapters and libraries definitions
self.ADP_SYS = SutAdapters.SSH.Terminal(parent=self, name="SSH_ADAPTER", shared=True, destIp=input('SSH_HOST'),destPort=input('SSH_PORT'),login=input('SSH_USER'),password=input('SSH_PWD'),agent=agent('AGENT_SYSTEM'),debug=input('DEBUG'),agentSupport=input('SYS_AGT_SUPPORT') )
def definition(self):
if self.step1.isEnabled():
self.step1.start()
Cache().set(name="session",data=self.ADP_SYS)
##CAPTURE_SYS>
SYS_RET1 = self.ADP_SYS.doSession(timeout=input('TIMEOUT_SYS'))
if not SYS_RET1:
self.abort("Unable to connect to " + input('SSH_HOST') )