From f962945175ebcad6b835b9c188c67323f0de9cca Mon Sep 17 00:00:00 2001 From: Pridhiviraj Paidipeddi Date: Thu, 27 Apr 2017 10:46:33 +0530 Subject: [PATCH] Update state machine for ssh connection when system goes to off. Currently when system goes to off state, we are not updating ssh connection to disconnected state. Due to which if any tests are having multiple IPL's then ssh API won't work once system comes back. This patch fixes this issue, by properly updating ssh connection to SSHConnectionState.DISCONNECTED state when ever system reaches standby state in state machine. Signed-off-by: Pridhiviraj Paidipeddi Signed-off-by: Stewart Smith --- common/OpTestSystem.py | 3 +++ testcases/fspTODCorruption.py | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/OpTestSystem.py b/common/OpTestSystem.py index e472e78f3..0bccb45c5 100644 --- a/common/OpTestSystem.py +++ b/common/OpTestSystem.py @@ -41,6 +41,8 @@ from OpTestError import OpTestError from OpTestHost import OpTestHost from OpTestUtil import OpTestUtil +from OpTestHost import SSHConnectionState + class OpSystemState(): UNKNOWN = 0 @@ -217,6 +219,7 @@ def run_OS(self, state): def run_POWERING_OFF(self, state): if int(self.sys_wait_for_standby_state(BMC_CONST.SYSTEM_STANDBY_STATE_DELAY)) == 0: print "System is in standby/Soft-off state" + self.cv_HOST.ssh.state = SSHConnectionState.DISCONNECTED return OpSystemState.OFF else: l_msg = "System failed to reach standby/Soft-off state" diff --git a/testcases/fspTODCorruption.py b/testcases/fspTODCorruption.py index 8154db0d4..ee15e4700 100644 --- a/testcases/fspTODCorruption.py +++ b/testcases/fspTODCorruption.py @@ -112,10 +112,8 @@ def runTest(self): self.tearDown() self.cv_SYSTEM.goto_state(OpSystemState.OFF) self.cv_SYSTEM.goto_state(OpSystemState.OS) - self.cv_HOST.ssh.state = SSHConnectionState.DISCONNECTED self.check_hwclock() self.cv_SYSTEM.goto_state(OpSystemState.OFF) - self.cv_HOST.ssh.state = SSHConnectionState.DISCONNECTED self.set_tod() self.cv_SYSTEM.goto_state(OpSystemState.OS) self.check_hwclock()