From c7ae0af23641b8f2f31aa81dd72d8dcc94d84f65 Mon Sep 17 00:00:00 2001 From: h60047265 Date: Tue, 22 Apr 2025 15:15:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9level=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: h60047265 --- .../level1/lifecycle/lifecycle_state_001.json | 2 +- .../level1/lifecycle/lifecycle_state_001.py | 52 ++---------- .../level1/lifecycle/lifecycle_state_002.json | 2 +- .../level1/lifecycle/lifecycle_state_002.py | 57 ++----------- .../level1/lifecycle/lifecycle_state_003.json | 2 +- .../level1/lifecycle/lifecycle_state_003.py | 57 ++----------- .../level1/lifecycle/lifecycle_state_004.json | 2 +- .../level1/lifecycle/lifecycle_state_004.py | 57 ++----------- .../level1/lifecycle/lifecycle_state_005.json | 2 +- .../level1/lifecycle/lifecycle_state_005.py | 55 ++----------- .../level1/lifecycle/lifecycle_state_006.json | 2 +- .../level1/lifecycle/lifecycle_state_006.py | 52 ++---------- .../level1/lifecycle/lifecycle_state_007.json | 2 +- .../level1/lifecycle/lifecycle_state_007.py | 52 ++---------- .../level1/lifecycle/lifecycle_state_008.json | 2 +- .../level1/lifecycle/lifecycle_state_008.py | 50 ++---------- .../level1/lifecycle/lifecycle_state_009.json | 2 +- .../level1/lifecycle/lifecycle_state_009.py | 52 ++---------- .../level1/lifecycle/lifecycle_state_010.json | 2 +- .../level1/lifecycle/lifecycle_state_010.py | 52 ++---------- .../level1/lifecycle/lifecycle_state_016.json | 2 +- .../level1/lifecycle/lifecycle_state_017.json | 2 +- .../level1/lifecycle/lifecycle_state_018.json | 2 +- .../level1/lifecycle/lifecycle_state_019.json | 2 +- .../level1/lifecycle/lifecycle_state_020.json | 2 +- .../level1/lifecycle/lifecycle_state_021.json | 2 +- .../level1/lifecycle/lifecycle_state_021.py | 58 ++------------ .../level1/lifecycle/lifecycle_state_022.json | 2 +- .../level1/lifecycle/lifecycle_state_022.py | 60 ++------------ .../level1/lifecycle/lifecycle_state_023.json | 2 +- .../level1/lifecycle/lifecycle_state_023.py | 60 ++------------ .../level1/lifecycle/lifecycle_state_024.json | 2 +- .../level1/lifecycle/lifecycle_state_024.py | 60 ++------------ .../level1/lifecycle/lifecycle_state_025.json | 2 +- .../level1/lifecycle/lifecycle_state_025.py | 60 ++------------ .../level1/lifecycle/lifecycle_state_026.json | 2 +- .../level1/lifecycle/lifecycle_state_026.py | 78 ++---------------- .../networking/sub_samgr_sa_load_002.json | 4 +- .../networking/sub_samgr_sa_load_002.py | 79 ++----------------- .../networking/sub_samgr_sa_once_001.json | 2 +- .../networking/sub_samgr_sa_once_001.py | 73 ++--------------- 41 files changed, 128 insertions(+), 984 deletions(-) diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.json index 64d6d449..ce54c18f 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.py index c944f2b5..dfd20c58 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.py @@ -23,27 +23,6 @@ from hypium.action.host import host from hypium.action.os_hypium.checker import Assert from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_001/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_001/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) class LifeCycle_State_001(TestCase): @@ -55,32 +34,13 @@ class LifeCycle_State_001(TestCase): ] self.driver = UiExplore(self.driver1) self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - host.shell("hdc -t {} target mount".format(self.sn)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - driver.System.reboot() + def setup(self): + self.log.info("lifecycle_state_012 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_001") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): driver = self.driver diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_002.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_002.json index c3436e69..e091b9bc 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_002.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_002.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_002.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_002.py index f232d452..cba11481 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_002.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_002.py @@ -24,30 +24,6 @@ from hypium.action.os_hypium.checker import Assert from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand from devicetest.utils.file_util import get_resource_path -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_002/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_002/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) class LifeCycle_State_002(TestCase): @@ -59,34 +35,13 @@ class LifeCycle_State_002(TestCase): ] self.driver = UiExplore(self.driver1) self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - # 清理日志 - driver.shell('hilog -r') - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() + def setup(self): + self.log.info("lifecycle_state_012 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_002") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): driver = self.driver diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_003.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_003.json index 8a5d5d03..be874be8 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_003.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_003.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_003.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_003.py index c54f6c95..c2d3c25b 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_003.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_003.py @@ -24,30 +24,6 @@ from hypium.action.os_hypium.checker import Assert from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand from devicetest.utils.file_util import get_resource_path -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_003/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_003/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) class LifeCycle_State_003(TestCase): @@ -59,34 +35,13 @@ class LifeCycle_State_003(TestCase): ] self.driver = UiExplore(self.driver1) self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - # 清理日志 - driver.shell('hilog -r') - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() + def setup(self): + self.log.info("lifecycle_state_012 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_003") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): driver = self.driver diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_004.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_004.json index eee728d9..028aeaef 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_004.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_004.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_004.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_004.py index de607dfd..10d506a1 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_004.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_004.py @@ -24,30 +24,6 @@ from hypium.action.os_hypium.checker import Assert from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand from devicetest.utils.file_util import get_resource_path -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_004/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_004/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) class LifeCycle_State_004(TestCase): @@ -59,34 +35,13 @@ class LifeCycle_State_004(TestCase): ] self.driver = UiExplore(self.driver1) self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - # 清理日志 - driver.shell('hilog -r') - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - host.shell("hdc -t {} target mount".format(self.sn)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - driver.System.reboot() + def setup(self): + self.log.info("lifecycle_state_012 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_004") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): driver = self.driver diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_005.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_005.json index 820d3e24..95709cb7 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_005.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_005.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_005.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_005.py index eeacd655..d77a7a22 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_005.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_005.py @@ -24,30 +24,6 @@ from hypium.action.os_hypium.checker import Assert from hypium.action.os_hypium.device_logger import DeviceLogger from devicetest.utils.file_util import get_resource_path -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_005/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_005/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) class LifeCycle_State_005(TestCase): @@ -59,32 +35,13 @@ class LifeCycle_State_005(TestCase): ] self.driver = UiExplore(self.driver1) self.sn = self.driver1.device_sn - - def setup(self): - # driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() + def setup(self): + self.log.info("lifecycle_state_012 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_005") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): driver = self.driver diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_006.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_006.json index 100b3027..1efe4ad0 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_006.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_006.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_006.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_006.py index 0c220736..12174c27 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_006.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_006.py @@ -24,27 +24,6 @@ from hypium.action.os_hypium.checker import Assert from hypium.action.os_hypium.device_logger import DeviceLogger from devicetest.utils.file_util import get_resource_path -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_006/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_006/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) class LifeCycle_State_006(TestCase): @@ -56,32 +35,13 @@ class LifeCycle_State_006(TestCase): ] self.driver = UiExplore(self.driver1) self.sn = self.driver1.device_sn - - def setup(self): - # driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() + def setup(self): + self.log.info("lifecycle_state_012 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_006") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): driver = self.driver diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_007.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_007.json index 9314daf2..3088cb3d 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_007.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_007.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_007.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_007.py index 73f8cf0b..6fa1060f 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_007.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_007.py @@ -24,27 +24,6 @@ from hypium.action.os_hypium.checker import Assert from hypium.action.os_hypium.device_logger import DeviceLogger from devicetest.utils.file_util import get_resource_path -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_007/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_007/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) class LifeCycle_State_007(TestCase): @@ -56,32 +35,13 @@ class LifeCycle_State_007(TestCase): ] self.driver = UiExplore(self.driver1) self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - host.shell("hdc -t {} target mount".format(self.sn)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - driver.System.reboot() + def setup(self): + self.log.info("lifecycle_state_012 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_007") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): driver = self.driver diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_008.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_008.json index c5338ddc..4eba45c2 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_008.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_008.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_008.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_008.py index 5065b719..3b74c5ac 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_008.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_008.py @@ -24,27 +24,6 @@ from hypium.action.os_hypium.checker import Assert from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand from devicetest.utils.file_util import get_resource_path -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_008/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_008/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) class LifeCycle_State_008(TestCase): @@ -58,30 +37,11 @@ class LifeCycle_State_008(TestCase): self.sn = self.driver1.device_sn def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() + self.log.info("lifecycle_state_012 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_008") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): driver = self.driver diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_009.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_009.json index 95a1978d..ea41bf9f 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_009.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_009.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_009.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_009.py index fce5ff72..25cb153c 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_009.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_009.py @@ -24,27 +24,6 @@ from hypium.action.os_hypium.checker import Assert from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand from devicetest.utils.file_util import get_resource_path -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_009/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_009/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) class LifeCycle_State_009(TestCase): @@ -56,32 +35,13 @@ class LifeCycle_State_009(TestCase): ] self.driver = UiExplore(self.driver1) self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - host.shell("hdc -t {} target mount".format(self.sn)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - driver.System.reboot() + def setup(self): + self.log.info("lifecycle_state_012 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_009") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): driver = self.driver diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_010.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_010.json index f9fe11d6..a66c5fd9 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_010.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_010.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_010.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_010.py index 34d53b2b..0db026e8 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_010.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_010.py @@ -24,27 +24,6 @@ from hypium.action.os_hypium.checker import Assert from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand from devicetest.utils.file_util import get_resource_path -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_010/listen_test.cfg", - isdir=None) -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_010/listen_test.json", - isdir=None) -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) class LifeCycle_State_010(TestCase): @@ -56,32 +35,13 @@ class LifeCycle_State_010(TestCase): ] self.driver = UiExplore(self.driver1) self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - host.shell("hdc -t {} target mount".format(self.sn)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - driver.System.reboot() + def setup(self): + self.log.info("lifecycle_state_012 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_010") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): driver = self.driver diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_016.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_016.json index 6d7c9498..1d071503 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_016.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_016.json @@ -12,4 +12,4 @@ "testcases/level1/lifecycle/lifecycle_state_016.py" ] } - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_017.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_017.json index a3425f1e..34a92b7a 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_017.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_017.json @@ -12,4 +12,4 @@ "testcases/level1/lifecycle/lifecycle_state_017.py" ] } - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_018.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_018.json index 0bd10d10..45a3070c 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_018.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_018.json @@ -12,4 +12,4 @@ "testcases/level1/lifecycle/lifecycle_state_018.py" ] } - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_019.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_019.json index e590c529..5c8afb8f 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_019.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_019.json @@ -12,4 +12,4 @@ "testcases/level1/lifecycle/lifecycle_state_019.py" ] } - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_020.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_020.json index 82f18e61..43f90702 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_020.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_020.json @@ -12,4 +12,4 @@ "testcases/level1/lifecycle/lifecycle_state_020.py" ] } - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_021.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_021.json index 565d75c5..b66f9b31 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_021.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_021.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_021.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_021.py index 9b8cd3cb..0f9c5e60 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_021.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_021.py @@ -26,35 +26,6 @@ from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand from devicetest.utils.file.file_util import get_resource_path -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_021/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_021/listen_test.json", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - - class LifeCycle_State_021(TestCase): def __init__(self, controllers): @@ -67,30 +38,11 @@ class LifeCycle_State_021(TestCase): self.sn = self.driver1.device_sn def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() + self.log.info("lifecycle_state_018 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_021") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): # 步骤 "ondemand test 21"命令,执行测试程序 diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_022.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_022.json index 0a6fbf9b..a48346ab 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_022.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_022.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_022.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_022.py index e38b132e..85dc7a71 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_022.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_022.py @@ -26,35 +26,6 @@ from hypium.action.os_hypium.device_logger import DeviceLogger, AsyncCommand from devicetest.utils.file.file_util import get_resource_path -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_022/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_022/listen_test.json", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - - class LifeCycle_State_022(TestCase): def __init__(self, controllers): @@ -65,32 +36,13 @@ class LifeCycle_State_022(TestCase): ] self.driver = UiExplore(self.driver1) self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() + def setup(self): + self.log.info("lifecycle_state_019 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_022") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): driver = self.driver diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_023.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_023.json index 6f311ec0..ff44809d 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_023.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_023.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_023.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_023.py index 7a158da7..fc50597b 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_023.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_023.py @@ -24,35 +24,6 @@ from hypium.action.host import host from hypium.action.os_hypium.device_logger import AsyncCommand -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_023/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_023/listen_test.json", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - - class LifeCycle_State_023(TestCase): def __init__(self, controllers): @@ -63,32 +34,13 @@ class LifeCycle_State_023(TestCase): ] self.driver = UiExplore(self.driver1) self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() + def setup(self): + self.log.info("lifecycle_state_020 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_023") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): driver = self.driver diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_024.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_024.json index fc00a077..72ec3dc4 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_024.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_024.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_024.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_024.py index 6bfb7238..f8dd30a3 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_024.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_024.py @@ -24,35 +24,6 @@ from hypium.action.host import host from hypium.action.os_hypium.device_logger import AsyncCommand -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_024/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_024/listen_test.json", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - - class LifeCycle_State_024(TestCase): def __init__(self, controllers): @@ -63,32 +34,13 @@ class LifeCycle_State_024(TestCase): ] self.driver = UiExplore(self.driver1) self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() + def setup(self): + self.log.info("lifecycle_state_019 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_024") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): driver = self.driver diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_025.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_025.json index 20c0df83..330c10e5 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_025.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_025.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_025.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_025.py index 0a7419e5..e88ca4ed 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_025.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_025.py @@ -26,35 +26,6 @@ from hypium.action.host import host from hypium.action.os_hypium.device_logger import AsyncCommand -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_025/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_025/listen_test.json", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - - class LifeCycle_State_025(TestCase): def __init__(self, controllers): @@ -65,32 +36,13 @@ class LifeCycle_State_025(TestCase): ] self.driver = UiExplore(self.driver1) self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - # driver.System.reboot() + def setup(self): + self.log.info("lifecycle_state_019 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_025") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): driver = self.driver diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_026.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_026.json index 0a781e3a..0a69b541 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_026.json +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_026.json @@ -13,4 +13,4 @@ ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_026.py b/test/autotest/testcases/level1/lifecycle/lifecycle_state_026.py index 50caf381..d1d7f443 100644 --- a/test/autotest/testcases/level1/lifecycle/lifecycle_state_026.py +++ b/test/autotest/testcases/level1/lifecycle/lifecycle_state_026.py @@ -43,47 +43,6 @@ from hypium.action.os_hypium.device_logger import DeviceLogger from devicetest.core.test_case import TestCase, CheckPoint, get_report_dir from devicetest.utils.file.file_util import get_resource_path -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - -sa_listen_cfg_path = get_resource_path( - "resource/level/lifecycle_state_026/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/lifecycle_state_026/listen_test.json", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_tool_path = get_resource_path( - "resource/SO_RESOURCE/TestTool", - isdir=None) - -sa_samgr_path = get_resource_path( - "resource/level/lifecycle/lifecycle_state_026/samgr.para", - isdir=None) - -sa_samgr_dac_path = get_resource_path( - "resource/level/lifecycle/lifecycle_state_026/samgr.para.dac", - isdir=None) - -sa_para_origin = get_resource_path( - "resource/origin_file/samgr.para", isdir=None) - -sa_para_dac_origin = get_resource_path( - "resource/origin_file/samgr.para.dac", isdir=None) class LifeCycle_State_026(TestCase): @@ -95,38 +54,13 @@ class LifeCycle_State_026(TestCase): ] self.driver = UiExplore(self.driver1) self.sn = self.driver1.device_sn - - def setup(self): - driver = self.driver - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn)) - # host.shell("hdc -t {} target mount".format(self.sn)) - # driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - # host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - # host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn)) - # driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - # host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_tool_path, device_path="/systemlib/bin/") - # host.shell("hdc -t {} shell chmod 755 /system/bin/TestTool".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_samgr_path, device_path="/systemlib/etc/param") - # host.shell("hdc -t {} shell chmod 755 /system/etc/param/samgr.para".format(self.sn)) - - # driver.Storage.push_file(local_path=sa_samgr_dac_path, device_path="/systemlib/etc/param") - # host.shell("hdc -t {} shell chmod 755 /system/etc/param/samgr.para.dac".format(self.sn)) - # driver.System.reboot() + def setup(self): + self.log.info("lifecycle_state_019 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/lifecycle_state_026") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def test_step(self): driver = self.driver diff --git a/test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.json b/test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.json index c66143c4..bea5afb8 100644 --- a/test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.json +++ b/test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.json @@ -13,8 +13,8 @@ "driver": { "type": "DeviceTest", "py_file": [ - "testcases/level1/lifecycle/sub_samgr_sa_load_002.py" + "testcases/level1/lifecycle/networking/sub_samgr_sa_load_002.py" ] }, "kits":[] - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.py b/test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.py index fd28f678..6d77f5e0 100644 --- a/test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.py +++ b/test/autotest/testcases/level1/networking/sub_samgr_sa_load_002.py @@ -24,30 +24,6 @@ from hypium.action.host import host from aw import NetWorking -sa_listen_cfg_path = get_resource_path( - "resource/level/networking/sub_samgr_sa_load_002/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/networking/sub_samgr_sa_load_002/listen_test.json", - isdir=None) - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - class Sub_Samgr_SA_Load_002(TestCase): @@ -60,56 +36,11 @@ class Sub_Samgr_SA_Load_002(TestCase): self.sn1 = self.device2.device_sn def setup(self): - driver1 = self.driver1 - driver1 = self.driver1 - # host.shell()用来在pc端执行shell命令,亦可直接执行bat脚本(bat脚本中是push所需要的测试文件) - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn1)) - host.shell("hdc -t {} target mount".format(self.sn1)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn1)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn1)) - - driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn1) - - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn1)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn1)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn1)) - - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn2)) - host.shell("hdc -t {} target mount".format(self.sn2)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn2)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn2)) - - driver.Storage.push_file(local_path=sa_lib_ability_c_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_audio_ability.z.so".format(self.sn2) - - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn2)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn2)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn2)) - - # # 设备A登录华为账号 - NetWorking.login_account(driver1) - # # 设备b登录华为账号 - NetWorking.login_account(driver2) - time.sleep(3) - #判断组网成功 - NetWorking.determine_newwork(driver1) + self.log.info("lifecycle_state_019 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/networking/sub_samgr_sa_load_002") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def process(self): driver1 = self.driver1 diff --git a/test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.json b/test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.json index 947357d1..db799124 100644 --- a/test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.json +++ b/test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.json @@ -13,7 +13,7 @@ "driver": { "type": "DeviceTest", "py_file": [ - "testcases/level1/lifecycle/sub_samgr_sa_once_001.py" + "testcases/level1/lifecycle/networking/sub_samgr_sa_once_001.py" ] }, "kits":[] diff --git a/test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.py b/test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.py index dda9e322..948a2f85 100644 --- a/test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.py +++ b/test/autotest/testcases/level1/networking/sub_samgr_sa_once_001.py @@ -24,30 +24,6 @@ from hypium.action.host import host from aw import NetWorking -sa_listen_cfg_path = get_resource_path( - "resource/level/networking/sub_samgr_sa_load_002/listen_test.cfg", - isdir=None) - -sa_listen_json_path = get_resource_path( - "resource/level/networking/sub_samgr_sa_load_002/listen_test.json", - isdir=None) - -sa_lib_test_path = get_resource_path( - "resource/SO_RESOURCE/liblisten_test.z.so", - isdir=None) - -sa_lib_ability_c_path = get_resource_path( - "resource/SO_RESOURCE/libtest_audio_ability.z.so", - isdir=None) - -sa_ondemand_path = get_resource_path( - "resource/SO_RESOURCE/ondemand", - isdir=None) - -sa_proxy_path = get_resource_path( - "resource/SO_RESOURCE/libtest_sa_proxy_cache.z.so", - isdir=None) - class Sub_Samgr_SA_Load_002(TestCase): @@ -60,50 +36,11 @@ class Sub_Samgr_SA_Load_002(TestCase): self.sn1 = self.device2.device_sn def setup(self): - driver = self.driver1 - driver.Wifi.disable() - driver.Bluetooth.disable() #避免开始就组网成功 - # host.shell()用来在pc端执行shell命令,亦可直接执行bat脚本(bat脚本中是push所需要的测试文件) - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn1)) - # 推入资源文件进入设备 - host.shell("hdc -t {} target mount".format(self.sn1)) - driver.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn1)) - - driver.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn1)) - - driver.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn1)) - - driver.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn2)) - - driver.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn1)) - - driver2 = self.driver2 - host.shell("hdc -t {} shell kill -9 `pidof listen_test`".format(self.sn2)) - # 推入资源文件进入设备 - host.shell("hdc -t {} target mount".format(self.sn2)) - driver2.Storage.push_file(local_path=sa_lib_test_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/liblisten_test.z.so".format(self.sn2)) - - driver2.Storage.push_file(local_path=sa_listen_cfg_path, device_path="/system/etc/init/") - host.shell("hdc -t {} shell chmod 644 /system/etc/init/listen_test.cfg".format(self.sn2)) - - driver2.Storage.push_file(local_path=sa_listen_json_path, device_path="/system/profile/") - host.shell("hdc -t {} shell chmod 644 /system/profile/listen_test.json".format(self.sn2)) - - driver2.Storage.push_file(local_path=sa_ondemand_path, device_path="/systemlib/bin/") - host.shell("hdc -t {} shell chmod 755 /system/bin/ondemand".format(self.sn2)) - - driver2.Storage.push_file(local_path=sa_proxy_path, device_path="/systemlib/lib/") - host.shell("hdc -t {} shell chmod 644 /system/lib/lib/libtest_sa_proxy_cache.z.so".format(self.sn2)) - - driver.System.reboot() - driver2.System.reboot() - + self.log.info("lifecycle_state_019 start") + need_source = {"cfg": True, "fwk": False, "listen_test": True, "audio_ability": False, "ondemand": True, + "proxy": True, "para": True} + self.source_path = get_source_path(need_source=need_source, casename="level1/lifecycle/networking/sub_samgr_sa_once_001") + push_source(source_path=self.source_path, driver=self.driver, sn=self.sn) def process(self): # 执行步骤 -- Gitee