CI: fixes for OpenShift deployment of physical-simulators

-- Missing finished tag in one deployment
  -- Deep copy of the array of pod names
  -- Hack for the out-of-sync on pexpect for `oc logs` and `oc get pods` commands

Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
This commit is contained in:
Raphael Defosseux
2021-04-27 15:19:49 +02:00
parent 7acc966b94
commit 42a217228b
3 changed files with 22 additions and 11 deletions
+12 -3
View File
@@ -112,10 +112,19 @@ class SSHConnection():
return self.sshresponse
def command(self, commandline, expectedline, timeout):
logging.debug(commandline)
if commandline.count('oc logs') == 0:
logging.debug(commandline)
self.ssh.timeout = timeout
self.ssh.sendline(commandline)
self.sshresponse = self.ssh.expect([expectedline, pexpect.EOF, pexpect.TIMEOUT])
# Nasty patch when pexpect output is out of sync.
# Much pronounced when running back-to-back-back oc commands
if (commandline.count('oc logs') > 0) or (commandline.count('oc get') > 0):
self.ssh.send(commandline)
self.ssh.expect([commandline, pexpect.TIMEOUT])
self.ssh.send('\r\n')
self.sshresponse = self.ssh.expect([expectedline, pexpect.EOF, pexpect.TIMEOUT])
else:
self.ssh.sendline(commandline)
self.sshresponse = self.ssh.expect([expectedline, pexpect.EOF, pexpect.TIMEOUT])
if self.sshresponse == 0:
return 0
elif self.sshresponse == 1: