~aleteoryx/muditaos

6fdcdbd2d042376dd8f289c39fe3e5fa38bfc072 — Pawel.Paprocki 5 years ago 4c30e3c
[EGD-6232] Fix Harness does not unlock endpoint

USB unlocked in tests
Adjustment of tests to the new EP API
M test/make_a_call.py => test/make_a_call.py +2 -1
@@ 1,5 1,5 @@
#!/usr/bin/env python
# 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 sys


@@ 46,6 46,7 @@ def main():
        port_name = sys.argv[1]

    harness = Harness(sys.argv[1])
    harness. unlock_usb()
    number = str(sys.argv[2])
    duration = int(sys.argv[3])
    count_before = get_calllog_count(harness)

M test/phone_modem_clear_sms_queue.py => test/phone_modem_clear_sms_queue.py +12 -7
@@ 1,13 1,18 @@
#!/usr/bin/env python
# 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

from harness.uart import connection

print(connection.AT("at+cmgl=\"all\""))
from harness.harness import Harness
import sys

print(connection.AT("at+cmgd=1,4"))
print(connection.AT("at+cmgd=0,4"))
print(connection.AT("at+cmgd=2,4"))
print(connection.AT("at+cmgl=\"all\""))

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)
harness.connection.send_at("at+cmgd=0,4", 10000)
harness.connection.send_at("at+cmgd=2,4", 10000)
harness.connection.send_at("at+cmgl=\"all\"", 10000)


M test/phone_off.py => test/phone_off.py +2 -1
@@ 1,7 1,7 @@
# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

# 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 sys


@@ 28,6 28,7 @@ def main():
        port_name = sys.argv[1]

    harness = Harness(port_name)
    harness.unlock_usb()
    harness.unlock_phone()
    harness.turn_phone_off()


M test/phone_sim_check.py => test/phone_sim_check.py +9 -3
@@ 1,9 1,15 @@
#!/usr/bin/env python
# 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

from harness.uart import connection, log

results = connection.send_at("AT+CPIN?", 10000)
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:
    print(result)

M test/phone_sim_detection_on.py => test/phone_sim_detection_on.py +9 -5
@@ 1,9 1,13 @@
#!/usr/bin/env python
# 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

from harness.uart import connection
from harness.harness import Harness
import sys

connection.gsm("at+qsimdet=1,0", 10)
connection.gsm("AT+QSIMSTAT=1", 10)
connection.gsm("at&w", 10)
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)
harness.connection.send_at("at&w", 10000)

M test/phone_unlock.py => test/phone_unlock.py +2 -1
@@ 1,11 1,12 @@
#!/usr/bin/env python
# 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

# unlock Desktop
from harness.harness import Harness

harness = Harness.from_detect()
harness. unlock_usb()
@harness.with_phone_unlocked
def done(connection):
    pass

M test/search_sms.py => test/search_sms.py +2 -1
@@ 1,5 1,5 @@
#!/usr/bin/env python
# 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 sys


@@ 37,6 37,7 @@ def main():
        port_name = sys.argv[1]

    harness = Harness(port_name)
    harness. unlock_usb()
    message = str(sys.argv[2])
    phone_number = str(sys.argv[3])


M test/set_tethering.py => test/set_tethering.py +1 -0
@@ 26,6 26,7 @@ def main():
        port_name = sys.argv[1]

    harness = Harness(port_name)
    harness. unlock_usb()
    state = int(sys.argv[2])

    harness.unlock_phone()

M test/version_check.py => test/version_check.py +3 -2
@@ 1,5 1,5 @@
#!/usr/bin/env python
# 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 sys


@@ 17,7 17,7 @@ def get_device_info(harness):

def get_version(harness):
    device_info = get_device_info(harness)
    return [device_info["gitRevision"], device_info["gitBranch"], device_info["gitTag"]]
    return [device_info["body"]["gitRevision"], device_info["body"]["gitBranch"], device_info["body"]["gitTag"]]


def main():


@@ 50,6 50,7 @@ def main():
        exit()

    harness = Harness(port_name)
    harness.unlock_usb()
    [rev, branch, tag] = get_version(harness)

    if args.git_tag != tag or args.git_branch != branch or args.git_revision != rev: