diff --git a/modules/common/appspawn_silk.c b/modules/common/appspawn_silk.c index ee349404fe7624bdbd5b0c0fee48be4cb3d9b1ee..e6bc71acf13921fb37c7afb662feeb08ebb3fb3d 100644 --- a/modules/common/appspawn_silk.c +++ b/modules/common/appspawn_silk.c @@ -118,15 +118,10 @@ void LoadSilkConfig(void) bool LoadSilkLibrary(const char *packageName) { bool isSuccess = false; - if (g_silkConfig.configItems == NULL) { - APPSPAWN_LOGV("ConfigItems is NULL"); - return isSuccess; - } - if (packageName == NULL) { - APPSPAWN_LOGV("PackageName is NULL"); - FreeAllSilkConfig(); - return isSuccess; - } + APPSPAWN_CHECK(g_silkConfig.configItems != NULL, return isSuccess, + "ConfigItems is NULL"); + APPSPAWN_CHECK(packageName != NULL, FreeAllSilkConfig(); return isSuccess, + "PackageName is NULL"); char **appName = NULL; void *handle = NULL; for (int i = 0; i < g_silkConfig.configCursor; i++) { diff --git a/modules/sandbox/modern/sandbox_load.c b/modules/sandbox/modern/sandbox_load.c index f7a7d617f13efbe0eac16935e1ff5d96e8457969..0af4536b5e63a047749991e8db55556877f0d119 100644 --- a/modules/sandbox/modern/sandbox_load.c +++ b/modules/sandbox/modern/sandbox_load.c @@ -725,7 +725,7 @@ APPSPAWN_STATIC int ParseAppSandboxConfig(const cJSON *root, ParseJsonContext *c cJSON *config = cJSON_GetObjectItemCaseSensitive(json, "permission"); ret = ParseConditionalConfig(sandbox, config, "permission", ParsePermissionConfig); APPSPAWN_CHECK_ONLY_EXPER(ret == 0, return ret); - // sandbox permission + // spawning permission ret = AddSpawnerPermissionNode(sandbox); APPSPAWN_CHECK_ONLY_EXPER(ret == 0, return ret); // spawn-flag diff --git a/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0100.json b/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0100.json deleted file mode 100644 index 2e315adde130987bd470216829bf931c727ee57a..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0100.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_cgroups/Substartupappspawncgroups0100.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0100.py b/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0100.py deleted file mode 100644 index 0e24a7f905b20dbc591d2b82799b00361542d395..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0100.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium importFunction1, SpecificFunction2 - -from aw import Common - -class Substartupappspawncgroups0100(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.shell("power-shell setmode 602") - - def process(self): - hap_path = Common.sourcepath('ForkTest1.hap', "SUB_STARTUP_APPSPAWN_CGROUPS") - bundle_name - bundle_name = "com.example.exe_sys_cmd" - hap = self.driver.AppManager.has_app(bundle_name) - if hap: - self.driver.AppManager.clear_app_data(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) - self.driver.AppManager.install_app(hap_path) - else: - self.driver.AppManager.install_app(hap_path) - self.driver.AppManager.start_app(bundle_name) - pid = self.driver.System.get_pid(bundle_name) - result1 = self.driver.shell("ps -ef | grep %s" % bundle_name) - cgroup1 = self.driver.shell("cat /dev/pids/100/%s/app_%d/cgroup.procs" %(bundle_name, pid)).split() - count = 0 - for i in cgroup1: - self.driver.Assert.contains(result1.split(), i) - if result1.count(i) == 2: - count += 1 - self.driver.Assert.equal(count, 1) - result2 = self.driver.shell("kill -9 %d" % pid) - self.driver.Assert.equal(result2, '') - result3 = self.driver.shell("ps -ef |grep %s|grep -v grep " % bundle_name) - self.driver.Assert.equal(result3, '') - - def teardown(self): - Step("收尾工作.................") - self.driver.AppManager.clear_app_data(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0200.json b/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0200.json deleted file mode 100644 index 26a1000ecacb2f7dc1c1cdbcda65daa65dd1dbe5..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0200.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_cgroups/Substartupappspawncgroups0200.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0200.py b/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0200.py deleted file mode 100644 index e11d33c49e518c8e42a739b44d687b92de28a1a3..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0200.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import SomeClass, some_function - -from aw import Common - - -class Substartupappspawncgroups0200(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.shell("power-shell timeout -o 86400000") - - def process(self): - hap_path = Common.sourcepath('ForkTest2.hap', "SUB_STARTUP_APPSPAWN_CGROUPS") - bundle_name = "com.example.exe_sys_cmd" - hap = self.driver.AppManager.has_app(bundle_name) - if hap: - self.driver.AppManager.clear_app_data(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) - self.driver.AppManager.install_app(hap_path) - else: - self.driver.AppManager.install_app(hap_path) - self.driver.AppManager.start_app(bundle_name) - pid = self.driver.System.get_pid(bundle_name) - result1 = self.driver.shell("ps -ef | grep %s" % bundle_name) - count = 0 - for i in cgroup1: - self.driver.Assert.contains(result1.split(), i) - if result1.count(i) == 3: - count += 1 - self.driver.Assert.equal(count, 1) - result2 = self.driver.shell("kill -9 %d" % pid) - self.driver.Assert.equal(result2, '') - result3 = self.driver.shell("ps -ef |grep %s|grep -v grep " % bundle_name) - self.driver.Assert.equal(result3, '') - - def teardown(self): - Step("收尾工作.................") - self.driver.AppManager.uninstall_app("com.example.exe_sys_cmd") \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0300.json b/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0300.json deleted file mode 100644 index 1be0bf2fa2be71c356219c5668f33cce3d55fdc3..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0300.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_cgroups/Substartupappspawncgroups0300.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0300.py b/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0300.py deleted file mode 100644 index da0bcc97aa69c43dfb72ae4301296857b8d2f185..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_cgroups/sub_startup_appspawn_cgroups_0300.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import HypiumClass, HypiumFunction - -from aw import Common - - -class Substartupappspawncgroups0300(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.shell("power-shell timeout -o 86400000") - - def process(self): - hap_path = Common.sourcepath('ForkTest3.hap', "SUB_STARTUP_APPSPAWN_CGROUPS") - bundle_name = "com.example.exe_sys_cmd" - hap = self.driver.AppManager.has_app(bundle_name) - if hap: - self.driver.AppManager.clear_app_data(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) - self.driver.AppManager.install_app(hap_path) - else: - self.driver.AppManager.install_app(hap_path) - self.driver.AppManager.start_app(bundle_name) - pid = self.driver.System.get_pid(bundle_name) - result1 = self.driver.shell("ps -ef |grep %s" % bundle_name) - count = 0 - for i in cgroup1: - self.driver.Assert.contains(result1.split(), i) - if result1.count(i) == 2: - count += 1 - self.driver.Assert.equal(count, 2) - result2 = self.driver.shell("kill -9 %d" % pid) - self.driver.Assert.equal(result2, '') - result3 = self.driver.shell("ps -ef |grep %s|grep -v grep " % bundle_name) - self.driver.Assert.equal(result3, '') - - def teardown(self): - Step("收尾工作.................") - self.driver.AppManager.uninstall_app("com.example.exe_sys_cmd") \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_coldstart/sub_startup_appspawn_coldstart_0100.json b/test/autotest/sub_startup_appspawn_coldstart/sub_startup_appspawn_coldstart_0100.json deleted file mode 100644 index 49136690fb7b9fd496bab70f81d2d66077299f3d..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_coldstart/sub_startup_appspawn_coldstart_0100.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_coldstart/Substartupappspawncoldstart0100.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_coldstart/sub_startup_appspawn_coldstart_0100.py b/test/autotest/sub_startup_appspawn_coldstart/sub_startup_appspawn_coldstart_0100.py deleted file mode 100644 index 036499cc18d94b43144c40e28986629a1c297306..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_coldstart/sub_startup_appspawn_coldstart_0100.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from time import sleep -from devicetest.core.test_case import Step, TestCase -from hypium import HypiumFunction1, HypiumFunction - - -class Substartupappspawncoldstart0100(TestCase): - - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - Step(self.devices[0].device_id) - - def test_step1(self): - Step("设置冷启动全局参数.................") - result = self.driver.shell('param set startup.appspawn.cold.boot 1') - sleep(3) - if "Set parameter startup.appspawn.cold.boot 1 success" in result: - pass - else: - raise ValueError('设置冷启动全局参数失败!') - Step("通过命令启动日历.................") - result = self.driver.shell("aa start -C -d 123456 -a MainAbility -b com.hmos.calendar") - sleep(3) - self.driver.Assert.contains(result, "start ability successfully.", "通过命令启动日历失败!") - Step("检查日历冷启动进程.................") - result_ps = self.driver.shell("ps -ef|grep com.hmos.calendar") - result_ps = result_ps.split('\n')[0] - Step("日历进程信息如下:" + str(result_ps)) - if '"' in result_ps: - throw std::logic_error("日进程信息中包含非法字符 \"") - - def teardown(self): - Step("收尾工作.................") - pid = self.driver.System.get_pid('com.hmos.calendar') - self.driver.shell("kill -9 " + str(pid)) - diff --git a/test/autotest/sub_startup_appspawn_coldstartablity/sub_startup_appspawn_coldstartablity_0100.json b/test/autotest/sub_startup_appspawn_coldstartablity/sub_startup_appspawn_coldstartablity_0100.json deleted file mode 100644 index 0a585dccd763b8ed38a5073799ea6c77cb1f4f78..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_coldstartablity/sub_startup_appspawn_coldstartablity_0100.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_coldstartablity/Substartupappspawncoldstartablity0100.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_coldstartablity/sub_startup_appspawn_coldstartablity_0100.py b/test/autotest/sub_startup_appspawn_coldstartablity/sub_startup_appspawn_coldstartablity_0100.py deleted file mode 100644 index da2d64dc612b264024e1871ee9f8f334f72bfb33..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_coldstartablity/sub_startup_appspawn_coldstartablity_0100.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from time import sleep -from devicetest.core.test_case import Step, TestCase -from hyp import HypiumClass1, HypiumClass2, HypiumFunction1 - -from aw import Common - - -class Substartupappspawncoldstartablity0100(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - Step(self.devices[0].device_id) - Step("安装测试hap.................") - sourpath = Common.sourcepath("asan-enable.hap", "SUB_STARTUP_APPSPAWN_COLDSTARTABLITY") - Step(sourpath) - self.driver.AppManager.install_app(sourpath) - Step("预置工作:检测屏幕是否亮.................") - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("打开测试hap.................") - self.driver.start_app("com.example.myapplication", "EntryAbility") - sleep(3) - pid = self.driver.System.get_pid('com.example.myapplication') - Step(pid) - Step("校验hap应用的maps.................") - result = self.driver.shell('cat ' + os.path.join('/proc', str(pid), 'maps') + '|grep libclang.asan.so') - Step(result) - self.driver.Assert.contains(result, '/system/lib64/libclang_rt.asan.so') - self.driver.Assert.contains(result, 'anon:libclang_rt.asan.so.bss') - - def teardown(self): - Step("收尾工作.................") - Step("收尾工作:卸载hap......................") - self.driver.AppManager.clear_app_data('com.example.myapplication') - self.driver.AppManager.uninstall_app('com.example.myapplication') diff --git a/test/autotest/sub_startup_appspawn_coldstartablity/sub_startup_appspawn_coldstartablity_0200.json b/test/autotest/sub_startup_appspawn_coldstartablity/sub_startup_appspawn_coldstartablity_0200.json deleted file mode 100644 index 0e9342a455be203f459382fe9a2c45d30f39713d..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_coldstartablity/sub_startup_appspawn_coldstartablity_0200.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_coldstartablity/Substartupappspawncoldstartablity0200.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_coldstartablity/sub_startup_appspawn_coldstartablity_0200.py b/test/autotest/sub_startup_appspawn_coldstartablity/sub_startup_appspawn_coldstartablity_0200.py deleted file mode 100644 index 04fc5b10004313f5d215c207190ba485de7ec67d..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_coldstartablity/sub_startup_appspawn_coldstartablity_0200.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from time import sleep -from devicetest.core.test_case import Step, TestCase -from hyp import HypiumClass1, HypiumClass2, HypiumFunction1 - -from aw import Common - - -class Substartupappspawncoldstartablity0200(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - Step(self.devices[0].device_id) - Step("安装测试hap.................") - sourpath = Common.sourcepath("asan-disable.hap", "SUB_STARTUP_APPSPAWN_COLDSTARTABLITY") - Step(sourpath) - self.driver.AppManager.install_app(sourpath) - Step("预置工作:检测屏幕是否亮.................") - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("打开测试hap.................") - self.driver.start_app("com.example.myapplication", "EntryAbility") - sleep(3) - pid = self.driver.System.get_pid('com.example.myapplication') - Step(pid) - Step("校验hap应用的maps.................") - Step(result) - self.driver.Assert.equal(result, '') - - - def teardown(self): - Step("收尾工作.................") - Step("收尾工作:卸载hap......................") - self.driver.AppManager.clear_app_data('com.example.myapplication') - self.driver.AppManager.uninstall_app('com.example.myapplication') diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0100.json b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0100.json deleted file mode 100644 index 1fd513bc99342b81b1fef726a5f2b7ef749d2243..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0100.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_debughap/SubStartupAppspawnDebughap0100.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0100.py b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0100.py deleted file mode 100644 index a429b69f6c80ba5ead369569789bae0489dcb1b9..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0100.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium.action.os_hypium.device_logger import DeviceLogger -from aw import Common - - -class SubStartupAppspawnDebughap0100(TestCase): - - def __init__(self, controllers): - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - Step("安装测试hap并打开") - bundle_name = "com.example.release" - hap_path = Common.sourcepath('release.hap', "sub_startup_appspawn_debughap") - hap = self.driver.AppManager.has_app(bundle_name) - if hap: - self.driver.AppManager.clear_app_data(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) - self.driver.AppManager.install_app(hap_path) - else: - self.driver.AppManager.install_app(hap_path) - self.driver.AppManager.start_app(bundle_name) - - release_has = self.driver.Storage.has_dir("/mnt/debug/100/debug_hap/%s" % bundle_name) - self.driver.Assert.equal(release_has, False) - - def teardown(self): - Step("收尾工作.................") - self.driver.AppManager.stop_app(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0200.json b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0200.json deleted file mode 100644 index 66713d048e5f32dda102475701ce3eab1fb92c8c..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0200.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_debughap/SubStartupAppspawnDebughap0200.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0200.py b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0200.py deleted file mode 100644 index dec704a03f93ba6bec8b87bfe058838d599ac8c7..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0200.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium.action.os_hypium.device_logger import DeviceLogger -from aw import Common - - -class SubStartupAppspawnDebughap0200(TestCase): - - def __init__(self, controllers): - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - Step("安装测试hap并打开") - bundle_name = "com.example.myapplication" - hap_path = Common.sourcepath('debug.hap', "sub_startup_appspawn_debughap") - hap = self.driver.AppManager.has_app(bundle_name) - if hap: - self.driver.AppManager.uninstall_app(bundle_name) - self.driver.AppManager.install_app(hap_path) - else: - self.driver.AppManager.install_app(hap_path) - self.driver.shell("param set startup.appspawn.sandbox.debughap true") - self.driver.AppManager.start_app(bundle_name) - - result = self.driver.shell("ls /mnt/debug/100/debug_hap").split() - self.driver.Assert.contains(result, bundle_name) - - def teardown(self): - Step("收尾工作.................") - self.driver.AppManager.stop_app(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0300.json b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0300.json deleted file mode 100644 index 4918b0b9a12739b6edf82828ad3bfce4cf06b820..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0300.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_debughap/SubStartupAppspawnDebughap0300.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0300.py b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0300.py deleted file mode 100644 index fb7609b23dae061f1a2b6fa17830ad2d94a02e16..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0300.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium.action.os_hypium.device_logger import DeviceLogger -from aw import Common - - -class SubStartupAppspawnDebughap0300(TestCase): - - def __init__(self, controllers): - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - Step("安装测试hap并打开") - bundle_name = "com.example.myapplication" - hap_path = Common.sourcepath('debug.hap', "sub_startup_appspawn_debughap") - hap = self.driver.AppManager.has_app(bundle_name) - if hap: - self.driver.AppManager.uninstall_app(bundle_name) - self.driver.AppManager.install_app(hap_path) - else: - self.driver.AppManager.install_app(hap_path) - self.driver.shell("param set startup.appspawn.sandbox.debughap true") - self.driver.AppManager.start_app(bundle_name) - - sandbox_list = [] - mount_dict = list(filter(None, self.driver.shell("mount|grep %s" % bundle_name).split("\n"))) - for mount in mount_dict: - if mount.split()[2].startswith("/mnt/debug"): - sandbox_list.append(mount.split()[2]) - else: - pass - - for i in range(1, 5): - for path in ["base", "database"]: - self.driver.Assert.contains(sandbox_list, "/mnt/debug/100/debug_hap/%s/data/storage/el%d/%s" - % (bundle_name, i, path)) - - list01 = ["el2/share", "el2/log", "el1/bundle", "el2/auth_groups", "el2/distributedfiles"] - for path in list01: - self.driver.Assert.contains(sandbox_list, "/mnt/debug/100/debug_hap/%s/data/storage/%s" - % (bundle_name, path)) - - def teardown(self): - Step("收尾工作.................") - self.driver.AppManager.stop_app(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0500.json b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0500.json deleted file mode 100644 index a8e1e788d82d2c7dc101455bd9e73331af48bb9c..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0500.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_debughap/SubStartupAppspawnDebughap0500.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0500.py b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0500.py deleted file mode 100644 index e410e953548cfcadd30fc9c38002e2449242febc..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0500.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium.action.os_hypium.device_logger import DeviceLogger -from aw import Common - - -class SubStartupAppspawnDebughap0500(TestCase): - - def __init__(self, controllers): - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - Step("安装测试hap并打开") - bundle_name = "com.example.myapplication" - hap_path = Common.sourcepath('debug.hap', "sub_startup_appspawn_debughap") - hap = self.driver.AppManager.has_app(bundle_name) - if hap: - self.driver.AppManager.clear_app_data(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) - self.driver.AppManager.install_app(hap_path) - else: - self.driver.AppManager.install_app(hap_path) - self.driver.AppManager.start_app(bundle_name) - - result = self.driver.shell("ls -Z /mnt/debug/100/debug_hap").split("\n") - self.driver.Assert.contains(result, "u:object_r:sharefs:s0 %s" % bundle_name) - - def teardown(self): - Step("收尾工作.................") - self.driver.AppManager.stop_app(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0600.json b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0600.json deleted file mode 100644 index 7a19d9b426519d9fad44c31389168998c6fe6a23..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0600.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device", - "label": "" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_debughap/SubStartupAppspawnDebughap0600.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0600.py b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0600.py deleted file mode 100644 index 446185f8061bfb0d5a8c976ffc8f9f79153c0282..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0600.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium.action.os_hypium.device_logger import DeviceLogger -from aw import Common - - -class SubStartupAppspawnDebughap0600(TestCase): - - def __init__(self, controllers): - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - Step("安装测试hap并打开") - bundle_name = "com.example.myapplication" - hap_path = Common.sourcepath('debug.hap', "sub_startup_appspawn_debughap") - hap = self.driver.AppManager.has_app(bundle_name) - if hap: - self.driver.AppManager.clear_app_data(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) - self.driver.AppManager.install_app(hap_path) - else: - self.driver.AppManager.install_app(hap_path) - self.driver.AppManager.start_app(bundle_name) - - result = self.driver.shell("ls /mnt/debug/100/debug_hap").split() - self.driver.Assert.contains(result, bundle_name) - - def teardown(self): - Step("收尾工作.................") - self.driver.AppManager.stop_app(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0700.json b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0700.json deleted file mode 100644 index 5538e209a217f335453b2f050bc35dab6a22cc2c..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0700.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_debughap/SubStartupAppspawnDebughap0700.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0700.py b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0700.py deleted file mode 100644 index e19ac7fd2320ba21a14668c4d854538e43448a81..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0700.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium.action.os_hypium.device_logger import DeviceLogger -from aw import Common - - -class SubStartupAppspawnDebughap0700(TestCase): - - def __init__(self, controllers): - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - - self.driver.hdc("target mount") - self.driver.shell("mv /system/etc/init/init_dec.cfg /system/etc/init/init_dec.cfg_bak") - cfg_path = Common.sourcepath('init_dec.cfg', "sub_startup_appspawn_debughap") - self.driver.push_file(cfg_path, "/system/etc/init") - self.driver.System.reboot() - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - Step("安装测试hap并打开") - bundle_name = "com.example.myapplication" - hap_path = Common.sourcepath('debug.hap', "sub_startup_appspawn_debughap") - hap = self.driver.AppManager.has_app(bundle_name) - if hap: - self.driver.AppManager.clear_app_data(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) - self.driver.AppManager.install_app(hap_path) - else: - self.driver.AppManager.install_app(hap_path) - self.driver.shell("param set startup.appspawn.sandbox.debughap true") - self.driver.AppManager.start_app(bundle_name) - - has_dir = self.driver.Storage.has_dir("/mnt/debug/100/debug_hap/%s" % bundle_name) - self.driver.Assert.equal(has_dir, True) - result = self.driver.shell("ls /mnt/debug/100/debug_hap/%s" % bundle_name) - self.driver.Assert.contains(result, "Operation not permitted") - - def teardown(self): - Step("收尾工作.................") - self.driver.hdc("target mount") - self.driver.shell("mv /system/etc/init/init_dec.cfg_bak /system/etc/init/init_dec.cfg") - self.driver.AppManager.stop_app(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) - self.driver.System.reboot() - self.driver.System.wait_for_boot_complete() - self.driver.shell("param set startup.appspawn.sandbox.debughap true") \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0800.json b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0800.json deleted file mode 100644 index d17ff07fde09a75eb1d3364aea7bb8efba3c3155..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0800.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_debughap/SubStartupAppspawnDebughap0800.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0800.py b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0800.py deleted file mode 100644 index 7974ad11f57c1e351ae9c3a1a7fabe027c4b4224..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0800.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium.action.os_hypium.device_logger import DeviceLogger -from aw import Common - - -class SubStartupAppspawnDebughap0800(TestCase): - - def __init__(self, controllers): - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - Step("安装测试hap并打开") - bundle_name = "com.example.myapplication" - hap_path = Common.sourcepath('debug.hap', "sub_startup_appspawn_debughap") - hap = self.driver.AppManager.has_app(bundle_name) - if hap: - self.driver.AppManager.clear_app_data(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) - self.driver.AppManager.install_app(hap_path) - else: - self.driver.AppManager.install_app(hap_path) - self.driver.AppManager.start_app(bundle_name) - - for i in range(1, 5): - for path in {"database", "base"}: - mac_path = self.driver.Storage.has_dir("/data/app/el%d/100/%s/%s" % (i, path, bundle_name)) - sandbox_path = self.driver.Storage.has_dir("/mnt/debug/100/debug_hap/%s/data/storage/el%d/%s" - % (bundle_name, i, path)) - self.driver.Assert.equal(mac_path, sandbox_path) - - if mac_path is True: - mac_path_content = self.driver.shell("ls /data/app/el%d/100/%s/%s" % (i, path, bundle_name)) - sandbox_path_content = self.driver.shell("ls /mnt/debug/100/debug_hap/%s/data/storage/el%d/%s" - % (bundle_name, i, path)) - self.driver.Assert.equal(mac_path_content, sandbox_path_content) - - path_dict = { - "/mnt/hmdfs/100/non_account/merge_view/data": "el2/auth_groups", - "/mnt/hmdfs/100/account/merge_view/data": "el2/distributedfiles", - "/data/app/el2/100/log": "el2/log", - "/data/app/el1/bundle/public": "el1/bundle", - "/mnt/share/100": "el2/share" - } - - for mac, sandbox in path_dict.items(): - if mac != "/mnt/hmdfs/100/non_account/merge_view/data": - mac_path = self.driver.Storage.has_dir("%s/%s" % (mac, bundle_name)) - sandbox_path = self.driver.Storage.has_dir("/mnt/debug/100/debug_hap/%s/data/storage/%s" - % (bundle_name, sandbox)) - self.driver.Assert.equal(mac_path, sandbox_path) - if mac_path is True: - mac_path_content = self.driver.shell("ls %s/%s" % (mac, bundle_name)) - sandbox_path_content = self.driver.shell( - "ls /mnt/debug/100/debug_hap/%s/data/storage/%s" % (bundle_name, sandbox)) - self.driver.Assert.equal(mac_path_content, sandbox_path_content) - else: - mac_path = self.driver.Storage.has_dir("%s" % mac) - sandbox_path = self.driver.Storage.has_dir("/mnt/debug/100/debug_hap/%s/data/storage/%s" - % (bundle_name, sandbox)) - self.driver.Assert.equal(mac_path, sandbox_path) - if mac_path is True: - mac_path_content = self.driver.shell("ls %s" % mac) - sandbox_path_content = self.driver.shell("ls /mnt/debug/100/debug_hap/%s/data/storage/%s" - % (bundle_name, sandbox)) - self.driver.Assert.equal(mac_path_content, sandbox_path_content) - - def teardown(self): - Step("收尾工作.................") - self.driver.AppManager.stop_app(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0900.json b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0900.json deleted file mode 100644 index ab601307be4559b5a2a8cdd30490e869e8a8c997..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0900.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_debughap/SubStartupAppspawnDebughap0900.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0900.py b/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0900.py deleted file mode 100644 index 67a388ef2fd4d98a646a1bf0c3f7a0392e2e086b..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_debughap/sub_startup_appspawn_debughap_0900.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium.action.os_hypium.device_logger import DeviceLogger -from aw import Common - - -class SubStartupAppspawnDebughap0900(TestCase): - - def __init__(self, controllers): - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - Step("安装测试hap并打开") - bundle_name = "com.example.myapplication" - hap_path = Common.sourcepath('debug.hap', "sub_startup_appspawn_debughap") - hap = self.driver.AppManager.has_app(bundle_name) - if hap: - self.driver.AppManager.clear_app_data(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) - self.driver.AppManager.install_app(hap_path) - else: - self.driver.AppManager.install_app(hap_path) - self.driver.AppManager.start_app(bundle_name) - - result = self.driver.shell("ls -Z /mnt/debug/100") - self.driver.Assert.contains(result, "u:object_r:sharefs:s0 debug_hap") - - def teardown(self): - Step("收尾工作.................") - self.driver.AppManager.stop_app(bundle_name) - self.driver.AppManager.uninstall_app(bundle_name) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_fd/sub_startup_appspawn_fd_0100.json b/test/autotest/sub_startup_appspawn_fd/sub_startup_appspawn_fd_0100.json deleted file mode 100644 index d2ef15d1b102c91ec8be8f87744eeb9f19b7e2c7..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_fd/sub_startup_appspawn_fd_0100.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_fd/SubStartupAppspawnFd0100.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_fd/sub_startup_appspawn_fd_0100.py b/test/autotest/sub_startup_appspawn_fd/sub_startup_appspawn_fd_0100.py deleted file mode 100644 index d65e7ce41247a3f821073ea26369733521c5e494..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_fd/sub_startup_appspawn_fd_0100.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. -from time import sleep -from devicetest.core.test_case import Step, TestCase -from hypium.action.os_hypium.device_logger import DeviceLogger -from aw import Common - - -class SubStartupAppspawnFd0100(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - Step(self.devices[0].device_id) - Step("安装测试hap.................") - sourpath = Common.sourcepath("fd.hap", "sub_startup_appspawn_fd") - Step(sourpath) - self.driver.AppManager.install_app(sourpath) - Step("设置系统参数.................") - self.driver.shell('param set persist.sys.abilityms.multi_process_model true') - Step("执行重启..........................") - self.driver.System.reboot() - sleep(3) - self.driver.System.wait_for_boot_complete() - Step("预置工作:检测屏幕是否亮.................") - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - self.d = UiExplorer(self.device1) - device_logger = DeviceLogger(self.d) - Step("设置关键字..........................") - device_logger.set_filter_string("ldprocessmanager:OtherProcess") - Step("开启日志..........................") - device_logger.start_log("testFile/Log/log.txt") - Step("打开测试hap.................") - self.driver.start_app("com.acts.childprocessmanager", "EntryAbility") - sleep(3) - Step("点击Start Child Process.................") - self.driver.touch(BY.text("Start Child Process")) - Step("点击Start Ark Process.................") - self.driver.touch(BY.text("Start Ark Process")) - sleep(10) - Step("停止日志..........................") - device_logger.stop_log() - Step("校验日志内容..........................") - Step("查看childprocessmanager服务pid..........................") - pid = self.driver.System.get_pid('com.acts.childprocessmanager:OtherProcess1') - result = self.driver.shell("ls -al /proc/%d/fd" % pid) - Step("步骤6:预期结果校验") - self.driver.Assert.contains(result, "/data/storage/el2/base/haps/entry/files/test.txt") - self.driver.Assert.contains(result, "/data/storage/el2/base/haps/entry/files/test2.txt") - - def teardown(self): - Step("收尾工作.................") - Step("收尾工作:卸载hap......................") - self.driver.AppManager.clear_app_data('com.acts.childprocessmanager') - self.driver.AppManager.uninstall_app('com.acts.childprocessmanager') - Step("恢复系统参数.................") - self.driver.hdc('param set persist.sys.abilityms.multi_process_model false') - Step("执行重启..........................") - self.driver.System.reboot() - sleep(3) - self.driver.System.wait_for_boot_complete() diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0100.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0100.json deleted file mode 100644 index 2b59544a42bc4377b0557649709324031b85fd9e..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0100.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox0100.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0100.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0100.py deleted file mode 100644 index da38e96ad381b27b8ccc5464f537fa29614b5492..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0100.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox0100(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - file_mgr - file_mgr = "com.hmos.filemanager" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(file_mgr) - time.sleep(3) - pid = self.driver.System.get_pid(file_mgr) - result = self.driver.shell("ls /proc/%d/root/storage" % pid).split() - content = ["External", "Users", "hmdfs"] - for i in content: - self.driver.Assert.contains(result, i) - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(file_mgr) - self.driver.AppManager.stop_app(file_mgr) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0200.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0200.json deleted file mode 100644 index 494b868887250003f2896c178eb834c42be55f55..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0200.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox0200.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0200.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0200.py deleted file mode 100644 index a34f716fad6f3d8ae56c393bd10d1a0caa488ad2..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0200.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox0200(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - file_mgr - file_mgr = "com.hmos.filemanager" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(file_mgr) - time.sleep(3) - pid = self.driver.System.get_pid(file_mgr) - result = self.driver.shell("ls /proc/%d/root/storage/Users/currentUser" % pid).split() - content = ["Desktop", "Documents", "Download", "appdata"] - for i in content: - self.driver.Assert.contains(result, i) - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(file_mgr) - self.driver.AppManager.stop_app(file_mgr) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0300.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0300.json deleted file mode 100644 index d3d2775c2d0246ce5fef1f5a765bf1935cdfc880..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0300.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox0300.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0300.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0300.py deleted file mode 100644 index 5202c61e64d08e71abf5e2a4b15ee40fb4549b29..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0300.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox0300(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - file_mgr - file_mgr = "com.hmos.filemanager" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(file_mgr) - time.sleep(3) - pid = self.driver.System.get_pid(file_mgr) - result = self.driver.shell("ls -Z /proc/%d/root/storage/Users/currentUser/appdata" % pid) - content = ["el1", "el2"] - for i in content: - self.driver.Assert.contains(result, "u:object_r:sharefs:s0 %s" % i) - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(file_mgr) - self.driver.AppManager.stop_app(file_mgr) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0400.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0400.json deleted file mode 100644 index 39d21ea1cf1c3f0dab7f0c2d9b0007287e91a2db..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0400.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox0400.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0400.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0400.py deleted file mode 100644 index ee46c8581eedff2a97a36bab5c296f1907fafe83..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0400.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox0400(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - file_mgr - file_mgr = "com.hmos.filemanager" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(file_mgr) - time.sleep(3) - pid = self.driver.System.get_pid(file_mgr) - result = self.driver.shell("ls -Z /proc/%d/root/storage/Users/currentUser/appdata/el2" % pid) - content = ["base", "distributedfiles", "cloud"] - for i in content: - self.driver.Assert.contains(result, "u:object_r:sharefs:s0 %s" % i) - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(file_mgr) - self.driver.AppManager.stop_app(file_mgr) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0500.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0500.json deleted file mode 100644 index 603a78254bf2bf9299e98d393497f0c8d5c02cfc..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0500.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox0500.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0500.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0500.py deleted file mode 100644 index 1d1439bd266b72cd56f204461e55aa2c4add18e3..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0500.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox0500(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - file_mgr - count = 0 - file_mgr = "com.hmos.filemanager" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(file_mgr) - time.sleep(3) - pid = self.driver.System.get_pid(file_mgr) - for i in range(1, 3): - result = self.driver.shell("ls /proc/%d/root/storage/Users/currentUser/appdata/el%d/base" % (pid, i)).split() - for bundle_name in result: - if "com." in bundle_name or "com.ohos" in bundle_name: - count += 1 - self.driver.Assert.greater(count, 0) - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(file_mgr) - self.driver.AppManager.stop_app(file_mgr) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0600.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0600.json deleted file mode 100644 index 4e801c20ba745178d52893e3d35da20efa218ced..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0600.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox0600.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0600.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0600.py deleted file mode 100644 index 31f09ea342db91aa3757262f112bd52dcb8b38e7..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0600.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox0600(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - file_mgr - file_mgr = "com.hmos.filemanager" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(file_mgr) - time.sleep(3) - pid = self.driver.System.get_pid(file_mgr) - result = self.driver.shell("ls -Z /proc/%d/root/storage/Users/currentUser/appdata/el1" % pid) - self.driver.Assert.contains(result, "u:object_r:sharefs:s0 base") - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(file_mgr) - self.driver.AppManager.stop_app(file_mgr) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0700.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0700.json deleted file mode 100644 index 8f16be1afb9f1a4d5ead923c78d595b05f0e12d8..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0700.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox0700.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0700.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0700.py deleted file mode 100644 index 89c32be6b3a2f3d8e616d5d3f4647d7db01b7b3b..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0700.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox0700(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - file_mgr - count = 0 - file_mgr = "com.hmos.filemanager" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(file_mgr) - time.sleep(3) - pid = self.driver.System.get_pid(file_mgr) - result = self.driver.shell("ls /proc/%d/root/storage/Users/currentUser/appdata/el2/distributedfiles" % pid,).split() - for bundle_name in result: - if "com." in bundle_name or "com.ohos" in bundle_name: - count += 1 - self.driver.Assert.greater(count, 0) - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(file_mgr) - self.driver.AppManager.stop_app(file_mgr) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0800.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0800.json deleted file mode 100644 index 80bd2cf2f6284904d9145a5dacb3f1fe17aa69fa..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0800.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox0800.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0800.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0800.py deleted file mode 100644 index aa7f8abe04f7b7de29fc2ac21f329d4ba117a413..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0800.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox0800(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - file_mgr - count = 0 - file_mgr = "com.hmos.filemanager" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(file_mgr) - time.sleep(3) - pid = self.driver.System.get_pid(file_mgr) - result = self.driver.shell("ls /proc/%d/root/storage/Users/currentUser/appdata/el2/cloud" % pid,).split() - for bundle_name in result: - if "com." in bundle_name or "com.ohos" in bundle_name: - count += 1 - self.driver.Assert.greater(count, 0) - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(file_mgr) - self.driver.AppManager.stop_app(file_mgr) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0900.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0900.json deleted file mode 100644 index 0c444897a3de5210b60ad6a559851f173651d4e1..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0900.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox0900.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0900.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0900.py deleted file mode 100644 index f3bb2136f81da847f7a3a86325bcbe876478ffcf..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_0900.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox0900(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - file_mgr - count = 0 - file_mgr = "com.hmos.filemanager" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(file_mgr) - time.sleep(3) - pid = self.driver.System.get_pid(file_mgr) - result = self.driver.shell("ls -Z /proc/%d/root/storage" % pid,).split() - for i in result: - if "sharefs" in i: - count += 1 - self.driver.Assert.equal(count, 0) - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(file_mgr) - self.driver.AppManager.stop_app(file_mgr) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1000.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1000.json deleted file mode 100644 index 56838555587bce4634f663ceadcd316c0ef35a0d..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1000.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox1000.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1000.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1000.py deleted file mode 100644 index e07743c3d75e6aef98f5184483dd25940569decd..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1000.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox1000(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - notepad - notepad = "com.hmos.notepad" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(notepad) - time.sleep(3) - pid = self.driver.System.get_pid(notepad) - result = self.driver.shell("ls /proc/%d/root/storage" % pid) - content = ["External", "Users", "hmdfs"] - for i in content: - self.driver.Assert.contains(result, i) - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(notepad) - self.driver.AppManager.stop_app(notepad) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1100.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1100.json deleted file mode 100644 index 071a6565187a6c851bc2a3a19351e2f20c8d59b1..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1100.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox1100.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1100.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1100.py deleted file mode 100644 index f93a6d2d517bee94bb1c27904279a7594eefa598..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1100.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox1100(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - notepad - notepad = "com.hmos.notepad" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(notepad) - time.sleep(3) - pid = self.driver.System.get_pid(notepad) - result = self.driver.shell("ls /proc/%d/root/storage/Users/currentUser" % pid) - content = ["Desktop", "Documents", "Download", "appdata"] - for i in content: - self.driver.Assert.contains(result, i) - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(notepad) - self.driver.AppManager.stop_app(notepad) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1200.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1200.json deleted file mode 100644 index 1cdcdb7db03886c75a7db8e3d9bd8d9cb403bb25..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1200.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox1200.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1200.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1200.py deleted file mode 100644 index f4066486cc369795d7111eb434b9accfda95c73d..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1200.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox1200(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - notepad - notepad = "com.hmos.notepad" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(notepad) - time.sleep(3) - pid = self.driver.System.get_pid(notepad) - result = self.driver.shell("ls -Z /proc/%d/root/storage" % pid) - content = ["External", "hmdfs", "Users"] - for i in content: - self.driver.Assert.contains(result, "u:object_r:sharefs:s0 %s" % i) - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(notepad) - self.driver.AppManager.stop_app(notepad) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1300.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1300.json deleted file mode 100644 index 6a974dd263ceea2087c21fbdac750447b0894005..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1300.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox1300.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1300.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1300.py deleted file mode 100644 index 215475b1baf755f614d8d651389469ef43f23017..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1300.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox1300(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - notepad - notepad = "com.hmos.notepad" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(notepad) - time.sleep(3) - pid = self.driver.System.get_pid(notepad) - result = self.driver.shell("ls -Z /proc/%d/root/storage/Users" % pid).rsplit("\n") - self.driver.Assert.equal(result[0], "u:object_r:sharefs:s0 currentUser") - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(notepad) - self.driver.AppManager.stop_app(notepad) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1400.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1400.json deleted file mode 100644 index 6be9d12ef5939e83cde2b5d4b125654a0d292346..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1400.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox1400.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1400.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1400.py deleted file mode 100644 index 5902c943c26c272b7218c308a637063bb0e1b371..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1400.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox1400(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - notepad - notepad = "com.hmos.notepad" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(notepad) - time.sleep(3) - pid = self.driver.System.get_pid(notepad) - result = self.driver.shell("ls /proc/%d/root/storage/Users/currentUser/appdata" % pid).split() - content = ["el1", "el2"] - for i in content: - self.driver.Assert.contains(result, i) - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(notepad) - self.driver.AppManager.stop_app(notepad) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1500.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1500.json deleted file mode 100644 index 3b303104e6627798d803ab477c86b09fa1673559..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1500.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox1500.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1500.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1500.py deleted file mode 100644 index 2fb69ff0477f4ffaa8952a1af640bf1eb79ff0e3..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1500.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox1500(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - notepad - notepad = "com.hmos.notepad" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(notepad) - time.sleep(3) - pid = self.driver.System.get_pid(notepad) - result = self.driver.shell("ls -Z /proc/%d/root/storage/Users/currentUser/appdata/el2" % pid) - content = ["base", "distributedfiles", "cloud"] - for i in content: - self.driver.Assert.contains(result, "sharefs_appdata_file:s0 %s" % i) - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(notepad) - self.driver.AppManager.stop_app(notepad) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1600.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1600.json deleted file mode 100644 index cc7e90ae68e087f5c3a7e2067814c274bc51f84f..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1600.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox1600.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1600.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1600.py deleted file mode 100644 index 9e5905b8a3ce85dd1f6d80c2b36a14f06a79c16d..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1600.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox1600(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - notepad - count = 0 - notepad = "com.hmos.notepad" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(notepad) - time.sleep(3) - pid = self.driver.System.get_pid(notepad) - for i in range(1, 3): - result = self.driver.shell("ls /proc/%d/root/storage/Users/currentUser/appdata/el%d/base" % (pid, i)).split() - for bundle_name in result: - if "com." in bundle_name or "com.ohos" in bundle_name: - count += 1 - self.driver.Assert.greater(count, 0) - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(notepad) - self.driver.AppManager.stop_app(notepad) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1700.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1700.json deleted file mode 100644 index 987cdcae603bc223d9ce9c9504ac22e214665105..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1700.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox1700.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1700.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1700.py deleted file mode 100644 index 05b9ad55b7231778e39076e9881d3358d1639b70..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1700.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox1700(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - notepad - notepad = "com.hmos.notepad" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(notepad) - time.sleep(3) - pid = self.driver.System.get_pid(notepad) - result = self.driver.shell("ls -Z /proc/%d/root/storage/Users/currentUser/appdata/el1" % pid).split("\n") - self.driver.Assert.equal(result[0], "u:object_r:sharefs_appdata_file:s0 base") - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(notepad) - self.driver.AppManager.stop_app(notepad) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1800.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1800.json deleted file mode 100644 index 93278ccfad27155d767ec0aa386945eb5d4e1760..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1800.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox1800.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1800.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1800.py deleted file mode 100644 index 5c663660efa38d7c860ca8cf7c839589ea5e0de9..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1800.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox1800(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - notepad - count = 0 - notepad = "com.hmos.notepad" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(notepad) - time.sleep(3) - pid = self.driver.System.get_pid(notepad) - result = self.driver.shell("ls /proc/%d/root/storage/Users/currentUser/appdata/el2/distributedfiles" % pid).split() - for bundle_name in result: - if "com." in bundle_name or "com.ohos" in bundle_name: - count += 1 - self.driver.Assert.greater(count, 0) - - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(notepad) - self.driver.AppManager.stop_app(notepad) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1900.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1900.json deleted file mode 100644 index c6034bb5676a696b89175ba4cd4766dee315cd3b..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1900.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox1900.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1900.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1900.py deleted file mode 100644 index 640d9c261a9c2e144bdbb27769d311ef60daac14..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_1900.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox1900(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - notepad - count = 0 - notepad = "com.hmos.notepad" - self.driver.shell("echo 0 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.start_app(notepad) - time.sleep(3) - pid = self.driver.System.get_pid(notepad) - result = self.driver.shell("ls /proc/%d/root/storage/Users/currentUser/appdata/el2/cloud" % pid).split() - for bundle_name in result: - if "com." in bundle_name or "com.ohos" in bundle_name: - count += 1 - self.driver.Assert.greater(count, 0) - - - def teardown(self): - Step("收尾工作.................") - self.driver.shell("echo 1 > /proc/sys/kernel/dec/dec_mode") - self.driver.AppManager.clear_app_data(notepad) - self.driver.AppManager.stop_app(notepad) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2000.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2000.json deleted file mode 100644 index b253383096f8a4648b785fba44b3f597cab0a34c..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2000.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox2000.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2000.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2000.py deleted file mode 100644 index d68060d13accc2c582d50ce1c6b8953273a87009..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2000.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox2000(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - notepad - notepad = "com.hmos.notepad" - self.driver.AppManager.start_app(notepad) - time.sleep(3) - pid = self.driver.System.get_pid(notepad) - result = self.driver.shell("ls /proc/%d/root/storage/Users/currentUser" % pid) - self.driver.Assert.contains(result, "Operation not permitted") - - def teardown(self): - Step("收尾工作.................") - self.driver.AppManager.clear_app_data(notepad) - self.driver.AppManager.stop_app(notepad) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2100.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2100.json deleted file mode 100644 index d4d8580cb71445e0ac28cdd6715694d6fe4bbc90..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2100.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox2100.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2100.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2100.py deleted file mode 100644 index 990742ffba11797f11e2ef3ef370e6d896fa0e92..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2100.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox2100(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - notepad - notepad = "com.hmos.notepad" - self.driver.AppManager.start_app(notepad) - time.sleep(3) - pid = self.driver.System.get_pid(notepad) - result = self.driver.shell("ls /proc/%d/root/storage/Users/currentUser/appdata" % pid) - self.driver.Assert.contains(result, "Operation not permitted") - - def teardown(self): - Step("收尾工作.................") - self.driver.AppManager.clear_app_data(notepad) - self.driver.AppManager.stop_app(notepad) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2200.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2200.json deleted file mode 100644 index d204b6d2adb6eaf60c770a84d63986350b1c13a0..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2200.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox2200.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2200.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2200.py deleted file mode 100644 index e797ef7e6b6882ce3adeadfb8fa212f16227f9f8..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2200.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox2200(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - notepad - notepad = "com.hmos.notepad" - self.driver.AppManager.start_app(notepad) - time.sleep(3) - pid = self.driver.System.get_pid(notepad) - for i in range(1, 3): - result = self.driver.shell("ls /proc/%d/root/storage/Users/currentUser/appdata/el%d" % (pid, i)) - self.driver.Assert.contains(result, "Operation not permitted") - - def teardown(self): - Step("收尾工作.................") - self.driver.AppManager.clear_app_data(notepad) - self.driver.AppManager.stop_app(notepad) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2300.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2300.json deleted file mode 100644 index c1f9ef7272ebd0392aaf0a443b532144b0318bec..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2300.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox2300.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2300.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2300.py deleted file mode 100644 index 28db72b77116527bb47623855679490a8bc89797..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2300.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox2300(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - notepad - notepad = "com.hmos.notepad" - self.driver.AppManager.start_app(notepad) - time.sleep(3) - pid = self.driver.System.get_pid(notepad) - result = self.driver.shell("ls /proc/%d/root/storage/External" % pid) - self.driver.Assert.contains(result, "Operation not permitted") - - def teardown(self): - Step("收尾工作.................") - self.driver.AppManager.clear_app_data(notepad) - self.driver.AppManager.stop_app(notepad) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2500.json b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2500.json deleted file mode 100644 index b89444cbb25d323901fca2295b74ff593c1362c2..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2500.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_filemgr_sandbox/SubStartupAppspawnFilemgrSandbox2500.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2500.py b/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2500.py deleted file mode 100644 index 1c5f86776083006fe9dd94275aaf99f80a401dfa..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_filemgr_sandbox/sub_startup_appspawn_filemgr_sandbox_2500.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step -from hypium import FilemgrSandbox, Appspawn, SubStartup - - -class SubStartupAppspawnFilemgrSandbox2500(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step(self.devices[0].device_id) - device - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - Step(device) - # 解锁屏幕 - wake = self.driver.Screen.is_on() - time.sleep(0.5) - if wake: - self.driver.ScreenLock.unlock() - else: - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def process(self): - notepad - notepad = "com.hmos.notepad" - self.driver.AppManager.start_app(notepad) - time.sleep(3) - pid = self.driver.System.get_pid(notepad) - result = self.driver.shell("ls /proc/%d/root/storage/hmdfs" % pid) - self.driver.Assert.contains(result, "Operation not permitted") - - def teardown(self): - Step("收尾工作.................") - self.driver.AppManager.clear_app_data(notepad) - self.driver.AppManager.stop_app(notepad) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_ftpd/sub_startup_appspawn_ftpd_0100.json b/test/autotest/sub_startup_appspawn_ftpd/sub_startup_appspawn_ftpd_0100.json deleted file mode 100644 index 850e6d6a2a1ded8079bb6217fc0d5780b3af98ca..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_ftpd/sub_startup_appspawn_ftpd_0100.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_ftpd/SubStartupAppspawnFtpd0100.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_ftpd/sub_startup_appspawn_ftpd_0100.py b/test/autotest/sub_startup_appspawn_ftpd/sub_startup_appspawn_ftpd_0100.py deleted file mode 100644 index a2385b2dc46b2412ac0dd3cf6dd3c6ada2787336..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_ftpd/sub_startup_appspawn_ftpd_0100.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. -from devicetest.core.test_case import Step, TestCase - -from aw import Common - - -class SubStartupAppspawnFtpd0100(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - Step(self.devices[0].device_id) - Step("设置系统参数sysctl -w kernel.xpm.xpm_mode=0..........................") - self.driver.hdc("target mount") - self.driver.shell("sed -i 's%/proc/sys/kernel/xpm/xpm_mode 4%/proc/sys/kernel/xpm/xpm_mode 0%g' /system/etc/init/key_enable.cfg") - self.driver.shell("reboot") - self.driver.System.wait_for_boot_complete() - set_result = self.driver.shell("sysctl -w kernel.xpm.xpm_mode=0") - self.driver.Assert.contains(set_result, "kernel.xpm.xpm_mode = 0") - Step("安装测试hap.................") - sourpath = Common.sourcepath("ftpd.hap", "sub_startup_appspawn_ftpd") - Step(sourpath) - self.driver.AppManager.install_app(sourpath) - Step("预置工作:检测屏幕是否亮.................") - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("打开测试hap.................") - self.driver.start_app("com.ohos.myapplication", "EntryAbility") - Step("打开bftpd.................") - aa_resutl = self.driver.shell("aa process -b com.ohos.myapplication -a EntryAbility -D '/system/bin/bftpd -D -p 9021' -S") - self.driver.Assert.contains(aa_resutl, "start native process successfully") - Step("校验bftpd进程") - pid = self.driver.System.get_pid('bftpd') - - def teardown(self): - Step("收尾工作.................") - Step("收尾工作:卸载hap......................") - self.driver.AppManager.clear_app_data('com.ohos.myapplication') - self.driver.AppManager.uninstall_app('com.ohos.myapplication') - Step("恢复系统参数......................") - recovery_result = self.driver.shell("sysctl -w kernel.xpm.xpm_mode=4") - self.driver.Assert.contains(recovery_result, "kernel.xpm.xpm_mode = 4") diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0100.json b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0100.json deleted file mode 100644 index 12504c728f7fed951fe0157084550df8d993c409..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0100.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_hnpinstall/SubStartupAppspawnHnpinstall0100.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0100.py b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0100.py deleted file mode 100644 index 8aa9ec0062cf3519c80a5cb77c236fd590c7a391..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0100.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import TestCase, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hypium.model import UiParam, WindowFilter -import os -from aw import Common - - -class SubStartupAppspawnHnpinstall0100(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("步骤1:安装测试应用") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - hnp = os.path.abspath(os.path.join( - os.path.join(path, "testFile"), 'SUB_STARTUP_APPSPAWN_NATIVE/entry-default-hnpinsall.hap')) - isHap = self.driver.has_app("com.example.hnp_test") - if(isHap): - self.driver.uninstall_app("com.example.hnp_test") - else: - pass - self.driver.install_app(hnp) - Step("是否刷root包") - isroot = self.driver.shell("ls") - Step("步骤2:展示公有目录列表") - result1 = self.driver.shell("ls /data/app/el1/bundle/100/hnppublic") - self.driver.Assert.contains(result1, "hnpsample.org") - if ("Permission denied" in isroot): - Step("步骤4:执行公有目录软链二进制") - th = Common.hnpexecute_async(self.driver, "/data/app/el1/bundle/100/hnppublic/bin/hnpsample 5") - th.start() - result3 = self.driver.shell("ps -ef | grep hnpsample | grep -v grep") - self.driver.Assert.contains(result3, "hnpsample") - else: - Step("步骤3:展示私有目录列表") - result2 = self.driver.shell("ls /data/app/el1/bundle/100/hnp/com.example.hnp_test") - self.driver.Assert.contains(result2, "node.org") - Step("步骤4:执行公有目录软链二进制") - result3 = self.driver.hdc("hdc shell /data/app/el1/bundle/100/hnppublic/bin/hnpsample") - self.driver.Assert.contains(result3, "start hnp sample") - self.driver.Assert.contains(result3, "hnp sample end") - - def teardown(self): - Step("收尾工作:卸载hap") - self.driver.uninstall_app("com.example.hnp_test") diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0200.json b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0200.json deleted file mode 100644 index 8a17d83b952a3a5c0561cd5d01808a91a7945110..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0200.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_hnpinstall/SubStartupAppspawnHnpinstall0200.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0200.py b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0200.py deleted file mode 100644 index 4831a3f78694aecd4f55e8db81d74d3d920bde8c..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0200.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import TestCase, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hypium.model import UiParam, WindowFilter -import os - - -class SubStartupAppspawnHnpinstall0200(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("步骤1:安装测试应用") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - hnp = os.path.abspath(os.path.join( - os.path.join(path, "testFile"), 'SUB_STARTUP_APPSPAWN_NATIVE/entry-default-hnpinsall.hap')) - isHap = self.driver.has_app("com.example.hnp_test") - if(isHap): - self.driver.uninstall_app("com.example.hnp_test") - else: - pass - self.driver.install_app(hnp) - Step("步骤2:读取公有目录列表") - result1 = self.driver.shell("cat /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/hnp.json") - self.driver.Assert.contains(result1, "hnpsample") - Step("是否刷root包") - isroot = self.driver.shell("ls") - if("Permission denied" in isroot): - Step("步骤3:读取私有目录列表") - result2 = self.driver.shell( - "cat /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/hnp.json") - self.driver.Assert.contains(result2, "Permission denied") - else: - Step("步骤3:读取私有目录列表") - result2 = self.driver.shell("cat /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/hnp.json") - self.driver.Assert.contains(result2, "node") - - def teardown(self): - Step("收尾工作:卸载hap") - self.driver.uninstall_app("com.example.hnp_test") diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0300.json b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0300.json deleted file mode 100644 index 90f6a911b0baddcafebff838038daea2f00af233..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0300.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_hnpinstall/SubStartupAppspawnHnpinstall0300.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0300.py b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0300.py deleted file mode 100644 index 268ea56fe50797c9f5d4cbe50074db5f67012223..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0300.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import TestCase, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hypium.model import UiParam, WindowFilter -import os - - -class SubStartupAppspawnHnpinstall0300(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("步骤1:安装测试应用") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - hnp = os.path.abspath(os.path.join( - os.path.join(path, "testFile"), 'SUB_STARTUP_APPSPAWN_NATIVE/entry-default-hnpinsall.hap')) - isHap = self.driver.has_app("com.example.hnp_test") - if (isHap): - self.driver.uninstall_app("com.example.hnp_test") - else: - pass - self.driver.install_app(hnp) - isroot = self.driver.shell("ls") - if ("Permission denied" in isroot): - Step("步骤2:修改公有目录文件内容") - data = {"name": "zsj", "sex": "girl", "age": 31}; - result1 = self.driver.shell(f"echo {data} > /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/hnp.json") - self.driver.Assert.contains(result1, "Permission denied") - Step("步骤3:修改私有目录文件内容") - data = {"name": "private", "sex": "girl", "age": 31}; - result2 = self.driver.shell(f"echo {data} > /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/hnp.json") - self.driver.Assert.contains(result2, "Permission denied") - else: - Step("步骤2:修改公有目录文件内容") - data = {"name": "zsj", "sex": "girl", "age": 31}; - self.driver.shell(f"echo {data} > /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/hnp.json") - result1 = self.driver.shell("cat /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/hnp.json") - self.driver.Assert.contains(result1, "zsj") - Step("步骤3:修改私有目录文件内容") - data = {"name": "private", "sex": "girl", "age": 31}; - self.driver.shell( - f"echo {data} > /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/hnp.json") - result2 = self.driver.shell( - "cat /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/hnp.json") - self.driver.Assert.contains(result2, "private") - - def teardown(self): - Step("收尾工作:卸载hap") - self.driver.uninstall_app("com.example.hnp_test") diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0400.json b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0400.json deleted file mode 100644 index eab617a873d76e995a7d994aa88670463df3cfb0..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0400.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_hnpinstall/SubStartupAppspawnHnpinstall0400.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0400.py b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0400.py deleted file mode 100644 index 67daef310ed3581ca1760d53ebdba27f6fb4991f..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0400.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import TestCase, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hypium.model import UiParam, WindowFilter -import os - - -class SubStartupAppspawnHnpinstall0400(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("步骤1:安装测试应用") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - hnp = os.path.abspath(os.path.join( - os.path.join(path, "testFile"), 'SUB_STARTUP_APPSPAWN_NATIVE/entry-default-hnpinsall.hap')) - isHap = self.driver.has_app("com.example.hnp_test") - if (isHap): - self.driver.uninstall_app("com.example.hnp_test") - else: - pass - self.driver.install_app(hnp) - isroot = self.driver.shell("ls") - if ("Permission denied" in isroot): - Step("步骤2:修改公有目录文件内容") - result1 = self.driver.shell(f"touch /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/123.txt") - self.driver.Assert.contains(result1, "Permission denied") - Step("步骤3:修改私有目录文件内容") - result2 = self.driver.shell(f"touch /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/abc.txt") - self.driver.Assert.contains(result2, "Permission denied") - else: - Step("步骤2:修改公有目录文件内容") - self.driver.shell(f"touch /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/123.txt") - result1 = self.driver.shell("ls /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/") - self.driver.Assert.contains(result1, "123.txt") - Step("步骤3:修改私有目录文件内容") - self.driver.shell(f"touch /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/abc.txt") - result2 = self.driver.shell( - "ls /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/") - self.driver.Assert.contains(result2, "abc.txt") - - def teardown(self): - Step("收尾工作:卸载hap") - self.driver.uninstall_app("com.example.hnp_test") diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0500.json b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0500.json deleted file mode 100644 index 2cd611866ae9e4265cb0cbb70925f7ca7204da7b..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0500.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_hnpinstall/SubStartupAppspawnHnpinstall0500.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0500.py b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0500.py deleted file mode 100644 index ad73decfc6cc6e25889509361b6514b634d76c4c..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0500.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import TestCase, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hypium.model import UiParam, WindowFilter -import os - - -class SubStartupAppspawnHnpinstall0500(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("步骤1:安装测试应用") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - hnp = os.path.abspath(os.path.join( - os.path.join(path, "testFile"), 'SUB_STARTUP_APPSPAWN_NATIVE/entry-default-hnpinsall.hap')) - isHap = self.driver.has_app("com.example.hnp_test") - if (isHap): - self.driver.uninstall_app("com.example.hnp_test") - else: - pass - self.driver.install_app(hnp) - isroot = self.driver.shell("ls") - if ("Permission denied" in isroot): - Step("步骤2:修改公有目录文件内容") - result1 = self.driver.shell( - f"rm -rf /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/hnp.json") - self.driver.Assert.contains(result1, "Permission denied") - Step("步骤3:修改私有目录文件内容") - result2 = self.driver.shell( - f"rm -rf /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/hnp.json") - self.driver.Assert.contains(result2, "Permission denied") - else: - Step("步骤2:修改公有目录文件内容") - self.driver.shell(f"rm -rf /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/hnp.json") - result1 = self.driver.shell("ls /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/") - self.driver.Assert.is_true("hnp.json" not in result1) - Step("步骤3:修改私有目录文件内容") - self.driver.shell(f"rm -rf /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/hnp.json") - result2 = self.driver.shell( - "ls /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/") - self.driver.Assert.is_true("hnp.json" not in result2) - - def teardown(self): - Step("收尾工作:卸载hap") - self.driver.uninstall_app("com.example.hnp_test") diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0600.json b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0600.json deleted file mode 100644 index 009ebc7cefe970e87ad4d67d747777c6a8fd5d2e..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0600.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_hnpinstall/SubStartupAppspawnHnpinstall0600.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0600.py b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0600.py deleted file mode 100644 index 206576825b7bf65be447ea862bea98e5060eeedb..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0600.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import TestCase, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hypium.model import UiParam, WindowFilter -import os - - -class SubStartupAppspawnHnpinstall0600(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("步骤1:安装测试应用") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - hnp = os.path.abspath(os.path.join( - os.path.join(path, "testFile"), 'SUB_STARTUP_APPSPAWN_NATIVE/entry-default-hnpinsall.hap')) - isHap = self.driver.has_app("com.example.hnp_test") - if (isHap): - self.driver.uninstall_app("com.example.hnp_test") - else: - pass - self.driver.install_app(hnp) - isroot = self.driver.shell("ls") - if ("Permission denied" in isroot): - Step("步骤2:修改公有目录文件内容") - result1 = self.driver.shell( - f"chmod 777 /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/hnp.json") - self.driver.Assert.contains(result1, "Operation not permitted") - Step("步骤3:修改私有目录文件内容") - result2 = self.driver.shell( - f"chmod 777 /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/hnp.json") - self.driver.Assert.contains(result2, "Permission denied") - else: - Step("步骤2:修改公有目录文件内容") - self.driver.shell(f"chmod 777 /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/hnp.json") - result1 = self.driver.shell("ls -l /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/hnp.json") - self.driver.Assert.contains(result1, "rwxrwxrwx") - Step("步骤3:修改私有目录文件内容") - self.driver.shell(f"chmod 777 /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/hnp.json") - result2 = self.driver.shell( - "ls -l /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/hnp.json") - self.driver.Assert.contains(result2, "rwxrwxrwx") - - def teardown(self): - Step("收尾工作:卸载hap") - self.driver.uninstall_app("com.example.hnp_test") diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0700.json b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0700.json deleted file mode 100644 index 94f5f1274eff614bfba134bdb00db40dd3c0b6fd..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0700.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_hnpinstall/SubStartupAppspawnHnpinstall0700.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0700.py b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0700.py deleted file mode 100644 index e1bfc549628cfc87b36248f72795a86687b9b614..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0700.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import TestCase, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hypium.model import UiParam, WindowFilter -import os - - -class SubStartupAppspawnHnpinstall0700(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("步骤1:安装测试应用") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - hnp = os.path.abspath(os.path.join( - os.path.join(path, "testFile"), 'SUB_STARTUP_APPSPAWN_NATIVE/entry-default-hnpinsall.hap')) - isHap = self.driver.has_app("com.example.hnp_test") - if (isHap): - self.driver.uninstall_app("com.example.hnp_test") - else: - pass - self.driver.install_app(hnp) - isroot = self.driver.shell("ls") - if ("Permission denied" in isroot): - Step("步骤2:修改公有目录文件内容") - result1 = self.driver.shell( - f"mv /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/hnp.json /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/zsj.json") - self.driver.Assert.contains(result1, "Permission denied") - Step("步骤3:修改私有目录文件内容") - result2 = self.driver.shell( - f"mv /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/hnp.json /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/zsj.json") - self.driver.Assert.contains(result2, "Permission denied") - else: - Step("步骤2:修改公有目录文件内容") - self.driver.shell(f"mv /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/hnp.json /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/zsj.json") - result1 = self.driver.shell("ls /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/") - self.driver.Assert.contains(result1, "zsj.json") - Step("步骤3:修改私有目录文件内容") - self.driver.shell(f"mv /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/hnp.json /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/zsj.json") - result2 = self.driver.shell( - "ls /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/") - self.driver.Assert.contains(result2, "zsj.json") - - -def teardown(self): - Step("收尾工作:卸载hap") - self.driver.uninstall_app("com.example.hnp_test") diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0800.json b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0800.json deleted file mode 100644 index 646ceb0ddeb26088343266f349b3a873dee6f310..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0800.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_hnpinstall/SubStartupAppspawnHnpinstall0800.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0800.py b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0800.py deleted file mode 100644 index b43d38a0ff11a74409a084f66799e8a8265ddc50..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0800.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import TestCase, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hypium.model import UiParam, WindowFilter -import os - - -class SubStartupAppspawnHnpinstall0800(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("步骤1:安装测试应用") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - hnp = os.path.abspath(os.path.join( - os.path.join(path, "testFile"), 'SUB_STARTUP_APPSPAWN_NATIVE/entry-default-hnpinsall.hap')) - isHap = self.driver.has_app("com.example.hnp_test") - if (isHap): - self.driver.uninstall_app("com.example.hnp_test") - else: - pass - self.driver.install_app(hnp) - isroot = self.driver.shell("ls") - if ("Permission denied" in isroot): - Step("步骤2:修改公有目录文件内容") - result1 = self.driver.shell( - f"cp /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/hnp.json /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/zsj.json") - self.driver.Assert.contains(result1, "Permission denied") - Step("步骤3:修改私有目录文件内容") - result2 = self.driver.shell( - f"cp /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/hnp.json /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/zsj.json") - self.driver.Assert.contains(result2, "Permission denied") - else: - Step("步骤2:修改公有目录文件内容") - self.driver.shell( - f"cp /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/hnp.json /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/zsj.json") - result1 = self.driver.shell("ls /data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/") - self.driver.Assert.contains(result1, "zsj.json") - self.driver.Assert.contains(result1, "hnp.json") - Step("步骤3:修改私有目录文件内容") - self.driver.shell( - f"cp /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/hnp.json /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/zsj.json") - result2 = self.driver.shell( - "ls /data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/") - self.driver.Assert.contains(result2, "zsj.json") - self.driver.Assert.contains(result2, "hnp.json") - - def teardown(self): - Step("收尾工作:卸载hap") - self.driver.uninstall_app("com.example.hnp_test") diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0900.json b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0900.json deleted file mode 100644 index 6598b82342f1feadf1a6b58cc0412126b8b6d4d4..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0900.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_hnpinstall/SubStartupAppspawnHnpinstall0900.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0900.py b/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0900.py deleted file mode 100644 index 24bae3ed717610b65db77b058d878414d2e0609d..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_hnpinstall/sub_startup_appspawn_hnpinstall_0900.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import TestCase, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hypium.model import UiParam, WindowFilter -import os -from aw import Common - - -class SubStartupAppspawnHnpinstall0900(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("步骤1:安装测试应用") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - hnp = os.path.abspath(os.path.join( - os.path.join(path, "testFile"), 'SUB_STARTUP_APPSPAWN_NATIVE/entry-default-hnpinsall.hap')) - isHap = self.driver.has_app("com.example.hnp_test") - if (isHap): - self.driver.uninstall_app("com.example.hnp_test") - else: - pass - self.driver.install_app(hnp) - Step("是否刷root包") - isroot = self.driver.shell("ls") - if ("Permission denied" in isroot): - Step("步骤2:执行公有目录二进制文件") - th = Common.hnpexecute_async(self.driver, "/data/app/el1/bundle/100/hnppublic/bin/hnpsample 5") - th.start() - result3 = self.driver.shell("ps -ef | grep hnpsample | grep -v grep") - self.driver.Assert.contains(result3, "hnpsample") - Step("步骤3:读取私有目录列表") - result2 = self.driver.shell("./data/app/el1/bundle/100/hnp/com.example.hnp_test/node.org/node_1.0/bin/node") - self.driver.Assert.contains(result2, "inaccessible or not found") - else: - Step("步骤2:执行公有目录二进制文件") - result1 = self.driver.shell("./data/app/el1/bundle/100/hnppublic/hnpsample.org/hnpsample_1.1/bin/hnpsample") - self.driver.Assert.contains(result1, "start hnp sample") - self.driver.Assert.contains(result1, "hnp sample end") - - def teardown(self): - Step("收尾工作:卸载hap") - self.driver.uninstall_app("com.example.hnp_test") diff --git a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0100.json b/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0100.json deleted file mode 100644 index c467494bfb5420f44f1207b35bb83f3dde77213b..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0100.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_nativedmscheck/SubStartupAppspawnNativedmscheck0100.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0100.py b/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0100.py deleted file mode 100644 index a3f4c19127cf6cd2613b6cbbd8b6530c19ed05a5..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0100.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hypium.model import UiParam, WindowFilter -import os - - -class SubStartupAppspawnNativedmscheck0100(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:唤醒屏幕.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("步骤1:创建公有hnp存放目录") - self.driver.shell("mkdir -p data/no_sign/public") - Step("步骤2:导入安装包文件hnp") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - hnp = os.path.abspath(os.path.join( - os.path.join(path, "testFile"), 'SUB_STARTUP_APPSPAWN_NATIVE/no_sign/hnpsample.hnp')) - hap = os.path.abspath( - os.path.join(os.path.join(path, "testFile"), - 'SUB_STARTUP_APPSPAWN_NATIVE/no_sign/entry-default-signedArm64.hap')) - self.driver.push_file(hnp, "data/no_sign/public/") - self.driver.push_file(hap, "data/no_sign") - Step("步骤3:执行安装命令") - result = self.driver.shell( - "hnp install -u 100 -p wechat_sign -i /data/no_sign -s /data/no_sign/entry-default-signedArm64-test11.hap -a arm64 -f") - Step("步骤4:预期结果校验") - self.driver.Assert.contains(result, "hnp uninstall start now! name=hnpsample") - self.driver.Assert.contains(result, "native manager process exit. ret=8393475") - - def teardown(self): - self.driver.shell("rm -rf data/no_sign") diff --git a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0200.json b/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0200.json deleted file mode 100644 index 676d65fa75ef0aa726981bca252773278d0efbc8..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0200.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_nativedmscheck/SubStartupAppspawnNativedmscheck0200.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0200.py b/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0200.py deleted file mode 100644 index 6e495429239e87d5154ddb1903ba1c13a450e70c..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0200.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hypium.model import UiParam, WindowFilter -import os - - -class SubStartupAppspawnNativedmscheck0200(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:唤醒屏幕.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("步骤1:创建公有hnp存放目录") - self.driver.shell("mkdir -p data/wechat_sign/public") - Step("步骤2:导入安装包文件hnp") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - hnp = os.path.abspath(os.path.join( - os.path.join(path, "testFile"), 'SUB_STARTUP_APPSPAWN_NATIVE/sign/hnpsample.hnp')) - hap = os.path.abspath( - os.path.join(os.path.join(path, "testFile"), - 'SUB_STARTUP_APPSPAWN_NATIVE/sign/entry-default-signedArm64-test11.hap')) - self.driver.push_file(hnp, "data/wechat_sign/public/") - self.driver.push_file(hap, "data/wechat_sign") - Step("步骤3:执行安装命令") - result1 = self.driver.shell( - "hnp install -u 100 -p wechat_sign -i /data/wechat_sign -s /data/wechat_sign/entry-default-signedArm64-test11.hap -a arm64 -f") - Step("步骤4:预期结果校验") - public = self.driver.shell("ls /data/app/el1/bundle/100/hnppublic/") - self.driver.Assert.contains(public, "hnpsample.org") - result = self.driver.shell("cat /data/service/el1/startup/hnp_info.json") - self.driver.Assert.contains(result, "wechat_sign") - self.driver.Assert.contains(result1, "native manager process exit. ret=0") - self.driver.Assert.contains(result1, "hnp install start now! src file=/data/wechat_sign/public/hnpsample.hnp, dst path=/data/app/el1/bundle/100/hnppublic") - - def teardown(self): - self.driver.shell("rm -rf data/sign") - self.driver.shell("hnp uninstall -u 100 -p wechat_sign") diff --git a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0300.json b/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0300.json deleted file mode 100644 index 7edfe4b8a76654751870a5a26b54dac071af1f48..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0300.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_nativedmscheck/SubStartupAppspawnNativedmscheck0300.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0300.py b/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0300.py deleted file mode 100644 index 54d9d5e7b2cdb68b6f3a37849cc999d232474568..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0300.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hypium.action.os_hypium.device_logger import DeviceLogger -from hypium.model import UiParam, WindowFilter -import os - - -class SubStartupAppspawnNativedmscheck0300(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:唤醒屏幕.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - Step('开启DEBUG日志') - self.driver.shell("hilog -b I -D 0xC02C11") - self.driver.shell("hilog -b DEBUG -T APPSPAWN") - self.driver.shell("hilog -b D -D 0xDC02C11") - self.driver.shell("hilog -G 16M") - host.shell('hdc shell "hilog -r"') - - def test_step1(self): - Step("步骤1:安装私有路径hap包") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - hap1 = os.path.abspath( - os.path.join(os.path.join(path, "testFile"), - 'SUB_STARTUP_APPSPAWN_NATIVE/entry-default-signedArm64Pri-test.hap')) - hap2 = os.path.abspath( - os.path.join(os.path.join(path, "testFile"), - 'SUB_STARTUP_APPSPAWN_NATIVE/entry-default-signed-hnpselinux.hap')) - self.driver.install_app(hap1) - self.driver.install_app(hap2) - Step("步骤2:过滤日志") - device_logger = DeviceLogger(self.driver) - device_logger.set_filter_string("MY_TAG") - Step("步骤3:开始抓取日志") - device_logger.start_log(path + '\\testFile\\log\\%s.log' % (self.TAG)) - Step("步骤4:打开测试应用") - self.driver.start_app("com.example.hnpselinuxtestapplication", "EntryAbility") - time.sleep(60) - Step("步骤4:关闭日志") - device_logger.stop_log() - time.sleep(4) - device_logger.check_log('Open public cfg file to read failed, errno=[2]') - device_logger.check_log('Open public cfg file to write failed, errno=[2]') - device_logger.check_log('Open private cfg file to read failed, errno=[2]') - device_logger.check_log('Open private cfg file to write failed, errno=[2]') - - def teardown(self): - Step("收尾工作:删除hap") - self.driver.uninstall_app("com.example.hnp_test") - self.driver.uninstall_app("com.example.hnpselinuxtestapplication") - self.driver.shell("hilog -b I") diff --git a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0400.json b/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0400.json deleted file mode 100644 index 1aafb7c2674242d73358a98e981940a1ce96b7ca..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0400.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_nativedmscheck/SubStartupAppspawnNativedmscheck0400.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0400.py b/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0400.py deleted file mode 100644 index 2cdbd51ede9dc9df8ee2f2c56e684333c800dc7f..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativedmscheck/sub_startup_appspawn_nativedmscheck_0400.py +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hypium.action.os_hypium.device_logger import DeviceLogger -from hypium.model import UiParam, WindowFilter -import os - - -class SubStartupAppspawnNativedmscheck0400(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:唤醒屏幕.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - Step('开启DEBUG日志') - self.driver.shell("hilog -b I -D 0xC02C11") - self.driver.shell("hilog -b DEBUG -T APPSPAWN") - self.driver.shell("hilog -b D -D 0xDC02C11") - self.driver.shell("hilog -G 16M") - host.shell('hdc shell "hilog -r"') - - def test_step1(self): - Step("步骤1:安装私有路径hap包") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - hap1 = os.path.abspath( - os.path.join(os.path.join(path, "testFile"), - 'SUB_STARTUP_APPSPAWN_NATIVE/entry-default-signedArm64-test.hap')) - hap2 = os.path.abspath( - os.path.join(os.path.join(path, "testFile"), - 'SUB_STARTUP_APPSPAWN_NATIVE/entry-default-signed-hnpselinux.hap')) - self.driver.install_app(hap1) - self.driver.install_app(hap2) - Step("步骤2:过滤日志") - device_logger = DeviceLogger(self.driver) - device_logger.set_filter_string("MY_TAG") - Step("步骤3:开始抓取日志") - device_logger.start_log(path + '\\testFile\\log\\%s.log' % (self.TAG)) - Step("步骤4:打开测试应用") - self.driver.start_app("com.example.hnpselinuxtestapplication", "EntryAbility") - time.sleep(60) - Step("步骤4:关闭日志") - device_logger.stop_log() - time.sleep(4) - Step("识别设备型号...............................") - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - if ("HYM" in device or "HAD" in device): - device_logger.check_log("cfg file content:") - device_logger.check_log("[This is hnp sample config file.].") - device_logger.check_log("cfg file end") - device_logger.check_log('Open public cfg file to write failed, errno=[13]') - else: - device_logger.check_log('Open public cfg file to read failed, errno=[2]') - device_logger.check_log('Open public cfg file to write failed, errno=[2]') - device_logger.check_log('Open private cfg file to read failed, errno=[2]') - device_logger.check_log('Open private cfg file to write failed, errno=[2]') - - def teardown(self): - Step("收尾工作:删除hap") - self.driver.uninstall_app("com.example.hnp_test") - self.driver.uninstall_app("com.example.hnpselinuxtestapplication") - self.driver.shell("hilog -b I") diff --git a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0100.json b/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0100.json deleted file mode 100644 index a8e61cc24d97fb02be064d81093bb19152b4c524..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0100.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_nativepack/SubStartupAppspawnNativepack0100.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0100.py b/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0100.py deleted file mode 100644 index 60b3688b429c62569f356c3885ed973fd16a001b..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0100.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import Step, TestCase -from hypium.model import UiParam, WindowFilter -import os -import time - - -class SubStartupAppspawnNativepack0100(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - Step('预置工作:新增一个123.txt文件') - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - file = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/sample')) - with open(file + "\\lib\\123.txt", "a+") as f1: - f1.write("12345678hdaskheiwoi4eliqwkldsajoejqooiudsisa") - - def test_step1(self): - Step("获取bat文件路径") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - bat = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/run.bat')) - Step("执行bat文件") - host.shell(bat) - Step("复制压缩文件") - out = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/out/')) - sample = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/sample/')) - file1 = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/out/hnpsample.hnp')) - file2 = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/out/hnpsample.zip')) - host.shell("copy "+file1 + " " + file2) - Step("步骤7:解压hnpsample.zip文件") - host.unzip_file(file2, out) - Step("步骤8:比较2个文件内容是否一致") - time.sleep(1) - dif1 = f.read() - with open(out+"\\sample\\cfg\\hnpsample.cfg") as f: - dif2 = f.read() - self.driver.Assert.equal(dif1, dif2) - dif1 = f.read() - dif2 = f.read() - self.driver.Assert.equal(dif1, dif2) - with open(sample + "\\lib\\123.txt") as f: - dif1 = f.read() - with open(out + "\\sample\\lib\\123.txt") as f: - dif2 = f.read() - self.driver.Assert.equal(dif1, dif2) - - def teardown(self): - Step("收尾工作:删除out目录文件") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - out = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/out/')) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0200.json b/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0200.json deleted file mode 100644 index f42ce0d51c895e78db482eea8b4a98aa6be4ecb3..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0200.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_nativepack/SubStartupAppspawnNativepack0200.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0200.py b/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0200.py deleted file mode 100644 index 1a38d824604abd6e2e1d7895afddcdbf4969c03c..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0200.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import Step, TestCase -from hypium.model import UiParam, WindowFilter -import os -import time - - -class SubStartupAppspawnNativepack0200(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("获取bat文件路径") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - bat = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/run.bat')) - Step("执行bat文件") - host.shell(bat) - Step("复制压缩文件") - out = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/out/')) - sample = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/sample/')) - file1 = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/out/hnpsample.hnp')) - file2 = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/out/hnpsample.zip')) - host.shell("copy "+file1 + " " + file2) - Step("步骤7:解压hnpsample.zip文件") - host.unzip_file(file2, out) - Step("步骤8:比较2个文件内容是否一致") - time.sleep(1) - dif1 = f.read() - with open(out+"\\sample\\cfg\\hnpsample.cfg") as f: - dif2 = f.read() - self.driver.Assert.equal(dif1, dif2) - dif1 = f.read() - dif2 = f.read() - self.driver.Assert.equal(dif1, dif2) - - def teardown(self): - Step("收尾工作:删除out目录文件") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - out = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/out/')) \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0300.json b/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0300.json deleted file mode 100644 index 376a9a5ff9b5538b9277a40b82adf2c1757c960c..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0300.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_nativepack/SubStartupAppspawnNativepack0300.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0300.py b/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0300.py deleted file mode 100644 index 9a1631ccc595ad1873debd4bde935c9f41f8b8ec..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0300.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import Step, TestCase -from hypium.model import UiParam, WindowFilter -import os -import time - - -class SubStartupAppspawnNativepack0300(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - Step('预置工作:修改打包的文件') - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - file = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/sample')) - with open(file+"\\cfg\\hnpsample.cfg", "a") as f1: - f1.write("weuhriqj82hs9九jisapojhwkeioqw8321093nskjdlajejnphoneklv") - time.sleep(2) - - def test_step1(self): - Step("获取bat文件路径") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - bat = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/run.bat')) - Step("执行bat文件") - host.shell(bat) - Step("复制压缩文件") - out = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/out/')) - sample = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/sample/')) - file1 = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/out/hnpsample.hnp')) - file2 = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/out/hnpsample.zip')) - host.shell("copy "+file1 + " " + file2) - Step("步骤7:解压hnpsample.zip文件") - host.unzip_file(file2, out) - Step("步骤8:比较2个文件内容是否一致") - time.sleep(1) - dif1 = f.read() - with open(out+"\\sample\\cfg\\hnpsample.cfg") as f: - dif2 = f.read() - self.driver.Assert.equal(dif1, dif2) - dif1 = f.read() - dif2 = f.read() - self.driver.Assert.equal(dif1, dif2) - - def teardown(self): - Step("收尾工作:删除out目录文件") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - out = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/window/out/')) - file = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/sample')) - with open(file + "\\cfg\\hnpsample.cfg", "w") as f1: - f1.write("This is hnp sample config file.") \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0400.json b/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0400.json deleted file mode 100644 index b615cf0608da074a78ae01c772fad6377a46e5b2..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0400.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_nativepack/SubStartupAppspawnNativepack0400.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0400.py b/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0400.py deleted file mode 100644 index ed43fa775cd72dbbb90f582ad8cc4b9b3cfd4a92..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0400.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import Step, TestCase -from hypium.model import UiParam, WindowFilter -import os -import time - - -class SubStartupAppspawnNativepack0400(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("步骤1:添加读写权限") - self.driver.hdc("target mount") - Step("步骤2:导入打包所需的文件到设备data/usr目录") - self.driver.shell("mkdir data/usr") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - file1 = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/hnpcli')) - file2 = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/sample')) - self.driver.hdc("hdc file send " + file1 + " /data") - self.driver.hdc("hdc file send " + file2 + " /data/usr") - Step("步骤3:添加权限") - self.driver.shell("chmod +x /data/hnpcli") - Step("步骤4:执行打包命令") - self.driver.shell("data/hnpcli pack -i /data/usr/sample -o /data ") - Step("步骤5:复制hnp文件为zip文件") - self.driver.shell("cp /data/hnpsample.hnp /data/hnpsample.zip") - Step("步骤6:导出生成的zip包到本地") - out = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/out/')) - self.driver.hdc("hdc file recv /data/hnpsample.zip "+out) - Step("步骤7:解压hnpsample.zip文件") - Step("步骤8:比较2个文件内容是否一致") - time.sleep(1) - with open(file2+"\\cfg\\hnpsample.cfg") as f: - dif1 = f.read() - with open(out+"\\sample\\cfg\\hnpsample.cfg") as f: - dif2 = f.read() - self.driver.Assert.equal(dif1, dif2) - dif1 = f.read() - dif2 = f.read() - self.driver.Assert.equal(dif1, dif2) - - def teardown(self): - Step("收尾工作:删除out目录文件") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - out = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/out/')) - self.driver.shell("rm -rf /data/hnpsample.zip") - self.driver.shell("rm -rf /data/hnpsample.hnp") \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0500.json b/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0500.json deleted file mode 100644 index ecdac029c621bd4e8a51b5e8534519f0bb211b2c..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0500.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_nativepack/SubStartupAppspawnNativepack0500.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0500.py b/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0500.py deleted file mode 100644 index a50cf5e1ae633a6040aa9ec0088d9144193c154e..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0500.py +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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 Step, TestCase -from hypium.model import UiParam, WindowFilter -import os - - -class SubStartupAppspawnNativepack0500(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('预置工作:设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - Step('预置工作:修改打包的文件') - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - file = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/sample')) - with open(file+"\\cfg\\hnpsample.cfg", "a") as f1: - f1.write("weuhriqj82hs9九jisapojhwkeioqw8321093nskjdlajejnphoneklv") - time.sleep(2) - - def test_step1(self): - Step("步骤1:添加读写权限") - self.driver.hdc("target mount") - Step("步骤2:导入打包所需的文件到设备data/usr目录") - self.driver.shell("mkdir data/usr") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - file1 = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/hnpcli')) - file2 = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/sample')) - self.driver.hdc("hdc file send " + file1 + " /data") - self.driver.hdc("hdc file send " + file2 + " /data/usr") - Step("步骤3:添加权限") - self.driver.shell("chmod +x /data/hnpcli") - Step("步骤4:执行打包命令") - self.driver.shell("data/hnpcli pack -i /data/usr/sample -o /data ") - Step("步骤5:复制hnp文件为zip文件") - self.driver.shell("cp /data/hnpsample.hnp /data/hnpsample.zip") - Step("步骤6:导出生成的zip包到本地") - out = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/out/')) - self.driver.hdc("hdc file recv /data/hnpsample.zip " + out) - Step("步骤7:解压hnpsample.zip文件") - host.unzip_file(out + "\\hnpsample.zip", out) - Step("步骤8:比较2个文件内容是否一致") - time.sleep(1) - dif1 = f.read() - dif2 = f.read() - self.driver.Assert.equal(dif1, dif2) - dif1 = f.read() - dif2 = f.read() - self.driver.Assert.equal(dif1, dif2) - - def teardown(self): - Step("收尾工作:删除&修改相关文件") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - out = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/out/')) - self.driver.shell("rm -rf /data/hnpsample.zip") - self.driver.shell("rm -rf /data/hnpsample.hnp") - file = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/sample')) - with open(file + "\\cfg\\hnpsample.cfg", "w") as f1: - f1.write("This is hnp sample config file.") - - diff --git a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0600.json b/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0600.json deleted file mode 100644 index 434e339a270a03da1a2afe35c763e9c27129b54a..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0600.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_nativepack/SubStartupAppspawnNativepack0600.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0600.py b/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0600.py deleted file mode 100644 index 49a7f75cbb19878da24a9352bead5aba1197441f..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativepack/sub_startup_appspawn_nativepack_0600.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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 Step, TestCase -from hypium.model import UiParam, WindowFilter -import os - - -class SubStartupAppspawnNativepack0600(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('预置工作:设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - Step('预置工作:新增一个123.txt文件') - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - file = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/sample')) - f1.write("12345678hdaskheiwoi4eliqwkldsajoejqooiudsisa") - - def test_step1(self): - Step("步骤1:添加读写权限") - self.driver.hdc("target mount") - Step("步骤2:导入打包所需的文件到设备data/usr目录") - self.driver.shell("mkdir data/usr") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - file1 = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/hnpcli')) - file2 = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/sample')) - self.driver.hdc("hdc file send " + file1 + " /data") - self.driver.hdc("hdc file send " + file2 + " /data/usr") - Step("步骤3:添加权限") - self.driver.shell("chmod +x /data/hnpcli") - Step("步骤4:执行打包命令") - self.driver.shell("data/hnpcli pack -i /data/usr/sample -o /data ") - Step("步骤5:复制hnp文件为zip文件") - self.driver.shell("cp /data/hnpsample.hnp /data/hnpsample.zip") - Step("步骤6:导出生成的zip包到本地") - out = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/out/')) - self.driver.hdc("hdc file recv /data/hnpsample.zip " + out) - Step("步骤7:解压hnpsample.zip文件") - host.unzip_file(out + "\\hnpsample.zip", out) - Step("步骤8:比较2个文件内容是否一致") - time.sleep(1) - dif1 = f.read() - dif2 = f.read() - self.driver.Assert.equal(dif1, dif2) - dif1 = f.read() - dif2 = f.read() - self.driver.Assert.equal(dif1, dif2) - dif1 = f.read() - with open(out + "\\sample\\lib\\123.txt") as f: - dif2 = f.read() - self.driver.Assert.equal(dif1, dif2) - - def teardown(self): - Step("收尾工作:删除相关文件") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - out = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/out/')) - file = os.path.abspath(os.path.join(os.path.join(path, "testFile"), 'sub_startup_appspawn_nativepack/sample')) - self.driver.shell("rm -rf /data/hnpsample.zip") - self.driver.shell("rm -rf /data/hnpsample.hnp") diff --git a/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess.json b/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess.json deleted file mode 100644 index 8c1a9c370f82a6d7f4b73161a96f4711baaaf2b6..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "Config for OpenHarmony app test suites", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTestSuite", - "testsuite": "sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess.py", - "suitecases": [ - "sub_startup_appspawn_nativeprocess/SubStartupAppspawnNativeprocess0100.py", - "sub_startup_appspawn_nativeprocess/SubStartupAppspawnNativeprocess0200.py", - "sub_startup_appspawn_nativeprocess/SubStartupAppspawnNativeprocess0300.py", - "sub_startup_appspawn_nativeprocess/SubStartupAppspawnNativeprocess0400.py", - "sub_startup_appspawn_nativeprocess/SubStartupAppspawnNativeprocess0500.py", - "sub_startup_appspawn_nativeprocess/SubStartupAppspawnNativeprocess0600.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess.py b/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess.py deleted file mode 100644 index 3ef49829c029dae5c9a11d1e85fcc6f7ac805dee..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from time import sleep -from devicetest.core.test_case import Step -from devicetest.core.suite.test_suite import TestSuite -from aw import Common - - -class SubStartupAppspawnNativeprocess(TestSuite): - - def setup(self): - Step("TestCase: setup") - self.driver = UiDriver(self.device1) - Step("预置工作:初始化手机开始.................") - Step(self.devices[0].device_id) - Step("导入配置文件.................") - self.driver.hdc("target mount") - sourpath = Common.sourcepath("AppSpawnTest", "sub_startup_appspawn_nativeprocess") - destpath = "/data/AppSpawnTest" - self.driver.push_file(sourpath, destpath) - sleep(3) - Step("给测试文件AppSpawnTest可执行权限.................") - self.driver.shell('chmod +x /data/AppSpawnTest') - self.driver.shell('./data/AppSpawnTest') - - def teardown(self): - Step("收尾工作,删除文件.................") - self.driver.shell("rm /data/AppSpawnTest") diff --git a/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess_0100.py b/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess_0100.py deleted file mode 100644 index 26b96df1904c017e9da3ead3684f6f6fab0e04e3..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess_0100.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import Step, TestCase - - -class SubStartupAppspawnNativeprocess0100(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("TestCase: setup") - Step("预置工作:初始化手机开始.................") - Step(self.devices[0].device_id) - - def test_step1(self): - Step("执行AppSpawnTest'.................") - result = self.driver.shell('./data/AppSpawnTest') - self.driver.Assert.contains(result, "Failed spawn new app result", "默认启动孵化APPSPAWN失败") - - def teardown(self): - Step("TestCase: teardown") diff --git a/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess_0200.py b/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess_0200.py deleted file mode 100644 index 27866f8dbb47dacd20bb295eb37ea833a080aef8..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess_0200.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import Step, TestCase - - -class SubStartupAppspawnNativeprocess0200(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("TestCase: setup") - Step("预置工作:初始化手机开始.................") - Step(self.devices[0].device_id) - - def test_step1(self): - Step("执行AppSpawnTest'.................") - result = self.driver.shell('./data/AppSpawnTest -s -b moduleTestProcessName') - self.driver.Assert.contains(result, "Failed spawn new app result", "带沙盒启动孵化APPSPAWN失败") - Step("执行AppSpawnTest'.................") - failresult = self.driver.shell('./data/AppSpawnTest -s') - self.driver.Assert.contains(failresult, "Failed spawn new app result -1", "模拟'带沙盒启动孵化APPSPAWN失败'失败") - - def teardown(self): - Step("TestCase: teardown") diff --git a/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess_0400.py b/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess_0400.py deleted file mode 100644 index c16add36afe4655238c04353b6c11432565b90ee..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess_0400.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import Step, TestCase - - -class SubStartupAppspawnNativeprocess0400(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("TestCase: setup") - Step("预置工作:初始化手机开始.................") - Step(self.devices[0].device_id) - - def test_step1(self): - Step("执行AppSpawnTest'.................") - result = self.driver.shell('./data/AppSpawnTest -b ohos.xxxxxx.xxxxxxxx') - self.driver.Assert.contains(result, "Failed spawn new app result", "模拟新app启动孵化APPSPAWN失败") - - def teardown(self): - Step("TestCase: teardown") diff --git a/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess_0500.py b/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess_0500.py deleted file mode 100644 index f10dd2c76e461d75ba339d2645f0e00fe90ea51c..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess_0500.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import Step, TestCase - - -class SubStartupAppspawnNativeprocess0500(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("TestCase: setup") - Step("预置工作:初始化手机开始.................") - Step(self.devices[0].device_id) - - def test_step1(self): - Step("执行AppSpawnTest'.................") - result = self.driver.shell('./data/AppSpawnTest -b ohos.xxxxxx.xxxxxxxx -s') - self.driver.Assert.contains(result, "Failed spawn new app result -1", "指定不存在app启动孵化APPSPAWN失败") - - def teardown(self): - Step("TestCase: teardown") diff --git a/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess_0600.py b/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess_0600.py deleted file mode 100644 index dc1c22483b4bc252fdac770b4c928a86f32e26a3..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativeprocess/sub_startup_appspawn_nativeprocess_0600.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from devicetest.core.test_case import Step, TestCase - - -class SubStartupAppspawnNativeprocess0600(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("TestCase: setup") - Step("预置工作:初始化手机开始.................") - Step(self.devices[0].device_id) - - def test_step1(self): - Step("执行AppSpawnTest'.................") - result = self.driver.shell('./data/AppSpawnTest -b ohos.xxxxxx.xxxxxxxx -s') - self.driver.Assert.contains(result, "Failed spawn new app result -1", "指定不存在app启动孵化APPSPAWN失败") - Step("执行AppSpawnTest'.................") - successresult = self.driver.shell('./data/AppSpawnTest -C') - self.driver.Assert.contains(result, "Failed spawn new app result", "模拟指定不存在的app启动孵化APPSPAWN失败后,重新启动测试失败") - - def teardown(self): - Step("TestCase: teardown") diff --git a/test/autotest/sub_startup_appspawn_nativesandbox/sub_startup_appspawn_nativesandbox_0100.json b/test/autotest/sub_startup_appspawn_nativesandbox/sub_startup_appspawn_nativesandbox_0100.json deleted file mode 100644 index 9f5581fd527da1af73a11d798d07844424041a6a..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativesandbox/sub_startup_appspawn_nativesandbox_0100.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_nativesandbox/SubStartupAppspawnNativesandbox0100.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativesandbox/sub_startup_appspawn_nativesandbox_0100.py b/test/autotest/sub_startup_appspawn_nativesandbox/sub_startup_appspawn_nativesandbox_0100.py deleted file mode 100644 index 982ae50835f097aac0b4d293fdfa1fce224a3f27..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativesandbox/sub_startup_appspawn_nativesandbox_0100.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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 Step, TestCase -from hypium.model import UiParam, WindowFilter -import os - - -class SubStartupAppspawnNativesandbox0100(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.shell("power-shell timeout -o 2147483647") - - def test_step1(self): - Step("步骤1:创建公有hnp存放目录") - self.driver.shell("mkdir -p data/UCbrowser/public") - Step("步骤2:导入安装包文件hnp") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - hnp = os.path.abspath(os.path.join( - os.path.join(path, "testFile"), 'SUB_STARTUP_APPSPAWN_NATIVE/sign/hnpsample.hnp')) - hap = os.path.abspath( - os.path.join(os.path.join(path, "testFile"), 'SUB_STARTUP_APPSPAWN_NATIVE/sign/entry-default-signedArm64-test11.hap')) - self.driver.push_file(hnp, "data/UCbrowser/public/") - self.driver.push_file(hap, "data/UCbrowser") - Step("步骤3:执行安装命令") - self.driver.shell( - "hnp install -u 100 -p uc_browser -i data/UCbrowser -s data/UCbrowser/entry-default-signedArm64-test11.hap -a arm64 -f") - Step("步骤4:查看是是否安装成功") - public = self.driver.shell("ls /data/app/el1/bundle/100/hnppublic/") - self.driver.Assert.contains(public, "hnpsample.org") - result = self.driver.shell("cat /data/service/el1/startup/hnp_info.json") - self.driver.Assert.contains(result, "uc_browser") - Step("步骤5:安装测试hap包") - ishap = self.driver.has_app("com.example.hnptestapplication") - if (ishap): - hap1 = os.path.abspath( - os.path.join(os.path.join(path, "testFile"), - 'SUB_STARTUP_APPSPAWN_NATIVE/entry-default-sandbox.hap')) - self.driver.install_app(hap1) - Step("步骤6:打开测试hap包") - self.driver.shell("aa start -a EntryAbility -b com.example.hnptestapplication") - Step("步骤7:获取测试应用pid") - time.sleep(3) - pid = self.driver.System.get_pid("com.example.hnptestapplication") - Step("步骤8:查看测试应用公有沙箱路径") - result = self.driver.shell("ls /proc/%d/root/data/service/hnp" % pid) - Step("步骤9:预期结果校验") - Step("识别设备型号...............................") - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - if ("HYM" in device or "HAD" in device): - self.driver.Assert.contains(result, "bin") - self.driver.Assert.contains(result, "hnpsample.org") - else: - self.driver.Assert.contains(result, "No such file or directory") - diff --git a/test/autotest/sub_startup_appspawn_nativesandbox/sub_startup_appspawn_nativesandbox_0200.json b/test/autotest/sub_startup_appspawn_nativesandbox/sub_startup_appspawn_nativesandbox_0200.json deleted file mode 100644 index 700785e5376a083d4bcce2b9f6c967191f4dbe61..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativesandbox/sub_startup_appspawn_nativesandbox_0200.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_nativesandbox/SubStartupAppspawnNativesandbox0200.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_nativesandbox/sub_startup_appspawn_nativesandbox_0200.py b/test/autotest/sub_startup_appspawn_nativesandbox/sub_startup_appspawn_nativesandbox_0200.py deleted file mode 100644 index d26ab39db79cf70dc7aa7db8bfb2ca2f0e17b2f4..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_nativesandbox/sub_startup_appspawn_nativesandbox_0200.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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 Step, TestCase -from hypium.model import UiParam, WindowFilter -import os - - -class SubStartupAppspawnNativesandbox0200(TestCase): - - def __init__(self, controllers): - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.TAG, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.shell("power-shell timeout -o 2147483647") - - def test_step1(self): - Step("步骤1:创建公有hnp存放目录") - self.driver.shell("mkdir -p data/com.example.hnptestapplication/private") - Step("步骤2:导入安装包文件hnp") - path = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - hnp = os.path.abspath(os.path.join( - os.path.join(path, "testFile"), 'SUB_STARTUP_APPSPAWN_NATIVE/sign/hnpsample.hnp')) - hap = os.path.abspath( - os.path.join(os.path.join(path, "testFile"), 'SUB_STARTUP_APPSPAWN_NATIVE/sign/entry-default-signedArm64-test11.hap')) - self.driver.push_file(hnp, "data/com.example.hnptestapplication/private/") - self.driver.push_file(hap, "data/com.example.hnptestapplication") - Step("步骤3:执行安装命令") - self.driver.shell( - "hnp install -u 100 -p com.example.hnptestapplication -i data/com.example.hnptestapplication -s data/com.example.hnptestapplication/entry-default-signedArm64-test11.hap -a arm64 -f") - Step("步骤4:查看是是否安装成功") - public = self.driver.shell("ls /data/app/el1/bundle/100/hnp/com.example.hnptestapplication") - self.driver.Assert.contains(public, "hnpsample.org") - Step("步骤5:安装测试hap包") - ishap = self.driver.has_app("com.example.hnptestapplication") - if (ishap): - hap1 = os.path.abspath( - os.path.join(os.path.join(path, "testFile"), - 'SUB_STARTUP_APPSPAWN_NATIVE/entry-default-sandbox.hap')) - self.driver.install_app(hap1) - Step("步骤6:打开测试hap包") - self.driver.shell("aa start -a EntryAbility -b com.example.hnptestapplication") - Step("步骤7:获取测试应用pid") - time.sleep(1) - pid = self.driver.System.get_pid("com.example.hnptestapplication") - Step("步骤8:查看测试应用公有沙箱路径") - result = self.driver.shell("ls /proc/%d/root/data/app" % pid) - Step("步骤9:预期结果校验") - Step("识别设备型号...............................") - device = self.driver.shell("param get const.product.model") - device = device.replace("\n", "").replace(" ", "") - device = str(device) - if ("HYM" in device or "HAD" in device): - self.driver.Assert.contains(result, "bin") - self.driver.Assert.contains(result, "hnpsample.org") - else: - self.driver.Assert.contains(result, "No such file or directory") - - def teardown(self): - self.driver.shell("hnp uninstall -u 100 -p com.example.hnptestapplication") diff --git a/test/autotest/sub_startup_appspawn_supplementary/sub_startup_appspawn_supplementary_0100.json b/test/autotest/sub_startup_appspawn_supplementary/sub_startup_appspawn_supplementary_0100.json deleted file mode 100644 index 9a4957d4a6e74c792901be396e7973333bb98790..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_supplementary/sub_startup_appspawn_supplementary_0100.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_supplementary/Substartupappspawnsupplementary0100.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_supplementary/sub_startup_appspawn_supplementary_0100.py b/test/autotest/sub_startup_appspawn_supplementary/sub_startup_appspawn_supplementary_0100.py deleted file mode 100644 index fc2cad965f74fe109124db7b6dd4e8138db3b153..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_supplementary/sub_startup_appspawn_supplementary_0100.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from time import sleep -from devicetest.core.test_case import Step, TestCase -from hyp import HypiumClass1, HypiumClass2, HypiumFunction1 - -from aw import Common - - -class Substartupappspawnsupplementary0100(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("TestCase: setup") - Step("预置工作:初始化手机开始.................") - Step(self.devices[0].device_id) - Step("安装测试hap.................") - sourpath = Common.sourcepath("asan.hap", "SUB_STARTUP_APPSPAWN_SUPPLEMENTARY") - Step(sourpath) - self.driver.AppManager.install_app(sourpath) - Step("预置工作:检测屏幕是否亮.................") - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("打开测试hap.................") - self.driver.start_app("com.example.myapplication", "EntryAbility") - sleep(3) - Step("校验hap显示Hello World.................") - if not self.driver.find_component(BY.text("Hello World")): - throw std::runtime_error("Failed to find component with text 'Hello'") - - - def teardown(self): - Step("收尾工作.................") - Step("收尾工作:卸载hap......................") - self.driver.AppManager.clear_app_data('com.example.myapplication') - self.driver.AppManager.uninstall_app('com.example.myapplication') \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_supplementary/sub_startup_appspawn_supplementary_0200.json b/test/autotest/sub_startup_appspawn_supplementary/sub_startup_appspawn_supplementary_0200.json deleted file mode 100644 index d17ba198713dcaa0d91c9dd2f4afeee58422919e..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_supplementary/sub_startup_appspawn_supplementary_0200.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": [ - "sub_startup_appspawn_supplementary/Substartupappspawnsupplementary0200.py" - ] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_supplementary/sub_startup_appspawn_supplementary_0200.py b/test/autotest/sub_startup_appspawn_supplementary/sub_startup_appspawn_supplementary_0200.py deleted file mode 100644 index 4b5ec0613a756b77afd269042f8aec687d360c6c..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_supplementary/sub_startup_appspawn_supplementary_0200.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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. - -from time import sleep -from devicetest.core.test_case import Step, TestCase -from hypium importFunction1, SpecificFunction2 - -from aw import Common - - -class Substartupappspawnsupplementary0200(TestCase): - - def __init__(self, controllers): - self.tag = self.__class__.__name__ - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("TestCase: setup") - Step("预置工作:初始化手机开始.................") - Step(self.devices[0].device_id) - Step("安装测试hap.................") - sourpath = Common.sourcepath("sn.hap", "SUB_STARTUP_APPSPAWN_SUPPLEMENTARY") - Step(sourpath) - self.driver.AppManager.install_app(sourpath) - Step("预置工作:检测屏幕是否亮.................") - self.driver.Screen.wake_up() - self.driver.ScreenLock.unlock() - self.driver.Screen.enable_stay_awake() - - def test_step1(self): - Step("打开测试hap.................") - self.driver.start_app("com.example.myapplication", "EntryAbility") - sleep(3) - Step("检查存在device info.................") - assert self.driver.find_component(BY.text("3333333", MatchPattern.CONTAINS)) - print("点击菜单device info.................") - self.driver.touch(BY.text(" device info ")) - sleep(1) - Step("校验serial为空.................") - if not self.driver.find_component(BY.text("serial: " + "\n" + " deviceType", MatchPattern.CONTAINS)) - - def teardown(self): - Step("收尾工作.................") - Step("收尾工作:卸载hap......................") - self.driver.AppManager.clear_app_data('com.example.myapplication') - self.driver.AppManager.uninstall_app('com.example.myapplication') \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0100.json b/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0100.json deleted file mode 100644 index 53f12fe94418163592797dcdbc2d51b88dc77f02..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0100.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_ubsanvariable/Substartupappspawnubsanvariable0100.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0100.py b/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0100.py deleted file mode 100644 index f8876929df40cb1e4e3c969b8ec45737a77d7bf5..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0100.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hypium import HypiumClass, HypiumFunction -from hypium.action.os_hypium.device_logger import DeviceLogger -from hypium.model import UiParam, WindowFilter -import time - - -class Substartupappspawnubsanvariable0100(TestCase): - def __init__(self, controllers): - self.tag = self.__class__.__name__ - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - Step('开启DEBUG日志') - self.driver.shell("hilog -b D -D 0xC02C11") - self.driver.shell("hilog -b DEBUG -T APPSPAWN") - self.driver.shell("hilog -b D -D 0xDC02C11") - self.driver.shell("hilog -G 16M") - - def test_step1(self): - Step("步骤1:过滤关键日志") - device_logger = DeviceLogger(self.driver) - device_logger.set_filter_string("SetAsanEnabledEnv") - Step("步骤2:安装测试hap") - path = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) - hap = os.path.abspath(os.path.join(os.path.join(path, "testFile"), - "SUB_STARTUP_APPSPAWN_UBSANVARIABLE/ActsStartEnabledTrueProcessTest.hap")) - ishap = self.driver.has_app("com.example.actsstartenabledtrueprocesstest") - if(ishap): - self.driver.uninstall_app("com.example.actsstartenabledtrueprocesstest") - else: - pass - self.driver.install_app(hap) - Step("步骤3:开始抓取日志") - device_logger.start_log(path + '\\testFile\\log\\%s.log' % (self.TAG)) - Step("步骤4:启动测试应用") - self.driver.shell("aa start -a EntryAbility -b com.example.actsstartenabledtrueprocesstest") - time.sleep(8) - Step("步骤4:关闭日志") - device_logger.stop_log() - device_logger.check_log('SetAsanEnabledEnv 22,(null),(null),(null)') - device_logger.check_log('print_stacktrace=1:print_module_map=2:log_exe_name=1,(null)') - - def teardown(self): - Step("收尾工作:删除测试应用") - self.driver.uninstall_app("com.example.actsstartenabledtrueprocesstest") - self.driver.shell("hilog -b I") diff --git a/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0200.json b/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0200.json deleted file mode 100644 index 29b796cf39bdad74194c8a62ca82db82411d55b1..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0200.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_ubsanvariable/Substartupappspawnubsanvariable0200.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0200.py b/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0200.py deleted file mode 100644 index 83070fb5acd95cb3476c4b9073057b939c632a40..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0200.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hyp import HypiumClass1, HypiumClass2, HypiumFunction1 -from hypium.action.os_hypium.device_logger import DeviceLogger -from hypium.model import UiParam, WindowFilter -import time - - -class Substartupappspawnubsanvariable0200(TestCase): - def __init__(self, controllers): - self.tag = self.__class__.__name__ - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - Step('开启DEBUG日志') - self.driver.shell("hilog -b D") - self.driver.shell("hilog -G 16M") - - def test_step1(self): - Step("步骤1:过滤关键日志") - device_logger = DeviceLogger(self.driver) - device_logger.set_filter_string("SetAsanEnabledEnv") - Step("步骤2:安装测试hap") - path = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) - hap = os.path.abspath(os.path.join(os.path.join(path, "testFile"), - "SUB_STARTUP_APPSPAWN_UBSANVARIABLE/ActsStartEnabledFalseProcessTest.hap")) - ishap = self.driver.has_app("com.example.actsstartenabledtrueprocesstest") - if (ishap): - self.driver.uninstall_app("com.example.actsstartenabledfalseprocesstest") - else: - pass - self.driver.install_app(hap) - Step("步骤3:开始抓取日志") - device_logger.start_log(path + '\\testFile\\log\\%s.log' % (self.TAG)) - Step("步骤4:启动测试应用") - self.driver.shell("aa start -a EntryAbility -b com.example.actsstartenabledfalseprocesstest") - time.sleep(8) - Step("步骤4:关闭日志") - device_logger.stop_log() - time.sleep(2) - device_logger.check_not_exist_keyword('SetAsanEnabledEnv 22') - - def teardown(self): - Step("收尾工作:删除测试应用") - self.driver.uninstall_app("com.example.actsstartenabledfalseprocesstest") - self.driver.shell("hilog -b I") diff --git a/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0300.json b/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0300.json deleted file mode 100644 index e72103b0edfcb17227de9df9befb878cdd6e5fe6..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0300.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "description": "Config for OpenHarmony devicetest test cases", - "environment": [ - { - "type": "device", - "label": "phone" - } - ], - "driver": { - "type": "DeviceTest", - "py_file": ["sub_startup_appspawn_ubsanvariable/Substartupappspawnubsanvariable0300.py"] - } -} \ No newline at end of file diff --git a/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0300.py b/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0300.py deleted file mode 100644 index 591f529ca455040ff431f5805e287438e131067a..0000000000000000000000000000000000000000 --- a/test/autotest/sub_startup_appspawn_ubsanvariable/sub_startup_appspawn_ubsanvariable_0300.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2025 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, Step, CheckPoint -from devicetest.core.test_case import Step, TestCase -from hypium import HypiumClass, HypiumFunction -from hypium.action.os_hypium.device_logger import DeviceLogger -from hypium.model import UiParam, WindowFilter -import time - - -class Substartupappspawnubsanvariable0300(TestCase): - def __init__(self, controllers): - self.tag = self.__class__.__name__ - self.tests = [ - "test_step1" - ] - TestCase.__init__(self, self.tag, controllers) - self.driver = UiDriver(self.device1) - - def setup(self): - Step("预置工作:初始化手机开始.................") - self.driver = UiDriver(self.device1) - Step("预置工作:检测屏幕是否亮.................") - self.driver.enable_auto_wakeup(self.device1) - Step("预置工作:滑动解锁.................") - self.driver.swipe(UiParam.UP, side=UiParam.BOTTOM) - Step('设置屏幕常亮') - self.driver.Screen.enable_stay_awake() - Step('开启DEBUG日志') - self.driver.shell("hilog -b D") - self.driver.shell("hilog -G 16M") - - def test_step1(self): - Step("步骤1:过滤关键日志") - device_logger = DeviceLogger(self.driver) - device_logger.set_filter_string("SetAsanEnabledEnv") - Step("步骤2:安装测试hap") - path = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) - hap = os.path.abspath(os.path.join(os.path.join(path, "testFile"), - "SUB_STARTUP_APPSPAWN_UBSANVARIABLE/ActsStartNoConfigEnabledProcessTest.hap")) - ishap = self.driver.has_app("com.example.actsstartenabledtrueprocesstest") - if (ishap): - self.driver.uninstall_app("com.example.actsstartnoconfigenabledprocesstest") - else: - pass - self.driver.install_app(hap) - Step("步骤3:开始抓取日志") - device_logger.start_log(path + '\\testFile\\log\\%s.log' % (self.TAG)) - Step("步骤4:启动测试应用") - self.driver.shell("aa start -a EntryAbility -b com.example.actsstartnoconfigenabledprocesstest") - time.sleep(8) - Step("步骤4:关闭日志") - device_logger.stop_log() - time.sleep(2) - device_logger.check_not_exist_keyword('SetAsanEnabledEnv 22') - - def teardown(self): - Step("收尾工作:删除测试应用") - self.driver.uninstall_app("com.example.actsstartnoconfigenabledprocesstest") - self.driver.shell("hilog -b I")