From de84e4d1b952dfd56c4a11b98709cd9ea9ec8695 Mon Sep 17 00:00:00 2001 From: Pawel Olejniczak Date: Thu, 20 May 2021 15:57:40 +0200 Subject: [PATCH] [CP-83] Update tests for unlocking phone and usb Removed leftovers of old usb security tests implementation. Added tests for unlocking via security endpoint. --- test/firmware_update_test/update.py | 2 +- test/harness | 2 +- test/make_a_call.py | 2 +- test/phone_modem_clear_sms_queue.py | 1 - test/phone_off.py | 1 - test/phone_sim_check.py | 2 - test/phone_sim_detection_on.py | 1 - test/phone_unlock.py | 3 +- test/pytest/conftest.py | 13 ++--- .../test_basic_control_dev_perspective.py | 4 +- .../test_pairing_dev_perspective.py | 4 +- .../test_pairing_hmi_perspective.py | 1 - test/pytest/service-desktop/test_backup.py | 2 +- .../service-desktop/test_battery_file.py | 2 +- test/pytest/service-desktop/test_calendar.py | 2 +- .../service-desktop/test_calendar_events.py | 2 +- test/pytest/service-desktop/test_calllog.py | 4 +- test/pytest/service-desktop/test_contacts.py | 4 +- .../service-desktop/test_device_info.py | 2 +- .../service-desktop/test_factory_reset.py | 2 +- test/pytest/service-desktop/test_messages.py | 16 +++--- test/pytest/service-desktop/test_restore.py | 2 +- test/pytest/service-desktop/test_security.py | 55 ++++++++++++++++--- test/pytest/service-desktop/test_templates.py | 8 +-- test/pytest/service-desktop/test_threads.py | 2 +- test/pytest/service-desktop/test_update.py | 2 +- test/pytest/test_call.py | 1 - test/pytest/test_call_back.py | 1 - test/pytest/test_cellular_sleep.py | 5 +- test/pytest/test_cellular_start.py | 4 -- test/pytest/test_send_message.py | 1 - test/search_sms.py | 2 +- test/set_tethering.py | 1 - test/version_check.py | 2 +- 34 files changed, 91 insertions(+), 67 deletions(-) diff --git a/test/firmware_update_test/update.py b/test/firmware_update_test/update.py index f3bfabc876179d78b21ff5917defe06d71a6f691..94379119b5d3dc932076e0cb121f8b3787a86508 100755 --- a/test/firmware_update_test/update.py +++ b/test/firmware_update_test/update.py @@ -80,7 +80,7 @@ def update(harness, update_filepath: str): def get_update_list(harness): - harness.unlock_usb() + harness.unlock_phone() ret = harness.endpoint_request("deviceInfo", "get", {}) device_info = ret["body"] update_history = device_info["updateHistory"] diff --git a/test/harness b/test/harness index 5e89897197e210f9fec418b0765d6234275d4069..19179cdd311159ada5661f24247b2eaca4b6c4fc 160000 --- a/test/harness +++ b/test/harness @@ -1 +1 @@ -Subproject commit 5e89897197e210f9fec418b0765d6234275d4069 +Subproject commit 19179cdd311159ada5661f24247b2eaca4b6c4fc diff --git a/test/make_a_call.py b/test/make_a_call.py index 687faeaf9ec4aaf82b62c9f04ff15de93a197a8d..d8d91d7492ba363015e94782685953d348d27850 100644 --- a/test/make_a_call.py +++ b/test/make_a_call.py @@ -46,7 +46,7 @@ def main(): port_name = sys.argv[1] harness = Harness(sys.argv[1]) - harness. unlock_usb() + harness.unlock_phone() number = str(sys.argv[2]) duration = int(sys.argv[3]) count_before = get_calllog_count(harness) diff --git a/test/phone_modem_clear_sms_queue.py b/test/phone_modem_clear_sms_queue.py index e999c7810f3359d8aab9e195ffcb05a380d79e4e..b3c5bba21067fe222970181691f0a9949e74fe89 100644 --- a/test/phone_modem_clear_sms_queue.py +++ b/test/phone_modem_clear_sms_queue.py @@ -8,7 +8,6 @@ import sys harness = Harness(sys.argv[1]) -harness.unlock_usb() harness.connection.send_at("at+cmgl=\"all\"", 10000) harness.connection.send_at("at+cmgd=1,4", 10000) diff --git a/test/phone_off.py b/test/phone_off.py index 3bff157208868448f3318459fbff8217a2699dbc..881ca73dcb2fe5b90320b67e8e8278557ecbca88 100644 --- a/test/phone_off.py +++ b/test/phone_off.py @@ -28,7 +28,6 @@ def main(): port_name = sys.argv[1] harness = Harness(port_name) - harness.unlock_usb() harness.unlock_phone() harness.turn_phone_off() diff --git a/test/phone_sim_check.py b/test/phone_sim_check.py index b707889d230b62b2d2a8978f7d6b052d9706ff13..12e4c290c5813006cf8244487f40b50a15f68cc7 100644 --- a/test/phone_sim_check.py +++ b/test/phone_sim_check.py @@ -7,8 +7,6 @@ from harness.harness import Harness import sys harness = Harness(sys.argv[1]) -harness.unlock_usb() - results = harness.connection.send_at("AT+CPIN?", 10000) for result in results: diff --git a/test/phone_sim_detection_on.py b/test/phone_sim_detection_on.py index 8ddd4ae8d91e96863d61226871e997e838aee9f5..1af808548c0c17c8a00abde2685692fde512da5d 100644 --- a/test/phone_sim_detection_on.py +++ b/test/phone_sim_detection_on.py @@ -6,7 +6,6 @@ from harness.harness import Harness import sys harness = Harness(sys.argv[1]) -harness.unlock_usb() harness.connection.send_at("at+qsimdet=1,0", 10000) harness.connection.send_at("AT+QSIMSTAT=1", 10000) diff --git a/test/phone_unlock.py b/test/phone_unlock.py index 18dab89456d79261833ea5d61b121d058ff57ad4..1e9f01da6b4dcd25d840eb29f6b9a17fa2d941b8 100644 --- a/test/phone_unlock.py +++ b/test/phone_unlock.py @@ -6,7 +6,8 @@ from harness.harness import Harness harness = Harness.from_detect() -harness. unlock_usb() + + @harness.with_phone_unlocked def done(connection): pass diff --git a/test/pytest/conftest.py b/test/pytest/conftest.py index 684a6edb90a32a426c8f9b3d7cd2edfac89b8c5f..31cae82464458f7802925bdb63f9aceb3a50e135 100644 --- a/test/pytest/conftest.py +++ b/test/pytest/conftest.py @@ -131,21 +131,18 @@ def harnesses(): @pytest.fixture(scope='session') def phone_unlocked(harness): harness.unlock_phone() - assert harness.is_phone_unlocked + assert not harness.is_phone_locked() @pytest.fixture(scope='session') -def usb_unlocked(harness): - harness.unlock_usb() - -@pytest.fixture(scope='session') -def usb_locked(harness): - harness.lock_usb() +def phone_locked(harness): + harness.lock_phone() + assert harness.is_phone_locked() @pytest.fixture(scope='session') def phones_unlocked(harnesses): for harness in harnesses: harness.unlock_phone() - assert harness.is_phone_unlocked + assert not harness.is_phone_locked() @pytest.fixture(scope='session') diff --git a/test/pytest/service-bluetooth/test_basic_control_dev_perspective.py b/test/pytest/service-bluetooth/test_basic_control_dev_perspective.py index 6f80a7d881332efcd943ededd4de3805d82a1167..3bb98e11ebd73cac7e0aee6af1a64eaaca463122 100644 --- a/test/pytest/service-bluetooth/test_basic_control_dev_perspective.py +++ b/test/pytest/service-bluetooth/test_basic_control_dev_perspective.py @@ -10,7 +10,7 @@ from bt_utils import * @pytest.mark.rt1051 @pytest.mark.usefixtures("bt_state_off") -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_bt_turning_on_off(harness): state = bt_get_state(harness) assert state["power"] == "off" @@ -30,7 +30,7 @@ def test_bt_turning_on_off(harness): @pytest.mark.rt1051 @pytest.mark.usefixtures("bt_state_on") -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_bt_visibility_on_off(harness): state = bt_get_state(harness) assert state["power"] == "on" diff --git a/test/pytest/service-bluetooth/test_pairing_dev_perspective.py b/test/pytest/service-bluetooth/test_pairing_dev_perspective.py index a2730e4bc6d5371f6b076fb513758be2948cd1f8..89af10363643aacdf21d9f9ab92411aa57f9a5f2 100644 --- a/test/pytest/service-bluetooth/test_pairing_dev_perspective.py +++ b/test/pytest/service-bluetooth/test_pairing_dev_perspective.py @@ -9,7 +9,7 @@ from bt_utils import * @pytest.mark.rt1051 @pytest.mark.usefixtures("bt_state_on") -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") @pytest.mark.skipif("not config.getvalue('--bt_device')", reason='--bt_device was not specified') def test_bt_pairing_dev(harness, bt_device): time.sleep(1) @@ -47,7 +47,7 @@ def test_bt_pairing_dev(harness, bt_device): @pytest.mark.rt1051 @pytest.mark.usefixtures("bt_state_on") -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") @pytest.mark.skipif("not config.getvalue('--bt_device')", reason='--bt_device was not specified') def test_bt_connection_dev(harness, bt_device): time.sleep(1) diff --git a/test/pytest/service-bluetooth/test_pairing_hmi_perspective.py b/test/pytest/service-bluetooth/test_pairing_hmi_perspective.py index b1909b16a986d5965c492e29f1f092336a9c5987..698282c465446336db3bddcf6e550097754582e0 100644 --- a/test/pytest/service-bluetooth/test_pairing_hmi_perspective.py +++ b/test/pytest/service-bluetooth/test_pairing_hmi_perspective.py @@ -14,7 +14,6 @@ from bt_fixtures import * @pytest.mark.usefixtures("bt_main_window") @pytest.mark.usefixtures("phone_in_desktop") @pytest.mark.usefixtures("phone_unlocked") -@pytest.mark.usefixtures("usb_unlocked") @pytest.mark.skipif("not config.getvalue('--bt_device')", reason='--bt_device was not specified') def test_bt_pairing_hmi(harness, bt_device): if not bt_device: diff --git a/test/pytest/service-desktop/test_backup.py b/test/pytest/service-desktop/test_backup.py index 72c7e8129612470cb741bf3df3de759024396874..09ae0aab1db516dc713bdd4bdb5438c1ee701660 100644 --- a/test/pytest/service-desktop/test_backup.py +++ b/test/pytest/service-desktop/test_backup.py @@ -9,7 +9,7 @@ from harness.interface.defs import status @pytest.mark.service_desktop_test @pytest.mark.rt1051 -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") @pytest.mark.backup def test_backup(harness): body = { "request": True } diff --git a/test/pytest/service-desktop/test_battery_file.py b/test/pytest/service-desktop/test_battery_file.py index f48beb95b6764e913cfd05fd97639195c1fa2585..2108ccfa73788286d0e6ccd2e97fee2e3c02a415 100644 --- a/test/pytest/service-desktop/test_battery_file.py +++ b/test/pytest/service-desktop/test_battery_file.py @@ -6,7 +6,7 @@ from harness.interface.defs import status @pytest.mark.rt1051 @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_battery_file(harness): body = {"command" : "checkFile" , "fileName" : "/sys/user/batteryFuelGaugeConfig.cfg"} ret = harness.endpoint_request("filesystemUpload", "post", body) diff --git a/test/pytest/service-desktop/test_calendar.py b/test/pytest/service-desktop/test_calendar.py index a841c5e24b4d398ef67ce82384f0c51291c7d0d0..7182cec0b7dfac8bb68c63fda0d054d183120d36 100644 --- a/test/pytest/service-desktop/test_calendar.py +++ b/test/pytest/service-desktop/test_calendar.py @@ -7,7 +7,7 @@ import copy @pytest.mark.rt1051 @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_calendar(harness): # add events add_body = { diff --git a/test/pytest/service-desktop/test_calendar_events.py b/test/pytest/service-desktop/test_calendar_events.py index ca5e2dc06e5d9eec10cbe6727801167c73e4067b..c2fad0ce5e723907b1c009991e933dad8c2a554b 100755 --- a/test/pytest/service-desktop/test_calendar_events.py +++ b/test/pytest/service-desktop/test_calendar_events.py @@ -6,7 +6,7 @@ import copy import time @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_calendar(harness): # add events add_body = { diff --git a/test/pytest/service-desktop/test_calllog.py b/test/pytest/service-desktop/test_calllog.py index 5e3ce845e7037daa94584223d7005e10132f76b6..823b3411d9f6c1d345c018d09e956d172de5b79d 100644 --- a/test/pytest/service-desktop/test_calllog.py +++ b/test/pytest/service-desktop/test_calllog.py @@ -1,11 +1,11 @@ -# Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. # For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md import pytest from harness.interface.defs import status @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_calllog(harness): # checking call log count body = {"count": True} diff --git a/test/pytest/service-desktop/test_contacts.py b/test/pytest/service-desktop/test_contacts.py index daa6de1afc4443097cab579347d0e2a21a4e9241..240bc83d097e600a9a1679184ace39c0587cc5ea 100644 --- a/test/pytest/service-desktop/test_contacts.py +++ b/test/pytest/service-desktop/test_contacts.py @@ -1,11 +1,11 @@ -# Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. # For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md import pytest from harness.interface.defs import status @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_contacts(harness): # getting the contacts count body = {"count": True} diff --git a/test/pytest/service-desktop/test_device_info.py b/test/pytest/service-desktop/test_device_info.py index bafdb10d27819f1f82ceee04c7769924b06991c4..7b8f55c64cdfb722116e9ea5c82e40423a81d3c1 100644 --- a/test/pytest/service-desktop/test_device_info.py +++ b/test/pytest/service-desktop/test_device_info.py @@ -5,7 +5,7 @@ from harness.interface.defs import status @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_device_info(harness): body = {} ret = harness.endpoint_request("deviceInfo", "get", body) diff --git a/test/pytest/service-desktop/test_factory_reset.py b/test/pytest/service-desktop/test_factory_reset.py index a66afe15b3be2e436311609c652f31b562ce1f23..30af5809ce7573861906763c7307c2e47f87bbe5 100644 --- a/test/pytest/service-desktop/test_factory_reset.py +++ b/test/pytest/service-desktop/test_factory_reset.py @@ -6,7 +6,7 @@ from harness.interface.defs import status @pytest.mark.service_desktop_test @pytest.mark.rt1051 -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_factory_reset(harness): body = {"factoryRequest": True} ret = harness.endpoint_request("factory", "post", body) diff --git a/test/pytest/service-desktop/test_messages.py b/test/pytest/service-desktop/test_messages.py index faa7f7c39a95bc0eb8f28968272dac82502c2555..8053ca6d4b6f608bdfd4af94d15361e25938caa4 100644 --- a/test/pytest/service-desktop/test_messages.py +++ b/test/pytest/service-desktop/test_messages.py @@ -8,7 +8,7 @@ MESSAGES_PAGE_SIZE = 4 @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_get_messages_without_pagination(harness): limit = MESSAGES_PAGE_SIZE - 1 get_body = {"category": "message", "limit": limit, "offset": 0} @@ -30,7 +30,7 @@ def test_get_messages_without_pagination(harness): @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_get_messages_with_pagination(harness): limit = MESSAGES_PAGE_SIZE + 1 body = {"category": "message", "limit": limit, "offset": 0} @@ -43,7 +43,7 @@ def test_get_messages_with_pagination(harness): @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_get_all_messages(harness): # get messages count body = {"category": "message", "count": True} @@ -85,7 +85,7 @@ def test_get_all_messages(harness): @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_get_messages_by_thread_id_without_pagination(harness): thread_id = 1 limit = MESSAGES_PAGE_SIZE - 1 @@ -101,7 +101,7 @@ def test_get_messages_by_thread_id_without_pagination(harness): @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_get_messages_by_thread_id_with_pagination(harness): thread_id = 1 limit = MESSAGES_PAGE_SIZE + 1 @@ -117,7 +117,7 @@ def test_get_messages_by_thread_id_with_pagination(harness): @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_get_all_messages_by_thread_id(harness): thread_id = 1 # get messages count @@ -160,7 +160,7 @@ def test_get_all_messages_by_thread_id(harness): @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_remove_message(harness): # get messages count body = {"category": "message", "count": True} @@ -194,7 +194,7 @@ def test_remove_message(harness): @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_get_message_by_id(harness): message_id = 1 get_body = {"category": "message", "messageID": message_id} diff --git a/test/pytest/service-desktop/test_restore.py b/test/pytest/service-desktop/test_restore.py index eb88cf73f0d3e18e0164b46322b594d5be44567c..9bb9469a47908c72b7125c8895809075efa54bfc 100644 --- a/test/pytest/service-desktop/test_restore.py +++ b/test/pytest/service-desktop/test_restore.py @@ -8,7 +8,7 @@ from harness import log @pytest.mark.service_desktop_test @pytest.mark.rt1051 -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") @pytest.mark.restore def test_restore(harness): # this requests the list of available files diff --git a/test/pytest/service-desktop/test_security.py b/test/pytest/service-desktop/test_security.py index 168b2b9e2526fa3626449c485af473326363f3d5..d85363527caa40339cb5577ab9ac3a40ead3bfdb 100644 --- a/test/pytest/service-desktop/test_security.py +++ b/test/pytest/service-desktop/test_security.py @@ -6,8 +6,8 @@ from harness.interface.defs import status @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") -def test_security_usb_unlocked(harness): +@pytest.mark.usefixtures("phone_unlocked") +def test_security_phone_unlocked(harness): body = {} ret = harness.endpoint_request("deviceInfo", "get", body) @@ -15,8 +15,8 @@ def test_security_usb_unlocked(harness): @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_locked") -def test_security_usb_locked(harness): +@pytest.mark.usefixtures("phone_locked") +def test_security_phone_locked_with_code(harness): body = {} ret = harness.endpoint_request("usbSecurity", "get", body) @@ -24,8 +24,8 @@ def test_security_usb_locked(harness): @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_locked") -def test_all_other_endpoints_usb_locked(harness): +@pytest.mark.usefixtures("phone_locked") +def test_all_other_endpoints_phone_locked_with_code(harness): body = {} endpoints_list = ["deviceInfo", "update", @@ -55,4 +55,45 @@ def test_all_other_endpoints_usb_locked(harness): ret = harness.endpoint_request("developerMode", "get", body) assert ret["status"] == status["OK"] - harness.unlock_usb() + +@pytest.mark.service_desktop_test +@pytest.mark.usefixtures("phone_unlocked") +def test_security_phone_locked_without_code(harness): + body = {"phoneLockCodeEnabled": False} + ret = harness.endpoint_request("developerMode", "put", body) + assert ret["status"] == status["OK"] + + harness.lock_phone() + body = {} + ret = harness.endpoint_request("usbSecurity", "get", body) + assert ret["status"] == status["OK"] + + body = {"phoneLockCodeEnabled": True} + ret = harness.endpoint_request("developerMode", "put", body) + assert ret["status"] == status["OK"] + + harness.lock_phone() + body = {} + ret = harness.endpoint_request("usbSecurity", "get", body) + assert ret["status"] == status["Forbidden"] + + +@pytest.mark.service_desktop_test +@pytest.mark.usefixtures("phone_unlocked") +def test_security_unlock_phone(harness): + + body = {"phoneLockCode": "1111"} + ret = harness.endpoint_request("usbSecurity", "put", body) + assert ret["status"] == status["Forbidden"] + + body = {"phoneLockCode": "1"} + ret = harness.endpoint_request("usbSecurity", "put", body) + assert ret["status"] == status["BadRequest"] + + body = {"phoneLockCode": "3333"} + ret = harness.endpoint_request("usbSecurity", "put", body) + assert ret["status"] == status["OK"] + + body = {} + ret = harness.endpoint_request("deviceInfo", "get", body) + assert ret["status"] == status["OK"] diff --git a/test/pytest/service-desktop/test_templates.py b/test/pytest/service-desktop/test_templates.py index fd2dd5e3cb90ed7805cdee83d080ef08c0618b17..e555ec4b2a4754fbe8b72a957258cfbad0a75ca4 100644 --- a/test/pytest/service-desktop/test_templates.py +++ b/test/pytest/service-desktop/test_templates.py @@ -145,28 +145,28 @@ class TemplatesTester: @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_get_template_by_id(harness): templates_tester = TemplatesTester(harness) templates_tester.test_getting_template_by_id() @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_get_templates_without_pagination(harness): templates_tester = TemplatesTester(harness) templates_tester.test_getting_templates_without_pagination() @pytest.mark.rt1051 @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_change_template(harness): templates_tester = TemplatesTester(harness) templates_tester.test_changing_template_body() @pytest.mark.rt1051 @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_get_templates_with_pagination(harness): templates_tester = TemplatesTester(harness) templates_tester.test_getting_templates_with_pagination() diff --git a/test/pytest/service-desktop/test_threads.py b/test/pytest/service-desktop/test_threads.py index 126589c079117e5a9097d6d5ae4a3a258c4b008e..1bdf0471ff79bb6d4498d5625af978a8a09b25d2 100644 --- a/test/pytest/service-desktop/test_threads.py +++ b/test/pytest/service-desktop/test_threads.py @@ -5,7 +5,7 @@ from harness.interface.defs import status @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_threads(harness): # getting all threads body = {"category": "thread"} diff --git a/test/pytest/service-desktop/test_update.py b/test/pytest/service-desktop/test_update.py index 86ff5031fa5fca998af705966bed69859ad70827..92fc6307b89e72e51aba3652a950b5131e7804d7 100644 --- a/test/pytest/service-desktop/test_update.py +++ b/test/pytest/service-desktop/test_update.py @@ -5,7 +5,7 @@ from harness.interface.defs import status @pytest.mark.service_desktop_test -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") @pytest.mark.rt1051 def test_update(harness): body = {} diff --git a/test/pytest/test_call.py b/test/pytest/test_call.py index a731fc71be716f4decd1b6839ed7d7c1aec4e678..dab85339a697072d3c62aae32102502dd04ec4bd 100644 --- a/test/pytest/test_call.py +++ b/test/pytest/test_call.py @@ -8,7 +8,6 @@ from module_apps.call_utils import get_calllog_count, select_call_button @pytest.mark.rt1051 @pytest.mark.usefixtures("phone_ends_test_in_desktop") @pytest.mark.usefixtures("phone_unlocked") -@pytest.mark.usefixtures("usb_unlocked") def test_call(harness, phone_number, call_duration): count_before = get_calllog_count(harness) # enter number diff --git a/test/pytest/test_call_back.py b/test/pytest/test_call_back.py index 7dc3ad473cab0187ade201cc936c4db38b5f68d5..ebd102d26ccd37df3ae30e8c678b8d3ca8b27a05 100644 --- a/test/pytest/test_call_back.py +++ b/test/pytest/test_call_back.py @@ -10,7 +10,6 @@ from module_apps.call_utils import get_calllog_count, select_call_button @pytest.mark.usefixtures("phone_ends_test_in_desktop") @pytest.mark.usefixtures("phone_in_desktop") @pytest.mark.usefixtures("phone_unlocked") -@pytest.mark.usefixtures("usb_unlocked") def test_call(harness, call_duration): count_before = get_calllog_count(harness) diff --git a/test/pytest/test_cellular_sleep.py b/test/pytest/test_cellular_sleep.py index 528a514639b94bbb387c1af21b04acb569c66e27..a9015ca6e63f945f2d0ffcfa3e1d50b9c54feab9 100644 --- a/test/pytest/test_cellular_sleep.py +++ b/test/pytest/test_cellular_sleep.py @@ -26,8 +26,7 @@ def wait_for_cellular_sleep(harness, max_attempts): @pytest.mark.rt1051 -@pytest.mark.usefixtures("usb_unlocked") - +@pytest.mark.usefixtures("phone_unlocked") def test_call_during_cellular_sleep_mode(harness, phone_number, call_duration, max_attempts = 10): cellular_sleep_mode = wait_for_cellular_sleep(harness, max_attempts) if (cellular_sleep_mode == False): @@ -43,7 +42,7 @@ def test_call_during_cellular_sleep_mode(harness, phone_number, call_duration, m assert ret["body"]["cellularSleepMode"] == False @pytest.mark.rt1051 -@pytest.mark.usefixtures("usb_unlocked") +@pytest.mark.usefixtures("phone_unlocked") def test_sms_during_cellular_sleep_mode(harness, phone_number, sms_text, max_attempts = 10): cellular_sleep_mode = wait_for_cellular_sleep(harness, max_attempts) if (cellular_sleep_mode == False): diff --git a/test/pytest/test_cellular_start.py b/test/pytest/test_cellular_start.py index f9ba0d2376e7ecd3ea270a12dd8414cb527b1c13..9f14e04a2feea9cdb1b5cdf5af10e4684b7a0994 100644 --- a/test/pytest/test_cellular_start.py +++ b/test/pytest/test_cellular_start.py @@ -42,8 +42,6 @@ def wait_for_cellular_state(harness, state, max_attempts = 10): @pytest.mark.rt1051 @pytest.mark.usefixtures("phone_unlocked") -@pytest.mark.usefixtures("usb_unlocked") - def test_cellular_cold_start(harness, phone_number, sms_text): ret = request_cellular_state_info(harness) assert ret["status"] == status["OK"] @@ -72,8 +70,6 @@ def test_cellular_cold_start(harness, phone_number, sms_text): @pytest.mark.rt1051 @pytest.mark.usefixtures("phone_unlocked") -@pytest.mark.usefixtures("usb_unlocked") - def test_cellular_hot_start(harness, phone_number, sms_text): time.sleep(2) request_cellular_power_state_change(harness, cellular_states["HotStart"]) diff --git a/test/pytest/test_send_message.py b/test/pytest/test_send_message.py index 0f721c86171b0f2d16746556b5e665b3669ac057..5f3845cd8ba3275a6356527e9764675aaae83c62 100644 --- a/test/pytest/test_send_message.py +++ b/test/pytest/test_send_message.py @@ -174,7 +174,6 @@ def remove_added_messages(harness, diff_messages): @pytest.mark.rt1051 @pytest.mark.usefixtures("phone_unlocked") @pytest.mark.usefixtures("phone_in_desktop") -@pytest.mark.usefixtures("usb_unlocked") def test_send_message(harness, phone_number, sms_text): old_messages = get_message_by_text(harness, sms_text, str(phone_number)) diff --git a/test/search_sms.py b/test/search_sms.py index b8df8f862911a93c5ec14f9646c3e0b7a43be819..8ecd2ff14b4f8411c7e9261cfecb14ac2a37af4c 100644 --- a/test/search_sms.py +++ b/test/search_sms.py @@ -37,7 +37,7 @@ def main(): port_name = sys.argv[1] harness = Harness(port_name) - harness. unlock_usb() + harness.unlock_phone() message = str(sys.argv[2]) phone_number = str(sys.argv[3]) diff --git a/test/set_tethering.py b/test/set_tethering.py index 10663467ba2be6ab1af39332c250a342c2765177..bb63ab93716f19606c1f187fc8d298dbacb846c1 100644 --- a/test/set_tethering.py +++ b/test/set_tethering.py @@ -26,7 +26,6 @@ def main(): port_name = sys.argv[1] harness = Harness(port_name) - harness. unlock_usb() state = int(sys.argv[2]) harness.unlock_phone() diff --git a/test/version_check.py b/test/version_check.py index 0805b8582713a518e0df3d45f41cedba50e2e59c..7e976ad673968ceffa5a61689d06f685c7af96ff 100644 --- a/test/version_check.py +++ b/test/version_check.py @@ -50,7 +50,7 @@ def main(): exit() harness = Harness(port_name) - harness.unlock_usb() + harness.unlock_phone() [rev, branch, tag] = get_version(harness) if args.git_tag != tag or args.git_branch != branch or args.git_revision != rev: