~aleteoryx/muditaos

ref: 4bf9cb7ace7a74a7dadf011338b18b59fea8fbe4 muditaos/test/pytest/service-desktop/test_update.py -rw-r--r-- 814 bytes
4bf9cb7a — Tomasz Sobkowiak [EGD-6259] Turn off usb security 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Copyright (c) 2017-2020, 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.rt1051
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.rt1051
def test_update(harness):
    body = {}
    ret = harness.endpoint_request("update", "get", body)
    assert ret["status"] == status["OK"]

    file_list = ret["body"]["updateFileList"]

    if len(file_list) == 0:
        pytest.skip("No update files")

    for file in file_list:
        assert file["size"] != 0

    body = {"filename": file_list[0]["name"]}
    ret = harness.endpoint_request("update", "post", body)
    assert ret["status"] == status["OK"]
    assert ret["body"]["updateReady"] is True