From 231c53592d1abb4096ef6a081c11bb05dadb6c90 Mon Sep 17 00:00:00 2001 From: h60047265 Date: Tue, 22 Apr 2025 20:22:07 +0800 Subject: [PATCH] =?UTF-8?q?510=E4=BB=A3=E7=A0=81=E5=B7=AE=E5=BC=82?= =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: h60047265 --- .../level1/lifecycle/lifecycle_state_001.json | 16 -- .../level1/lifecycle/lifecycle_state_001.py | 117 ------------ .../level1/lifecycle/lifecycle_state_002.json | 16 -- .../level1/lifecycle/lifecycle_state_002.py | 123 ------------ .../level1/lifecycle/lifecycle_state_003.json | 16 -- .../level1/lifecycle/lifecycle_state_003.py | 125 ------------ .../level1/lifecycle/lifecycle_state_004.json | 16 -- .../level1/lifecycle/lifecycle_state_004.py | 123 ------------ .../level1/lifecycle/lifecycle_state_005.json | 16 -- .../level1/lifecycle/lifecycle_state_005.py | 124 ------------ .../level1/lifecycle/lifecycle_state_006.json | 16 -- .../level1/lifecycle/lifecycle_state_006.py | 123 ------------ .../level1/lifecycle/lifecycle_state_007.json | 16 -- .../level1/lifecycle/lifecycle_state_007.py | 124 ------------ .../level1/lifecycle/lifecycle_state_008.json | 16 -- .../level1/lifecycle/lifecycle_state_008.py | 122 ------------ .../level1/lifecycle/lifecycle_state_009.json | 16 -- .../level1/lifecycle/lifecycle_state_009.py | 128 ------------- .../level1/lifecycle/lifecycle_state_010.json | 16 -- .../level1/lifecycle/lifecycle_state_010.py | 131 ------------- .../level1/lifecycle/lifecycle_state_011.json | 15 -- .../level1/lifecycle/lifecycle_state_011.py | 54 ------ .../level1/lifecycle/lifecycle_state_012.json | 15 -- .../level1/lifecycle/lifecycle_state_012.py | 53 ------ .../level1/lifecycle/lifecycle_state_013.json | 15 -- .../level1/lifecycle/lifecycle_state_013.py | 56 ------ .../level1/lifecycle/lifecycle_state_014.json | 15 -- .../level1/lifecycle/lifecycle_state_014.py | 55 ------ .../level1/lifecycle/lifecycle_state_015.json | 15 -- .../level1/lifecycle/lifecycle_state_015.py | 55 ------ .../level1/lifecycle/lifecycle_state_016.json | 15 -- .../level1/lifecycle/lifecycle_state_016.py | 53 ------ .../level1/lifecycle/lifecycle_state_017.json | 15 -- .../level1/lifecycle/lifecycle_state_017.py | 54 ------ .../level1/lifecycle/lifecycle_state_018.json | 15 -- .../level1/lifecycle/lifecycle_state_018.py | 54 ------ .../level1/lifecycle/lifecycle_state_019.json | 15 -- .../level1/lifecycle/lifecycle_state_019.py | 54 ------ .../level1/lifecycle/lifecycle_state_020.json | 15 -- .../level1/lifecycle/lifecycle_state_020.py | 53 ------ .../level1/lifecycle/lifecycle_state_021.json | 16 -- .../level1/lifecycle/lifecycle_state_021.py | 111 ----------- .../level1/lifecycle/lifecycle_state_022.json | 16 -- .../level1/lifecycle/lifecycle_state_022.py | 125 ------------ .../level1/lifecycle/lifecycle_state_023.json | 16 -- .../level1/lifecycle/lifecycle_state_023.py | 111 ----------- .../level1/lifecycle/lifecycle_state_024.json | 16 -- .../level1/lifecycle/lifecycle_state_024.py | 111 ----------- .../level1/lifecycle/lifecycle_state_025.json | 16 -- .../level1/lifecycle/lifecycle_state_025.py | 114 ----------- .../level1/lifecycle/lifecycle_state_026.json | 16 -- .../level1/lifecycle/lifecycle_state_026.py | 178 ------------------ .../networking/sub_samgr_sa_load_002.json | 20 -- .../networking/sub_samgr_sa_load_002.py | 150 --------------- .../networking/sub_samgr_sa_once_001.json | 20 -- .../networking/sub_samgr_sa_once_001.py | 167 ---------------- 56 files changed, 3294 deletions(-) delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_001.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_001.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_002.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_002.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_003.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_003.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_004.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_004.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_005.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_005.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_006.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_006.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_007.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_007.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_008.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_008.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_009.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_009.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_010.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_010.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_011.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_011.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_012.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_012.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_013.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_013.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_014.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_014.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_015.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_015.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_016.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_016.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_017.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_017.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_018.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_018.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_019.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_019.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_020.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_020.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_021.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_021.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_022.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_022.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_023.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_023.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_024.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_024.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_025.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_025.py delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_026.json delete mode 100644 test/autotest/testcases/level1/lifecycle/lifecycle_state_026.py delete mode 100644 test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.json delete mode 100644 test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.py delete mode 100644 test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.json delete mode 100644 test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.py diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.json deleted file mode 100644 index 64d6d449..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_001.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.py deleted file mode 100644 index c944f2b5..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.py +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase, get_report_dir, ACTUAL -from hypium import UiExplorer -from hypium.action.host import host -from hypium.action.os_hypium.checker import Assert -from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_001/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_001/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - -class LifeCycle_State_001(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - host.shell("hdc -t {} target mount".format(self.sn)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - driver.System.reboot() - - def test_step(self): - driver = self.driver - # 用例步骤 - # 1、执行push_bat脚本, 推入测试资源 - # 2、执行"hdc shell"命令, 进入shell命令行 - # 3、执行"ondemand"命令, 执行测试程序 - # 4、输入"ondemand", 进入测试模式 - # 5、输入任意字符后回车, 开始执行test case - # 6、再打开一个cmd用来查看hilog, 执行hilog | grep "Scheduler SA" - # 预期结果 - # 控制台打印: OnLoadSystemAbilitySuccesss systemAbilityId:1494 - # Hilog打印: [SA Scheduler][SA: 1494] loaded - #清理日志 - driver.shell('hilog -r') - # 开始保存日志 - device_logger = DeviceLogger(driver).set_filter_string("Scheduler SA:1494") - device_logger.start_log(get_report_dir() + 'lifecycle_state_001_txt') - result = driver.System.execute_command("ondemand test 1") - assert "OnLoadSystemAbilitySuccesss systemAbilityId:1494" in result - # 停止日志 - device_logger.stop_log() - # 检查日志输出 - device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - # self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - # self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - # self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - # self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - # self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - # self.driver.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_002.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_002.json deleted file mode 100644 index c3436e69..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_002.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_002.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_002.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_002.py deleted file mode 100644 index f232d452..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_002.py +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase, get_report_dir -from hypium import UiExplorer -from hypium.action.host import host -from hypium.action.os_hypium.checker import Assert -from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand -from devicetest.utils.file_util import get_resource_path - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_002/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_002/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -class LifeCycle_State_002(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - # 清理日志 - driver.shell('hilog -r') - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() - - def test_step(self): - driver = self.driver - # 用例步骤 - # 1、执行push_bat脚本, 推入测试资源 - # 2、执行"hdc shell"命令, 进入shell命令行 - # 3、执行"ondemand"命令, 执行测试程序 - # 4、输入"ondemand", 进入测试模式 - # 5、输入任意字符后回车, 开始执行test case - # 6、再打开一个cmd用来查看hilog, 执行hilog | grep "SA Scheduler" - # 预期结果 - # 控制台打印: OnLoadSystemAbilitySuccesss systemAbilityId:1494 - # Hilog打印: [SA Scheduler][SA: 1494] loaded - #清理日志 - driver.shell('hilog -r') - # 开始保存日志 - device_logger = DeviceLogger(driver).set_filter_string("Scheduler SA:1494") - device_logger.start_log(get_report_dir() + 'lifecycle_state_002_txt') - result = driver.System.execute_command("ondemand test 2") - assert "OnLoadSystemAbilitySuccesss systemAbilityId:1494" in result - # 停止日志 - device_logger.stop_log() - # 检查日志输出 - device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - - def teardown(self): - # self.driver.System.execute_command("kill -9 `pidof listen_test`") - # self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - # self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - # self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - # self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - # self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - # self.driver.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_003.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_003.json deleted file mode 100644 index 8a5d5d03..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_003.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_003.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_003.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_003.py deleted file mode 100644 index c54f6c95..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_003.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase, get_report_dir -from hypium import UiExplorer -from hypium.action.host import host -from hypium.action.os_hypium.checker import Assert -from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand -from devicetest.utils.file_util import get_resource_path - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_003/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_003/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -class LifeCycle_State_003(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - # 清理日志 - driver.shell('hilog -r') - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() - - def test_step(self): - driver = self.driver - # 用例步骤 - # 1、执行push_bat脚本, 推入测试资源 - # 2、执行"hdc shell"命令, 进入shell命令行 - # 3、执行"ondemand"命令, 执行测试程序 - # 4、输入"ondemand", 进入测试模式 - # 5、输入任意字符后回车, 开始执行test case - # 6、再打开一个cmd用来查看hilog, 执行hilog | grep "SA Scheduler" - # 预期结果 - # 控制台打印: OnLoadSystemAbilitySuccesss systemAbilityId:1494 - # Hilog打印: - # [SA Scheduler][SA: 1494] remove pending unload event - # [SA Scheduler][SA: 1494] loaded - #清理日志 - driver.shell('hilog -r') - # 开始保存日志 - device_logger = DeviceLogger(driver).set_filter_string("Scheduler SA:1494") - device_logger.start_log(get_report_dir() + 'lifecycle_state_003_txt') - result = driver.System.execute_command("ondemand test 3") - assert "OnLoadSystemAbilitySuccesss systemAbilityId:1494" in result - # 停止日志 - device_logger.stop_log() - # 检查日志输出 - device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - # self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - # self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - # self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - # self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - # self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - # self.driver.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_004.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_004.json deleted file mode 100644 index eee728d9..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_004.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_004.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_004.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_004.py deleted file mode 100644 index de607dfd..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_004.py +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase, get_report_dir -from hypium import UiExplorer -from hypium.action.host import host -from hypium.action.os_hypium.checker import Assert -from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand -from devicetest.utils.file_util import get_resource_path - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_004/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_004/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -class LifeCycle_State_004(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - # 清理日志 - driver.shell('hilog -r') - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - host.shell("hdc -t {} target mount".format(self.sn)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - driver.System.reboot() - - def test_step(self): - driver = self.driver - # 用例步骤 - # 1、执行push_bat脚本, 推入测试资源 - # 2、执行"hdc shell"命令, 进入shell命令行 - # 3、执行"ondemand"命令, 执行测试程序 - # 4、输入"ondemand", 进入测试模式 - # 5、输入任意字符后回车, 开始执行test case - # 6、再打开一个cmd用来查看hilog, 执行hilog | grep "SA Scheduler" - # 预期结果 - # 控制台打印: OnLoadSystemAbilitySuccesss systemAbilityId:1494 - # Hilog打印: [SA Scheduler][SA: 1494] loaded - #清理日志 - driver.shell('hilog -r') - # 开始保存日志 - device_logger = DeviceLogger(driver).set_filter_string("Scheduler SA:1494") - device_logger.start_log(get_report_dir() + 'lifecycle_state_004_txt') - result = driver.System.execute_command("ondemand test 4") - assert "OnLoadSystemAbilitySuccesss systemAbilityId:1494" in result - # 停止日志 - device_logger.stop_log() - # 检查日志输出 - device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - # self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - # self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - # self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - # self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - # self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - # self.driver.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_005.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_005.json deleted file mode 100644 index 820d3e24..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_005.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_005.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_005.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_005.py deleted file mode 100644 index eeacd655..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_005.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase, get_report_dir -from hypium import UiExplorer -from hypium.action.host import host -from hypium.action.os_hypium.checker import Assert -from hypium.action.os_hypium.device_logger import DeviceLogger -from devicetest.utils.file_util import get_resource_path - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_005/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_005/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -class LifeCycle_State_005(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - # driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() - - def test_step(self): - driver = self.driver - # 用例步骤 - # 1、执行push_bat脚本, 推入测试资源 - # 2、执行"hdc shell"命令, 进入shell命令行 - # 3、执行"ondemand"命令, 执行测试程序 - # 4、输入"ondemand", 进入测试模式 - # 5、输入任意字符后回车, 开始执行test case - # 6、再打开一个cmd用来查看hilog, 执行hilog | grep "SA Scheduler" - # 预期结果 - # 控制台打印: OnLoadSystemAbilitySuccesss systemAbilityId:1494 - # Hilog打印: - # [SA Scheduler][SA: 1494] remove pending unload event - # [SA Scheduler][SA: 1494] loaded - #清理日志 - driver.shell('hilog -r') - # 开始保存日志 - device_logger = DeviceLogger(driver).set_filter_string("Scheduler SA:1494") - device_logger.start_log(get_report_dir() + 'lifecycle_state_005_txt') - result = driver.System.execute_command("ondemand test 5") - assert "OnLoadSystemAbilitySuccesss systemAbilityId:1494" in result - # 停止日志 - device_logger.stop_log() - # 检查日志输出 - device_logger.check_log("Scheduler SA:1494 unloadable", EXCEPTION=True) - device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - # self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - # self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - # self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - # self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - # self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - # self.driver.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_006.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_006.json deleted file mode 100644 index 100b3027..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_006.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_006.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_006.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_006.py deleted file mode 100644 index 0c220736..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_006.py +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase, get_report_dir -from hypium import UiExplorer -from hypium.action.host import host -from hypium.action.os_hypium.checker import Assert -from hypium.action.os_hypium.device_logger import DeviceLogger -from devicetest.utils.file_util import get_resource_path - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_006/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_006/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - -class LifeCycle_State_006(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - # driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() - - def test_step(self): - driver = self.driver - # 用例步骤 - # 1、执行push_bat脚本, 推入测试资源 - # 2、执行"hdc shell"命令, 进入shell命令行 - # 3、执行"ondemand"命令, 执行测试程序 - # 4、输入"ondemand", 进入测试模式 - # 5、输入任意字符后回车, 开始执行test case - # 6、再打开一个cmd用来查看hilog, 执行hilog | grep "SA Scheduler" - # 预期结果 - # 控制台打印: OnLoadSystemAbilitySuccesss systemAbilityId:1494 - # Hilog打印: - # [SA Scheduler][SA: 1494] save load event - # [SA Scheduler][process: listen_test] stopped - # [SA Scheduler][SA: 1494] loaded - #清理日志 - driver.shell('hilog -r') - # 开始保存日志 - device_logger = DeviceLogger(driver).set_filter_string("I C018") - device_logger.start_log(get_report_dir() + 'lifecycle_state_006_txt') - result = driver.System.execute_command("ondemand test 6") - assert "OnLoadSystemAbilitySuccesss systemAbilityId:1494" in result - # 停止日志 - device_logger.stop_log() - # 检查日志输出 - device_logger.check_log("Scheduler SA:1494 save load event", EXCEPTION=True) - device_logger.check_log("Scheduler proc:listen_test stopped", EXCEPTION=True) - device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - # self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - # self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - # self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - # self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - # self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - # self.driver.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_007.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_007.json deleted file mode 100644 index 9314daf2..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_007.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_007.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_007.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_007.py deleted file mode 100644 index 73f8cf0b..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_007.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase, get_report_dir -from hypium import UiExplorer -from hypium.action.host import host -from hypium.action.os_hypium.checker import Assert -from hypium.action.os_hypium.device_logger import DeviceLogger -from devicetest.utils.file_util import get_resource_path - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_007/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_007/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - -class LifeCycle_State_007(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - host.shell("hdc -t {} target mount".format(self.sn)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - driver.System.reboot() - - def test_step(self): - driver = self.driver - # 用例步骤 - # 1、执行push_bat脚本, 推入测试资源 - # 2、执行"hdc shell"命令, 进入shell命令行 - # 3、执行"ondemand"命令, 执行测试程序 - # 4、输入"ondemand", 进入测试模式 - # 5、输入任意字符后回车, 开始执行test case - # 6、再打开一个cmd用来查看hilog, 执行hilog | grep "SA Scheduler" - # 预期结果 - # 控制台打印: OnLoadSystemAbilitySuccesss systemAbilityId:1494 - # Hilog打印: - # [SA Scheduler][SA: 1494] save load event - # [SA Scheduler][process: listen_test] stopped - # [SA Scheduler][SA: 1497] loaded - #清理日志 - driver.shell('hilog -r') - # 开始保存日志 - device_logger = DeviceLogger(driver).set_filter_string("I C018") - device_logger.start_log(get_report_dir() + '//lifecycle_state_007_txt') - # 通过ondemand手动加载sa - driver.System.execute_command("ondemand test") - time.sleep(20) - # 停止日志 - device_logger.stop_log() - # 断言 - log_check_result = device_logger.check_log("Scheduler SA:1494 save load event", EXCEPTION=True) - log_check_result = device_logger.check_log("Scheduler proc:listen_test stopped", EXCEPTION=True) - log_check_result = device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - self.driver.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_008.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_008.json deleted file mode 100644 index c5338ddc..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_008.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_008.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_008.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_008.py deleted file mode 100644 index 5065b719..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_008.py +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase, get_report_dir -from hypium import UiExplorer -from hypium.action.host import host -from hypium.action.os_hypium.checker import Assert -from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand -from devicetest.utils.file_util import get_resource_path - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_008/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_008/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - -class LifeCycle_State_008(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() - - def test_step(self): - driver = self.driver - # 用例步骤 - # 1、执行push_bat脚本, 推入测试资源 - # 2、执行"hdc shell"命令, 进入shell命令行 - # 3、执行"ondemand"命令, 执行测试程序 - # 4、输入"ondemand", 进入测试模式 - # 5、输入任意字符后回车, 开始执行test case - # 6、再打开一个cmd用来查看hilog, 执行hilog | grep "SA Scheduler" - # 预期结果 - # 控制台打印: OnLoadSystemAbilitySuccesss systemAbilityId:1494 - # Hilog打印: - # [SA Scheduler][SA: 1494] save load event - # [SA Scheduler][process: listen_test] stopped - # [SA Scheduler][SA: 1497] loaded - #清理日志 - driver.shell('hilog -r') - # 开始保存日志 - device_logger = DeviceLogger(driver).set_filter_string("I C018") - device_logger.start_log(get_report_dir() + '//lifecycle_state_008_txt') - result = driver.System.execute_command("ondemand test 8") - assert "OnLoadSystemAbilitySuccesss systemAbilityId:1494" in result - # 停止日志 - device_logger.stop_log() - # 检查日志输出 - device_logger.check_log("Scheduler SA:1499 handle load failed event", EXCEPTION=True) - device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - # self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - # self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - # self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - # self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - # self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - # self.driver.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_009.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_009.json deleted file mode 100644 index 95a1978d..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_009.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_009.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_009.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_009.py deleted file mode 100644 index fce5ff72..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_009.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase, get_report_dir -from hypium import UiExplorer -from hypium.action.host import host -from hypium.action.os_hypium.checker import Assert -from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand -from devicetest.utils.file_util import get_resource_path - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_009/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_009/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - -class LifeCycle_State_009(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - host.shell("hdc -t {} target mount".format(self.sn)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - driver.System.reboot() - - def test_step(self): - driver = self.driver - # 用例步骤 - # 1、执行push_bat脚本, 推入测试资源 - # 2、执行"hdc shell"命令, 进入shell命令行 - # 3、执行"ondemand"命令, 执行测试程序 - # 4、输入"ondemand", 进入测试模式 - # 5、输入任意字符后回车, 开始执行test case - # 6、再打开一个cmd用来查看hilog, 执行hilog | grep "SA Scheduler" - # 预期结果 - # 控制台打印: OnLoadSystemAbilitySuccesss systemAbilityId:1494 打印五次 - # Hilog打印: - # [SA Scheduler][SA: 1494] save load event - # [SA Scheduler][SA: 1494] loaded - #清理日志 - driver.shell('hilog -r') - # 开始保存日志 - device_logger = DeviceLogger(driver).set_filter_string("Scheduler SA:1494") - device_logger.start_log(get_report_dir() + '//lifecycle_state_009_txt') - result = driver.System.execute_command("ondemand test 9") - # 统计控制台字符串出现次数 - countWindowResult = result.count("OnLoadSystemAbilitySuccesss systemAbilityId:1494") - assert countWindowResult == 5 - # 停止日志 - device_logger.stop_log() - # 检查日志输出 - device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - device_logger.check_log("Scheduler SA:1494 not loaded", EXCEPTION=True) - - log_check_result1 = device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - Assert.equal(self, log_check_result1, True) - log_check_result2 = device_logger.check_log("Scheduler SA:1494 save load event", EXCEPTION=True) - Assert.equal(self, log_check_result2, True) - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - self.driver.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_010.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_010.json deleted file mode 100644 index f9fe11d6..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_010.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_010.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_010.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_010.py deleted file mode 100644 index 34d53b2b..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_010.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase, get_report_dir -from hypium import UiExplorer -from hypium.action.host import host -from hypium.action.os_hypium.checker import Assert -from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand -from devicetest.utils.file_util import get_resource_path - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_010/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_010/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - -class LifeCycle_State_010(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - host.shell("hdc -t {} target mount".format(self.sn)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - driver.System.reboot() - - def test_step(self): - driver = self.driver - # 用例步骤 - # 1、执行push_bat脚本, 推入测试资源 - # 2、执行"hdc shell"命令, 进入shell命令行 - # 3、执行"ondemand"命令, 执行测试程序 - # 4、输入"ondemand", 进入测试模式 - # 5、输入任意字符后回车, 开始执行test case - # 6、再打开一个cmd用来查看hilog, 执行hilog | grep "SA Scheduler" - # 预期结果 - # 控制台打印: OnLoadSystemAbilitySuccesss systemAbilityId:1494 打印五次 - # Hilog打印: - # [SA Scheduler][SA: 1494] loaded - #清理日志 - driver.shell('hilog -r') - # 开始保存日志 - device_logger = DeviceLogger(driver).set_filter_string("Scheduler SA:1494") - device_logger.start_log(get_report_dir() + '//lifecycle_state_010_txt') - log_path = os.path.join(self.get_case_report_path(), "lifecycle_state_010_txt") - command = AsyncCommand(driver).set_output_file(log_path) - command.start_device_command("ondemand test") - time.sleep(130) - # 停止后台命令 - command.stop() - # 停止日志 - device_logger.stop_log() - # 断言 - # 检查日志输出 - countResult = Disk_drop_log.count_keys_disk_dropping_logs(self.get_case_report_path(), - "OnLoadSystemAbilitySuccesss systemAbilityId:1494") - assert countResult >= 23 - device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - device_logger.check_log("Scheduler SA:1494 not loaded", EXCEPTION=True) - - log_check_result = device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - Assert.equal(self, log_check_result1, True) - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - self.driver.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_011.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_011.json deleted file mode 100644 index 2dfb3864..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_011.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_011.py" - ] - } - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_011.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_011.py deleted file mode 100644 index 405b0589..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_011.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import time -from devicetest.core.test_case import TestCase, CheckPoint -from hypium import UiDriver -from tools.get_source_path import get_source_path -from tools.push_remove_source import push_source, remove_source - - -class lifecycle_state_011(TestCase): - - def __init__(self, configs): - self.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, configs) - self.tests = [ - "test_step" - ] - self.driver = UiDriver(self.device1) - self.sn = self.device1.device_sn - self.source_path = {} - - def setup(self): - self.log.info("lifecycle_state_011 start") - need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, - "proxy": True, "para": True} - self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_011") - push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - - def test_step(self): - driver = self.driver - device_logger = DeviceLogger(driver).set_filter_string("I C018") - device_logger.start_log(get_report_dir() + "//lifecycle_state_011.txt") - driver.System.execute_command("ondemand test") - time.sleep(20) - device_logger.stop_log() - device_logger.check_log("Scheduler SA:1494 in state 0,not need unload SA", EXCEPTION=True) - - def teardown(self): - remove_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - self.log.info("lifecycle_state_011 down") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_012.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_012.json deleted file mode 100644 index fcd8dbb4..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_012.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_012.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_012.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_012.py deleted file mode 100644 index 9bc330a6..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_012.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import time -from devicetest.core.test_case import TestCase, CheckPoint -from hypium import UiDriver -from tools.get_source_path import get_source_path -from tools.push_remove_source import push_source, remove_source - - -class lifecycle_state_012(TestCase): - - def __init__(self, configs): - self.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, configs) - self.tests = [ - "test_step" - ] - self.driver = UiDriver(self.device1) - self.sn = self.device1.device_sn - self.source_path = {} - - def setup(self): - self.log.info("lifecycle_state_012 start") - need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, - "proxy": True, "para": True} - self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_012") - push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - - def test_step(self): - driver = self.driver - device_logger = DeviceLogger(driver).set_filter_string("Scheduler SA:1494") - device_logger.start_log(get_report_dir() + "//lifecycle_state_012.txt") - driver.System.execute_command("ondemand test 12") - device_logger.stop_log() - device_logger.check_log("Scheduler SA:1494 in state 0,not need unload SA", EXCEPTION=True) - - def teardown(self): - remove_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - self.log.info("lifecycle_state_012 down") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_013.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_013.json deleted file mode 100644 index 291eb32e..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_013.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_013.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_013.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_013.py deleted file mode 100644 index 5644e2bc..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_013.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import time -from devicetest.core.test_case import TestCase, CheckPoint -from hypium import UiDriver -from tools.get_source_path import get_source_path -from tools.push_remove_source import push_source, remove_source - - -class lifecycle_state_013(TestCase): - - def __init__(self, configs): - self.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, configs) - self.tests = [ - "test_step" - ] - self.driver = UiDriver(self.device1) - self.sn = self.device1.device_sn - self.source_path = {} - - def setup(self): - self.log.info("lifecycle_state_013 start") - need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, - "proxy": True, "para": True} - self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_013") - push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - - def test_step(self): - driver = self.driver - device_logger = DeviceLogger(driver).set_filter_string("Scheduler SA:1494") - device_logger.start_log(get_report_dir() + "//lifecycle_state_013.txt") - driver.System.execute_command("ondemand test 13") - device_logger.stop_log() - device_logger.check_log("Scheduler SA:1494 save load event", EXCEPTION=True) - device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - device_logger.check_log("Scheduler SA:1494 unloadable", EXCEPTION=True) - device_logger.check_log("Scheduler SA:1494 not loaded", EXCEPTION=True) - - def teardown(self): - remove_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - self.log.info("lifecycle_state_013 down") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_014.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_014.json deleted file mode 100644 index 397f2df6..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_014.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_014.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_014.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_014.py deleted file mode 100644 index c0e4988f..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_014.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import time -from devicetest.core.test_case import TestCase, CheckPoint -from hypium import UiDriver -from tools.get_source_path import get_source_path -from tools.push_remove_source import push_source, remove_source - - -class lifecycle_state_014(TestCase): - - def __init__(self, configs): - self.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, configs) - self.tests = [ - "test_step" - ] - self.driver = UiDriver(self.device1) - self.sn = self.device1.device_sn - self.source_path = {} - - def setup(self): - self.log.info("lifecycle_state_014 start") - need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, - "proxy": True, "para": True} - self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_014") - push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - - def test_step(self): - driver = self.driver - device_logger = DeviceLogger(driver).set_filter_string("Scheduler SA:1494") - device_logger.start_log(get_report_dir() + "//lifecycle_state_014.txt") - driver.System.execute_command("ondemand test 14") - device_logger.stop_log() - device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - device_logger.check_log("Scheduler SA:1494 unloadable", EXCEPTION=True) - device_logger.check_log("Scheduler SA:1494 not loaded", EXCEPTION=True) - - def teardown(self): - remove_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - self.log.info("lifecycle_state_014 down") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_015.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_015.json deleted file mode 100644 index cf88b7bc..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_015.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_015.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_015.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_015.py deleted file mode 100644 index b355e9cd..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_015.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import time -from devicetest.core.test_case import TestCase, CheckPoint -from hypium import UiDriver -from tools.get_source_path import get_source_path -from tools.push_remove_source import push_source, remove_source - - -class lifecycle_state_015(TestCase): - - def __init__(self, configs): - self.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, configs) - self.tests = [ - "test_step" - ] - self.driver = UiDriver(self.device1) - self.sn = self.device1.device_sn - self.source_path = {} - - def setup(self): - self.log.info("lifecycle_state_015 start") - need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, - "proxy": True, "para": True} - self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_015") - push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - - def test_step(self): - driver = self.driver - device_logger = DeviceLogger(driver).set_filter_string("I C018") - device_logger.start_log(get_report_dir() + "//lifecycle_state_015.txt") - driver.System.execute_command("ondemand test 15") - device_logger.stop_log() - device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - device_logger.check_log("Scheduler SA:1494 unloadable", EXCEPTION=True) - device_logger.check_log("Scheduler proc:listen_test SA num:3,notloaded:1,unloadable:1", EXCEPTION=True) - - def teardown(self): - remove_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - self.log.info("lifecycle_state_015 down") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_016.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_016.json deleted file mode 100644 index 6d7c9498..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_016.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_016.py" - ] - } - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_016.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_016.py deleted file mode 100644 index af425394..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_016.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import time -from devicetest.core.test_case import TestCase, CheckPoint -from hypium import UiDriver -from tools.get_source_path import get_source_path -from tools.push_remove_source import push_source, remove_source - - -class lifecycle_state_016(TestCase): - - def __init__(self, configs): - self.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, configs) - self.tests = [ - "test_step" - ] - self.driver = UiDriver(self.device1) - self.sn = self.device1.device_sn - self.source_path = {} - - def setup(self): - self.log.info("lifecycle_state_016 start") - need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, - "proxy": True, "para": True} - self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_016") - push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - - def test_step(self): - driver = self.driver - device_logger = DeviceLogger(driver).set_filter_string("I C018") - device_logger.start_log(get_report_dir() + "//lifecycle_state_016.txt") - driver.System.execute_command("ondemand test") - device_logger.stop_log() - device_logger.check_log("Scheduler SA:1494 in state 0,not need unload SA", EXCEPTION=True) - - def teardown(self): - remove_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - self.log.info("lifecycle_state_016 down") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_017.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_017.json deleted file mode 100644 index a3425f1e..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_017.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_017.py" - ] - } - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_017.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_017.py deleted file mode 100644 index b2fd1538..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_017.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import time -from devicetest.core.test_case import TestCase, CheckPoint -from hypium import UiDriver -from tools.get_source_path import get_source_path -from tools.push_remove_source import push_source, remove_source - - -class lifecycle_state_017(TestCase): - - def __init__(self, configs): - self.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, configs) - self.tests = [ - "test_step" - ] - self.driver = UiDriver(self.device1) - self.sn = self.device1.device_sn - self.source_path = {} - - def setup(self): - self.log.info("lifecycle_state_017 start") - need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, - "proxy": True, "para": True} - self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_017") - push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - - def test_step(self): - driver = self.driver - device_logger = DeviceLogger(driver).set_filter_string("I C018") - device_logger.start_log(get_report_dir() + "//lifecycle_state_017.txt") - result = driver.System.execute_command("ondemand test") - device_logger.stop_log() - assert "OnLoadSystemAbilityFail systemAbilityId:1499" in result.split("input")[18] - device_logger.check_log("Scheduler SA:1494 not loaded", EXCEPTION=True) - - def teardown(self): - remove_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - self.log.info("lifecycle_state_017 down") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_018.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_018.json deleted file mode 100644 index 0bd10d10..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_018.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_018.py" - ] - } - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_018.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_018.py deleted file mode 100644 index 331d6262..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_018.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import time -from devicetest.core.test_case import TestCase, CheckPoint -from hypium import UiDriver -from tools.get_source_path import get_source_path -from tools.push_remove_source import push_source, remove_source - - -class lifecycle_state_018(TestCase): - - def __init__(self, configs): - self.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, configs) - self.tests = [ - "test_step" - ] - self.driver = UiDriver(self.device1) - self.sn = self.device1.device_sn - self.source_path = {} - - def setup(self): - self.log.info("lifecycle_state_018 start") - need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, - "proxy": True, "para": True} - self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_018") - push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - - def test_step(self): - driver = self.driver - device_logger = DeviceLogger(driver).set_filter_string("I C018") - device_logger.start_log(get_report_dir() + "//lifecycle_state_018.txt") - driver.System.execute_command("ondemand test") - device_logger.stop_log() - device_logger.check_log("Scheduler SA:1494 in state 0,not need unload SA", EXCEPTION=True) - device_logger.check_log("Scheduler SA:1494 not loaded", EXCEPTION=True) - - def teardown(self): - remove_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - self.log.info("lifecycle_state_018 down") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_019.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_019.json deleted file mode 100644 index e590c529..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_019.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_019.py" - ] - } - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_019.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_019.py deleted file mode 100644 index 4c0876cd..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_019.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import time -from devicetest.core.test_case import TestCase, CheckPoint -from hypium import UiDriver -from tools.get_source_path import get_source_path -from tools.push_remove_source import push_source, remove_source - - -class lifecycle_state_019(TestCase): - - def __init__(self, configs): - self.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, configs) - self.tests = [ - "test_step" - ] - self.driver = UiDriver(self.device1) - self.sn = self.device1.device_sn - self.source_path = {} - - def setup(self): - self.log.info("lifecycle_state_019 start") - need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, - "proxy": True, "para": True} - self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_019") - push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - - def test_step(self): - driver = self.driver - device_logger = DeviceLogger(driver).set_filter_string("I C018") - device_logger.start_log(get_report_dir() + "//lifecycle_state_019.txt") - driver.System.execute_command("ondemand test") - device_logger.stop_log() - device_logger.check_log("Scheduler SA:1494 in state 0,not need unload SA", EXCEPTION=True) - device_logger.check_log("Scheduler SA:1494 not loaded", EXCEPTION=True) - - def teardown(self): - remove_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - self.log.info("lifecycle_state_019 down") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_020.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_020.json deleted file mode 100644 index 82f18e61..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_020.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_020.py" - ] - } - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_020.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_020.py deleted file mode 100644 index bdf4f7fc..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_020.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import time -from devicetest.core.test_case import TestCase, CheckPoint -from hypium import UiDriver -from tools.get_source_path import get_source_path -from tools.push_remove_source import push_source, remove_source - - -class lifecycle_state_020(TestCase): - - def __init__(self, configs): - self.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, configs) - self.tests = [ - "test_step" - ] - self.driver = UiDriver(self.device1) - self.sn = self.device1.device_sn - self.source_path = {} - - def setup(self): - self.log.info("lifecycle_state_020 start") - need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, - "proxy": True, "para": True} - self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_020") - push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - - def test_step(self): - driver = self.driver - device_logger = DeviceLogger(driver).set_filter_string("01800") - device_logger.start_log(get_report_dir() + "//lifecycle_state_020.txt") - driver.System.execute_command("ondemand test") - device_logger.stop_log() - device_logger.check_log("Scheduler SA:1494 in state 0,not need unload SA", EXCEPTION=True) - - def teardown(self): - remove_source(source_path=self.source_path, driver=self.driver, sn=self.sn) - self.log.info("lifecycle_state_020 down") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_021.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_021.json deleted file mode 100644 index 565d75c5..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_021.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_021.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_021.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_021.py deleted file mode 100644 index 9b8cd3cb..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_021.py +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase, get_report_dir -from hypium import UiExplore -from hypium.action.host import host - -from hypium.action.os_hypium.checker import Assert -from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand -from devicetest.utils.file.file_util import get_resource_path - - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_021/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_021/listen_test.json", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - - -class LifeCycle_State_021(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() - - def test_step(self): - # 步骤 "ondemand test 21"命令,执行测试程序 - # 预期结果 - # 控制台打印: GetSystemAbility systemAbilityId:1494 faild - driver = self.driver - result = driver.System.execute_command("ondemand test 21") - assert "GetSystemAbility systemAbilityId:1494 faild" in result - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - #self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - #self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - #self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - #self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - #self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - #self.driver.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_022.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_022.json deleted file mode 100644 index 0a6fbf9b..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_022.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_022.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_022.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_022.py deleted file mode 100644 index e38b132e..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_022.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase, get_report_dir -from hypium import UiExplore -from hypium.action.host import host - -from hypium.action.os_hypium.checker import Assert -from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand -from devicetest.utils.file.file_util import get_resource_path - - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_022/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_022/listen_test.json", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - - -class LifeCycle_State_022(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() - - def test_step(self): - driver = self.driver - # 用例同步 - # 执行"ondemand test 24"命令, 执行测试程序 - # 预期结果 - # 控制台打印: - # GetSystemAbility result: success - driver.shell('hilog -r') - # 开始保存日志 - device_logger = DeviceLogger(driver).set_filter_string("Scheduler SA:1494") - device_logger.start_log(get_report_dir() + 'lifecycle_state_022_txt') - result = driver.System.execute_command("ondemand test 22") - assert "GetSystemAbility systemAbilityId:1494 faild" in result - # 停止日志 - device_logger.stop_log() - # 检查日志输出 - device_logger.check_log("Scheduler SA:1494 loaded", EXCEPTION=True) - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - #self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - #self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - #self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - #self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - #self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - #self.driver.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") - - - - diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_023.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_023.json deleted file mode 100644 index 6f311ec0..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_023.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_023.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_023.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_023.py deleted file mode 100644 index 7a158da7..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_023.py +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase -from devicetest.utils.file.file_util import get_resource_path -from hypium import UiExplore -from hypium.action.host import host -from hypium.action.os_hypium.device_logger import AsyncCommand - - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_023/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_023/listen_test.json", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - - -class LifeCycle_State_023(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() - - def test_step(self): - driver = self.driver - # 用例同步 - # 执行"ondemand test 24"命令, 执行测试程序 - # 预期结果 - # 控制台打印: - # GetSystemAbility result: success - result = driver.System.execute_command("ondemand test 23") - assert "GetSystemAbility systemAbilityId:1494 faild" in result - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - self.driver.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_024.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_024.json deleted file mode 100644 index fc00a077..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_024.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_024.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_024.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_024.py deleted file mode 100644 index 6bfb7238..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_024.py +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase -from devicetest.utils.file.file_util import get_resource_path -from hypium import UiExplore -from hypium.action.host import host -from hypium.action.os_hypium.device_logger import AsyncCommand - - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_024/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_024/listen_test.json", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - - -class LifeCycle_State_024(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() - - def test_step(self): - driver = self.driver - # 用例同步 - # 执行"ondemand test 24"命令, 执行测试程序 - # 预期结果 - # 控制台打印: - # GetSystemAbility result: success - result = driver.System.execute_command("ondemand test 24") - assert "GetSystemAbility systemAbilityId:1494 faild" in result - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - self.driver.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_025.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_025.json deleted file mode 100644 index 20c0df83..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_025.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_025.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_025.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_025.py deleted file mode 100644 index 0a7419e5..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_025.py +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os - -from devicetest.core.test_case import TestCase - -#导入时间 -import time -from devicetest.utils.file.file_util import get_resource_path -from hypium import UiExplore -from hypium.action.host import host -from hypium.action.os_hypium.device_logger import AsyncCommand - - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_025/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_025/listen_test.json", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - - -class LifeCycle_State_025(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() - - def test_step(self): - driver = self.driver - # 用例同步 - # 执行"ondemand test 24"命令, 执行测试程序 - # 预期结果 - # 控制台打印: - # GetSystemAbility result: success - result = driver.System.execute_command("ondemand test 25") - assert "GetSystemAbility systemAbilityId:1494 faild" in result - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - self.driver.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") - diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_026.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_026.json deleted file mode 100644 index 0a781e3a..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_026.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/lifecycle_state_026.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_026.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_026.py deleted file mode 100644 index 50caf381..00000000 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_026.py +++ /dev/null @@ -1,178 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os - - - - -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import time - -from hypium import UiExplore -from hypium.action.host import host -from hypium.action.os_hypium.device_logger import DeviceLogger -from devicetest.core.test_case import TestCase, CheckPoint, get_report_dir -from devicetest.utils.file.file_util import get_resource_path - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_026/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_026/listen_test.json", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - -sa_samgr_path = get_resource_path( - "resource/level/lifecycle/lifecycle_state_026/samgr.para", - isdir=None) - -sa_samgr_dac_path = get_resource_path( - "resource/level/lifecycle/lifecycle_state_026/samgr.para.dac", - isdir=None) - -sa_para_origin = get_resource_path( - "resource/origin_file/samgr.para", isdir=None) - -sa_para_dac_origin = get_resource_path( - "resource/origin_file/samgr.para.dac", isdir=None) - -class LifeCycle_State_026(TestCase): - - def __init__(self, controllers): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, controllers) - self.tests = [ - "test_step" - ] - self.driver = UiExplore(self.driver1) - self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_samgr_path, device_path="/systemlib/etc/param") - # host.shell("hdc -t {} shell chmod 755 /system/etc/param/samgr.para".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_samgr_dac_path, device_path="/systemlib/etc/param") - # host.shell("hdc -t {} shell chmod 755 /system/etc/param/samgr.para.dac".format(self.sn)) - # driver.System.reboot() - - def test_step(self): - driver = self.driver - # 用例同步 - # 执行"ondemand test 24"命令, 执行测试程序 - # 预期结果 - # 控制台打印: - # GetSystemAbility result: success - result = driver.System.execute_command("ondemand test 26") - assert "GetSystemAbility systemAbilityId:1494 faild" in result - # 1、打开日志目录 - # 2、关闭wifi (20s后卸载) - # 3、等待5s, hidumper -ls查看1494存在 - # 4、打开wifi出发加载, 移除延时卸载 - # 5、等待15s后hidumper -ls查看1494是否存在 - # 6、停止日志落盘, 查看Scheduler SA:1494 rm delay unlaod event - # - # driver = selef.driver - #device_logger = DeviceLogger(driver).set_filter_string("Scheduler") - #device_logger.start_log(get_report_dir() + '//lifecycle_state_026.txt') - # 打开WiFi - #driver.wifi.enable() - #time.sleep(10) - # #关闭WiFi - #driver.wifi.disable() - #time.sleep(5) - # #打开WiFi - #driver.wifi.enable() - #time.sleep(15) - #device_logger.stop_log() - #log_check_result = device_logger.check_log("Scheduler SA:1494 rm delay unlaod event", EXCEPTION=False) - #assert log_check_result is True - #result = driver.System.execute_command("hidumper -ls") - #assert "1494" in result - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - self.driver.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - self.driver.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - self.driver.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - self.driver.Storage.remove_file("/system/etc/init/listen_test.cfg") - self.driver.Storage.remove_file("/system/etc/init/listen_test.json") - self.driver.Storage.remove_file("/system/bin/ondemand") - self.driver.Storage.remove_file("/system/etc/param/samgr.para") - self.driver.Storage.remove_file("/system/etc/param/samgr.para.dac") - self.driver.Storage.push_file(local_path=sa_para_origin, device_path="/systemlib/etc/param") - self.driver.Storage.push_file(local_path=sa_para_dac_origin, device_path="/systemlib/etc/param") - self.log.info("清理动作: 关闭设置") - diff --git a/test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.json b/test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.json deleted file mode 100644 index c66143c4..00000000 --- a/test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - }, - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/sub_samgr_sa_load_002.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.py b/test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.py deleted file mode 100644 index fd28f678..00000000 --- a/test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.py +++ /dev/null @@ -1,150 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase, setup, CheckPoint -from devicetest.utils.file.file_util import get_resource_path -from hypium import * -from hypium.action.host import host - -from aw import NetWorking - -sa_listen_cfg_path = get_resource_path( - "resource/level/networking/sub_samgr_sa_load_002/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/networking/sub_samgr_sa_load_002/listen_test.json", - isdir=None) - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - - -class Sub_Samgr_SA_Load_002(TestCase): - - def __init__(self, configs): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, configs) - self.driver1 = UiDriver(self.device1) - self.driver1 = UiDriver(self.device2) - self.sn1 = self.device1.device_sn - self.sn1 = self.device2.device_sn - - def setup(self): - driver1 = self.driver1 - driver1 = self.driver1 - # host.shell()用来在pc端执行shell命令,亦可直接执行bat脚本(bat脚本中是push所需要的测试文件) - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn1)) - host.shell("hdc -t {} target mount".format(self.sn1)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn1)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn1)) - - driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn1) - - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn1)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn1)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn1)) - - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn2)) - host.shell("hdc -t {} target mount".format(self.sn2)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn2)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn2)) - - driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn2) - - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn2)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn2)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn2)) - - # # 设备A登录华为账号 - NetWorking.login_account(driver1) - # # 设备b登录华为账号 - NetWorking.login_account(driver2) - time.sleep(3) - #判断组网成功 - NetWorking.determine_newwork(driver1) - - def process(self): - driver1 = self.driver1 - driver2 = self.driver2 - # 步骤 - # 1、准备两台手机,通过wifi组上网络(自己手机开热点) - # 2、执行ondemand小包分别推测试文件到手机中 - # 3、执行hdc shell - # 4、执行ondemand, 然后执行sa,load, 1494 - - #预期结果 - # 5、本端设备cmd窗口显示succed, 远端设备通过hidumper -ls查找1494 - - driver1.System.execute_command("ondemand sa load 1494") - result1 = driver1.System.execute_command("hidumper -ls ") - assert "1494" in result1 - # 远端设备也查询到 - result2 = driver1.System.execute_command("hidumper -ls ") - assert "1494" in result2 - - def teardown(self): - self.driver.System.execute_command("kill -9 `pidof listen_test`") - host.shell("hdc -t {} target mount".format(self.sn1)) - self.driver1.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - self.driver1.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - self.driver1Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - self.driver1.Storage.remove_file("/system/etc/init/listen_test.cfg") - self.driver1.Storage.remove_file("/system/etc/init/listen_test.json") - self.driver1.Storage.remove_file("/system/bin/ondemand") - - host.shell("hdc -t {} target mount".format(self.sn2)) - self.driver2.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - self.driver2.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - self.driver2.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - self.driver2.Storage.remove_file("/system/etc/init/listen_test.cfg") - self.driver2.Storage.remove_file("/system/etc/init/listen_test.json") - self.driver2.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") \ No newline at end of file diff --git a/test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.json b/test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.json deleted file mode 100644 index 947357d1..00000000 --- a/test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "hypium自测试用例", - "environment": [ - { - "type": "device", - "label": "phone" - }, - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "testcases/level1/lifecycle/sub_samgr_sa_once_001.py" - ] - }, - "kits":[] - } \ No newline at end of file diff --git a/test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.py b/test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.py deleted file mode 100644 index dda9e322..00000000 --- a/test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.py +++ /dev/null @@ -1,167 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from devicetest.core.test_case import TestCase -from devicetest.utils.file.file_util import get_resource_path -from hypium import * -from hypium.action.host import host - -from aw import NetWorking - -sa_listen_cfg_path = get_resource_path( - "resource/level/networking/sub_samgr_sa_load_002/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/networking/sub_samgr_sa_load_002/listen_test.json", - isdir=None) - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - - -class Sub_Samgr_SA_Load_002(TestCase): - - def __init__(self, configs): - sele.TAG = self.__class__.__name__ - TestCase.__init__(self, self.TAG, configs) - self.driver1 = UiDriver(self.device1) - self.driver1 = UiDriver(self.device2) - self.sn1 = self.device1.device_sn - self.sn1 = self.device2.device_sn - - def setup(self): - driver = self.driver1 - driver.Wifi.disable() - driver.Bluetooth.disable() #避免开始就组网成功 - # host.shell()用来在pc端执行shell命令,亦可直接执行bat脚本(bat脚本中是push所需要的测试文件) - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn1)) - # 推入资源文件进入设备 - host.shell("hdc -t {} target mount".format(self.sn1)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn1)) - - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn1)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn1)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn2)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn1)) - - driver2 = self.driver2 - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn2)) - # 推入资源文件进入设备 - host.shell("hdc -t {} target mount".format(self.sn2)) - driver2.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn2)) - - driver2.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn2)) - - driver2.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn2)) - - driver2.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn2)) - - driver2.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn2)) - - driver.System.reboot() - driver2.System.reboot() - - - def process(self): - # 执行步骤 - #1、执行push.bat脚本, 推入once - online测试资源 - #2、组网后hidumper-ls查看 - #3、wifi断开后hidumper -ls再次查看 - #4、组网后hidumper-ls再次查看 - #5、wifi断开后hidumper -ls再次查看 - - # 预期结果 - #1、DistributedDeviceProfile存在 - #2、20s后DistributedDeviceProfile不存在 - #3、DistributedDeviceProfile存在 - #4、DistributedDeviceProfile存在 - - #3 - # 设备A断开wifi蓝牙 - driver.wifi.disable() - driver.Bluetooth.disable() - time.sleep(25) - # 判断组网成功 - NetWorking.determine_newwork(driver) - result = driver1.System.execute_command("hidumper -ls ") - assert "1494" in result - - #4 - driver.wifi.disable() - driver.Bluetooth.disable() - time.sleep(50) - # 判断组网成功 - NetWorking.determine_newwork(driver) - result = driver1.System.execute_command("hidumper -ls ") - assert "1494" in result - - #5 - # 设备A断开蓝牙wifi - driver.wifi.disable() - driver.Bluetooth.disable() - time.sleep(25) - result = driver1.System.execute_command("hidumper -ls ") - assert "1494" in result - - def teardown(self): - self.driver1.System.execute_command("kill -9 `pidof listen_test`") - host.shell("hdc -t {} target mount".format(self.sn1)) - self.driver1.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - self.driver1.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - self.driver1Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - self.driver1.Storage.remove_file("/system/etc/init/listen_test.cfg") - self.driver1.Storage.remove_file("/system/etc/init/listen_test.json") - self.driver1.Storage.remove_file("/system/bin/ondemand") - - self.driver2.System.execute_command("kill -9 `pidof listen_test`") - host.shell("hdc -t {} target mount".format(self.sn2)) - self.driver2.Storage.remove_file("/system/lib/lib/liblisten_test.z.so") - self.driver2.Storage.remove_file("/system/lib/lib/libtest_sa_proxy_cache.z.so") - self.driver2.Storage.remove_file("/system/lib/lib/libtest_audio_ability.z.so") - self.driver2.Storage.remove_file("/system/etc/init/listen_test.cfg") - self.driver2.Storage.remove_file("/system/etc/init/listen_test.json") - self.driver2.Storage.remove_file("/system/bin/ondemand") - self.log.info("done") \ No newline at end of file -- Gitee