diff --git a/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.json b/test/autotest/testcases/level1/lifecycle/lifecycle_state_001.json index 64d6d449072d4e7745ce4f7b8becccc774877fdd..ce54c18feda24697772a840f713fed2eda3a771d 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 c944f2b5dd82235138351e7b9ab43f0911cfd9f3..dfd20c587aa7594bf57a92df3b5bfd362dd1b8f8 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 c3436e69fd627ea78b4597bf50aaffd4942846c8..e091b9bcf50ef10e2cffae7e70da64ea8d44c922 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 f232d452d2cb86d2e82affc00946dc2c115ad270..cba11481572ce7ee9fe21482a494e4e269178074 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 8a5d5d03fd13ad5889c4ff5244c89337d9d5f9f7..be874be8ac15fc4d43a7e22709e9c97da98f1a09 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 c54f6c951ee13efdc97350ca67c32d2597c42d66..c2d3c25bbb1e04e7a875f8f895fdf26a209287da 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 eee728d9cfec02f18f045d47975e81e905851071..028aeaef77f73a7ab3a1e15d39493a11f0cb7b72 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 de607dfd2fdcb07af09622ce2a43ce5d22103a99..10d506a13cd78fc1a7dca6e8713f346c65643ad6 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 820d3e241ff427d9f25dcff1b4d51a26e0f6a6c7..95709cb79bcc242e756b4133a5ad02d8959df959 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 eeacd655d643017e816e487df70f311ae583680b..d77a7a2245e31eba29002c88b751ffb322fa6eb2 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 100b3027920982ce187702e69f56a40983938cb4..1efe4ad0c24e73e342a2bf6b940d8009870d49f0 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 0c220736f5e3e1c950a05c57451e323b101c4420..12174c27cc485f0d5e5ab94aea98017451d3acf2 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 9314daf249e1e20f673b4c59db18f706d553bd2b..3088cb3d716aa851969bcde7aa73fa0fcf90dde6 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 73f8cf0b3c9babf2c83362e3c9a26461cb846a96..6fa1060f5329b746426af16d546af3dc56d61cba 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 c5338ddc3be25e532b1bff6f55115f2663b9fdab..4eba45c254e37221534f3a5b677315e08d037506 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 5065b7199b55f006d6fe4296bf7da8de4c3fa48e..3b74c5ac1baaf637b6b92e68f57866ebc4667018 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 95a1978d0fd6cbaa79c97f54b77dfc9d40e4a291..ea41bf9f561a489b0f2206469c26e2ce06a93f47 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 fce5ff724f362d4c7f9764703d14316ea1ee2744..25cb153cead42f196d6f26221053a54ddb9a7ece 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 f9fe11d66bd7049b7b6f7850e8a08adede5eb2f0..a66c5fd9f89a09b62ff12948362ad44ef948d8c4 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 34d53b2b971b0abd20aea7873afa8e498fcfa71e..0db026e8ff760bb62e4338854e95562dc1c42f11 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 6d7c94983497322e2165f0b811df837225196d69..1d071503c402b42da2369e7f21bd4be3c704b630 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 a3425f1e320a16b2244d3b04dd8e1ce823935299..34a92b7af02f6a64d957ed97f6a180c0a5b98383 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 0bd10d109958403482ca1cbece905b411240d38d..45a3070cb2dff3f721e12facd02527e9fa0822fc 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 e590c529ad4a321fcb2c960d0a4a391225c39e47..5c8afb8f085de9f4782baed2997d12f869e221f6 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 82f18e611a2bf4aade2f6dd043ed901b99126924..43f90702a33f73e60fb73c0c7214930362be6d97 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 565d75c5a124fe59b98133de13ec3c5ea6c23c39..b66f9b31897134d795d8001016802e055be887fe 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 9b8cd3cb5f625a2c5c18d4d8ea4ed4e0cbd385d1..0f9c5e60504bafccf3b471c80a850829a32e080c 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 0a6fbf9b920e8231c0101fa087607926c1a4135f..a48346abccc8a7ffc479a63b4426a621ad68ace0 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 e38b132e20e00fcd1669491cf4190221e795ab33..85dc7a71c381282d692530f12fae1ffe54657da8 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 6f311ec00a68f39157d38bcb806209ac1767c11a..ff44809d5c5a5cdde9798ef809e1c2bcd87a6f3d 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 7a158da7b1e262a04ff6c1e3d782fd5b7add037a..fc50597b157e8ea0a2dcf58da66ddf2adf102be6 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 fc00a077713132b64422303d0c5f2128c931810a..72ec3dc4dcc2c5326648f7c60d08b037c7e51d5e 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 6bfb7238986bdff08efb1c9189fa1cc3670df8f2..f8dd30a301e542ce7a5b7d40f0b6df3df465fdb4 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 20c0df83f35c78f70696d705740d314116a8e6c7..330c10e50a621260685355338a94148507e71196 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 0a7419e5e39b09810ed208018b7181a4c1780c1f..e88ca4ed474ad1064d798e8403064a869f8b35b3 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 0a781e3a3e7c51ffcc100cb628a143edfe0e35a6..0a69b541d6bb3123373663b5e74c382f82cc1b45 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 50caf381e802558bd288537dc5e59e627398dc95..d1d7f44316ff3f13db8e5c655e5e9a60f73ae53c 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 c66143c40996e1b4fad1b316d9d0fcc5150bd939..bea5afb8d613c0bc05a343a3df0ec082fc7a21b7 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 fd28f67891131fb739e8be11043e6c45a798816e..6d77f5e0336eb4bed4c75a286efb72ac893a3430 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 947357d19cc33393e108e5259149492b63593173..db79912401f5029abbad7bf93dfc017c054d1279 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 dda9e322525706ff20fb6c583f89ca496fd42e79..948a2f8522851c3e25e1e71fff1c60f6fce4d825 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): # 执行步骤