from devicetest.core.test_case import TestCase, Step
from sysCapUtils import sysCapUtils
import time
class testPowerShell(TestCase):
def __init__(self, controllers):
self.TAG = self.__class__.__name__
super().__init__(self.TAG, controllers)
def setup(self):
Step("Setup")
def process(self):
Step("Process")
state = ""
suspendStr = self.device1.execute_shell_command("power-shell suspend")
self.log.info('testPowerShell power-shell suspend suspendStr is:' + suspendStr)
assert 'SuspendDevice is called' in suspendStr
wakeUpStr = self.device1.execute_shell_command("power-shell wakeup")
self.log.info('testPowerShell power-shell wakeup wakeUpStr is:' + wakeUpStr)
time.sleep(1)
assert 'WakeupDevice is called' in wakeUpStr
time.sleep(1)
setModeStr = self.device1.execute_shell_command("power-shell setmode 603")
self.log.info('testPowerShell setmode 603 setModeStr is:' + setModeStr)
time.sleep(1)
assert 'Set Mode: 603' in setModeStr
def teardown(self):
Step("Teardown")