• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3#
4# Copyright (c) 2024 Huawei Device Co., Ltd.
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#     http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17from devicetest.core.test_case import TestCase, Step
18from sysCapUtils import sysCapUtils
19import time
20
21# @tc.number: C-STD-SOFTWARE-0401
22# @tc.name: testPowerWakeUp
23# @tc.desc: 【C-STD-SOFTWARE-0401】必须在用例明确执行设备进入不活跃状态的操作之后进入休眠状态。
24
25class testPowerWakeUp(TestCase):
26
27    def __init__(self, controllers):
28        self.TAG = self.__class__.__name__
29        super().__init__(self.TAG, controllers)
30
31    def setup(self):
32        Step("Setup")
33
34    def process(self):
35        Step("Process")
36        state = ""
37        suspendStr = self.device1.execute_shell_command("power-shell suspend")
38        time.sleep(1)
39        self.log.info('testPowerWakeUp power-shell suspend suspendStr is:' + suspendStr)
40        assert 'SuspendDevice is called' in suspendStr
41    def teardown(self):
42        Step("Teardown")