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, CheckPoint 18from hypium import UiDriver 19from hypium.action.host import host 20 21 22class case05_init001(TestCase): 23 24 def __init__(self, configs): 25 self.TAG = self.__class__.__name__ 26 TestCase.__init__(self, self.TAG, configs) 27 self.tests = [ 28 "test_step" 29 ] 30 self.driver = UiDriver(self.device1) 31 self.sn = self.device1.device_sn 32 33 def setup(self): 34 self.log.info("case05_init001 start") 35 host.shell("hdc -t {} shell rm -r /data/log/hilog".format(self.sn)) 36 37 def test_step(self): 38 driver = self.driver 39 result = driver.System.execute_command("param get bootevent.samgr.ready") 40 CheckPoint("The system can detect the startup event") 41 assert "true" in result 42 43 def teardown(self): 44 self.log.info("case05_init001 down") 45