~aleteoryx/muditaos

6c32205e1be369cbadf752c77eff68d1a2f963e1 — Marek Niepieklo 4 years ago cb93d58
[CP-371] Updater miscelanous developer mode and logs changes

This reverts commit cb93d58d85fc9bc0e136ff7fb6fc58e092837159.
M module-os/board/linux/portmacro.h => module-os/board/linux/portmacro.h +4 -6
@@ 58,7 58,7 @@ extern "C" {
#endif

#include <unistd.h>
#include <stdint.h>
#include <stdint.h>    

/*-----------------------------------------------------------
 * Port specific definitions.


@@ 149,7 149,7 @@ extern void vPortExitCritical( void );

#if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
#error We are not supporting configUSE_PORT_OPTIMISED_TASK_SELECTION in the Linux Simulator.
#endif
#endif 


/* Task function macros as described on the FreeRTOS.org WEB site. */


@@ 170,9 170,9 @@ extern void vPortAddTaskHandle( void *pxTaskHandle );
#define SIG_SUSPEND					SIGUSR1
#define SIG_RESUME					SIGUSR2

/* Enable the following hash defines to make use of the real-time tick where time progresses at real-time.*/
/* Enable the following hash defines to make use of the real-time tick where time progresses at real-time.*/ 
#define SIG_TICK					SIGALRM
#define TIMER_TYPE					ITIMER_REAL
#define TIMER_TYPE					ITIMER_REAL 
/* Enable the following hash defines to make use of the process tick where time progresses only when the process is executing.
#define SIG_TICK					SIGVTALRM
#define TIMER_TYPE					ITIMER_VIRTUAL */


@@ 180,8 180,6 @@ extern void vPortAddTaskHandle( void *pxTaskHandle );
#define SIG_TICK					SIGPROF
#define TIMER_TYPE					ITIMER_PROF */

#define xPortIsInsideInterrupt()			isIRQ()

#ifdef __cplusplus
}
#endif

M module-services/service-desktop/CMakeLists.txt => module-services/service-desktop/CMakeLists.txt +0 -2
@@ 5,7 5,6 @@ option(ENABLE_DEVELOPER_MODE_ENDPOINT "Enable developer mode endpoint in service

set(SOURCES
    endpoints/BaseHelper.cpp
    endpoints/Context.cpp
    endpoints/backup/BackupEndpoint.cpp
    endpoints/backup/BackupRestore.cpp
    endpoints/bluetooth/BluetoothEndpoint.cpp


@@ 20,7 19,6 @@ set(SOURCES
    endpoints/developerMode/DeveloperModeHelper.cpp
    endpoints/developerMode/Mode/UI_Helper.cpp
    endpoints/developerMode/Mode/UpdateHelper.cpp
    endpoints/developerMode/Mode/LogHelper.cpp
    endpoints/developerMode/event/DomRequest.cpp
    endpoints/developerMode/event/ATRequest.cpp
    endpoints/deviceInfo/DeviceInfoEndpoint.cpp

M module-services/service-desktop/endpoints/BaseHelper.hpp => module-services/service-desktop/endpoints/BaseHelper.hpp +13 -21
@@ 5,7 5,6 @@

#include <parser/HttpEnums.hpp>
#include <endpoints/ResponseContext.hpp>
#include <optional>

namespace sys
{


@@ 36,24 35,6 @@ namespace parserFSM
      public:
        using ProcessResult = std::pair<sent, std::optional<endpoint::ResponseContext>>;

        explicit BaseHelper(const std::string &name, sys::Service *p) : owner(p), p_name(name)
        {}

        /// generall processing function
        ///
        /// we should define processing functions, not copy switch cases
        /// as we are super ambiguous how we should really handle responses
        /// here we can either:
        /// return true - to mark that we responded on this request
        /// return false - and optionally respond that we didn't handle the request
        /// pre and post processing is available on pre/post process method override
        [[nodiscard]] auto process(http::Method method, Context &context) -> ProcessResult;

        [[nodiscard]] auto name() const -> const std::string &
        {
            return p_name;
        }

      protected:
        sys::Service *owner = nullptr;
        /// by default - result = not sent


@@ 69,7 50,18 @@ namespace parserFSM
        /// post processing action - in case we want to do something after processing request
        virtual void postProcess(http::Method method, Context &context){};

      private:
        std::string p_name;
      public:
        explicit BaseHelper(sys::Service *p) : owner(p)
        {}

        /// generall processing function
        ///
        /// we should define processing functions, not copy switch cases
        /// as we are super ambiguous how we should really handle responses
        /// here we can either:
        /// return true - to mark that we responded on this request
        /// return fale - and optionally respond that we didn't handle the request
        /// pre and post processing is available on pre/post process method override
        [[nodiscard]] auto process(http::Method method, Context &context) -> ProcessResult;
    };
}; // namespace parserFSM

D module-services/service-desktop/endpoints/Context.cpp => module-services/service-desktop/endpoints/Context.cpp +0 -29
@@ 1,29 0,0 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "Context.hpp"

namespace parserFSM
{
    auto Context::createSimpleResponse(const std::string &entryTitle) -> std::string
    {
        json11::Json::object contextJsonObject =
            json11::Json::object{{json::endpoint, static_cast<int>(getEndpoint())},
                                 {json::status, static_cast<int>(responseContext.status)},
                                 {json::uuid, getUuid()}};
        if (!responseContext.body.is_null()) {
            contextJsonObject[json::body] = responseContext.body;
        }

        const json11::Json responseJson{std::move(contextJsonObject)};

        return buildResponseStr(responseJson.dump().size(), responseJson.dump());
    }

    auto Context::createErrorResponse(http::Code code, const std::string &text) -> std::string
    {
        setResponseStatus(code);
        setResponseBody(std::map<std::string, std::string>{{"error", text}});
        return createSimpleResponse();
    }
} // namespace parserFSM

M module-services/service-desktop/endpoints/Context.hpp => module-services/service-desktop/endpoints/Context.hpp +14 -2
@@ 82,8 82,20 @@ namespace parserFSM
        }
        virtual ~Context() noexcept = default;

        virtual auto createSimpleResponse(const std::string &entryTitle = json::entries) -> std::string;
        auto createErrorResponse(http::Code code, const std::string &text) -> std::string;
        virtual auto createSimpleResponse(const std::string &entryTitle = json::entries) -> std::string
        {
            json11::Json::object contextJsonObject =
                json11::Json::object{{json::endpoint, static_cast<int>(getEndpoint())},
                                     {json::status, static_cast<int>(responseContext.status)},
                                     {json::uuid, getUuid()}};
            if (!responseContext.body.is_null()) {
                contextJsonObject[json::body] = responseContext.body;
            }

            const json11::Json responseJson{std::move(contextJsonObject)};

            return buildResponseStr(responseJson.dump().size(), responseJson.dump());
        }

        auto setResponse(endpoint::ResponseContext r)
        {

M module-services/service-desktop/endpoints/developerMode/DeveloperModeEndpoint.cpp => module-services/service-desktop/endpoints/developerMode/DeveloperModeEndpoint.cpp +6 -15
@@ 9,15 9,6 @@

using namespace parserFSM;

DeveloperModeEndpoint::DeveloperModeEndpoint(sys::Service *_ownerServicePtr) : Endpoint(_ownerServicePtr)
{
    debugName = "DeveloperModeEndpoint";
    helpers.emplace_back(std::make_unique<DeveloperModeHelper>("base", ownerServicePtr));
    helpers.emplace_back(std::make_unique<UI_Helper>("ui", ownerServicePtr));
    helpers.emplace_back(std::make_unique<UpdateHelper>("update", ownerServicePtr));
    helpers.emplace_back(std::make_unique<LogHelper>("log", ownerServicePtr));
}

auto DeveloperModeEndpoint::handle(Context &context) -> void
{
    auto &p               = helperSwitcher(context);


@@ 43,11 34,11 @@ auto DeveloperModeEndpoint::handle(Context &context) -> void

auto DeveloperModeEndpoint::helperSwitcher(parserFSM::Context &ctx) -> parserFSM::BaseHelper &
{
    std::string name = ctx.getBody().string_value();
    if (auto s = std::find_if(
            std::begin(helpers), std::end(helpers), [&name](const auto &val) { return val->name() == name; });
        s != std::end(helpers)) {
        return **s;
    if (ctx.getBody()["ui"] == true) {
        return *uiHelper;
    }
    if (ctx.getBody()["update"] == true) {
        return *updateHelper;
    }
    return **helpers.begin();
    return *helper;
}

M module-services/service-desktop/endpoints/developerMode/DeveloperModeEndpoint.hpp => module-services/service-desktop/endpoints/developerMode/DeveloperModeEndpoint.hpp +10 -3
@@ 6,7 6,6 @@
#include "DeveloperModeHelper.hpp"
#include "Mode/UI_Helper.hpp"
#include "Mode/UpdateHelper.hpp"
#include "Mode/LogHelper.hpp"
#include <endpoints/Endpoint.hpp>
#include <parser/ParserUtils.hpp>



@@ 27,10 26,18 @@ namespace sys
class DeveloperModeEndpoint : public parserFSM::Endpoint
{
  private:
    std::list<std::unique_ptr<parserFSM::BaseHelper>> helpers;
    const std::unique_ptr<parserFSM::DeveloperModeHelper> helper;
    const std::unique_ptr<parserFSM::UI_Helper> uiHelper;
    const std::unique_ptr<parserFSM::UpdateHelper> updateHelper;

  public:
    explicit DeveloperModeEndpoint(sys::Service *_ownerServicePtr);
    explicit DeveloperModeEndpoint(sys::Service *_ownerServicePtr)
        : Endpoint(_ownerServicePtr), helper(std::make_unique<parserFSM::DeveloperModeHelper>(ownerServicePtr)),
          uiHelper(std::make_unique<parserFSM::UI_Helper>(ownerServicePtr)),
          updateHelper(std::make_unique<parserFSM::UpdateHelper>(ownerServicePtr))
    {
        debugName = "DeveloperModeEndpoint";
    }

    auto handle(parserFSM::Context &context) -> void override;


M module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.hpp => module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.hpp +1 -1
@@ 34,7 34,7 @@ namespace parserFSM
        auto prepareSMS(Context &context) -> ProcessResult;

      public:
        explicit DeveloperModeHelper(const std::string &name, sys::Service *p) : BaseHelper(name, p)
        explicit DeveloperModeHelper(sys::Service *p) : BaseHelper(p)
        {}

      private:

D module-services/service-desktop/endpoints/developerMode/Mode/LogHelper.cpp => module-services/service-desktop/endpoints/developerMode/Mode/LogHelper.cpp +0 -57
@@ 1,57 0,0 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "LogHelper.hpp"
#include "Logger.hpp"

namespace parserFSM
{
    auto LogHelper::processPost(Context &context) -> ProcessResult
    {
        const auto &body = context.getBody();

        if (body["service"].is_string() and body["level"].is_number()) {
            return setLogLevel(body["service"].string_value(), body["level"].number_value());
        }
        else if (body["device"].is_string()) {
            return setLogDevice(body["device"].string_value());
        }

        return {sent::no, std::nullopt};
    }

    auto LogHelper::processGet(Context &context) -> ProcessResult
    {
        const auto &body = context.getBody();
        if (body["service"].is_string()) {
            return getLogLevel(body["service"].string_value());
        }
        return {sent::no, std::nullopt};
    }

    BaseHelper::ProcessResult LogHelper::setLogLevel(const std::string &serviceName, double level)
    {
        if (Log::Logger::get().setLogLevel(serviceName, static_cast<logger_level>(level))) {
            return {sent::no, endpoint::ResponseContext{.status = http::Code::OK}};
        }
        else {
            return {sent::no, endpoint::ResponseContext{.status = http::Code::InternalServerError}};
        }
        return {sent::no, std::nullopt};
    }

    BaseHelper::ProcessResult LogHelper::setLogDevice(const std::string & /*device*/)
    {
        return {
            sent::no,
            endpoint::ResponseContext{http::Code::InternalServerError,
                                      std::map<std::string, std::string>{{"cause", "Logger is badly implemented"}}}};
    }

    BaseHelper::ProcessResult LogHelper::getLogLevel(const std::string &serviceName)
    {
        auto level = Log::Logger::get().getLogLevel(serviceName);
        return {sent::no, endpoint::ResponseContext{http::Code::OK, std::map<std::string, double>{{"level", level}}}};
    }

} // namespace parserFSM

D module-services/service-desktop/endpoints/developerMode/Mode/LogHelper.hpp => module-services/service-desktop/endpoints/developerMode/Mode/LogHelper.hpp +0 -28
@@ 1,28 0,0 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <endpoints/Context.hpp>
#include <Service/Common.hpp>
#include <endpoints/BaseHelper.hpp>

namespace parserFSM
{

    class LogHelper : public BaseHelper
    {

      public:
        explicit LogHelper(const std::string &name, sys::Service *p) : BaseHelper(name, p)
        {}

        auto processPost(Context &context) -> ProcessResult final;
        auto processGet(Context &context) -> ProcessResult final;

      private:
        [[nodiscard]] auto setLogLevel(const std::string &, double) -> ProcessResult;
        [[nodiscard]] auto setLogDevice(const std::string &dev) -> ProcessResult;
        [[nodiscard]] auto getLogLevel(const std::string &) -> ProcessResult;
    };
} // namespace parserFSM

M module-services/service-desktop/endpoints/developerMode/Mode/UI_Helper.hpp => module-services/service-desktop/endpoints/developerMode/Mode/UI_Helper.hpp +1 -1
@@ 14,7 14,7 @@ namespace parserFSM
    {

      public:
        explicit UI_Helper(const std::string &name, sys::Service *p) : BaseHelper(name, p)
        explicit UI_Helper(sys::Service *p) : BaseHelper(p)
        {}

        /// returns DOM async

M module-services/service-desktop/endpoints/developerMode/Mode/UpdateHelper.hpp => module-services/service-desktop/endpoints/developerMode/Mode/UpdateHelper.hpp +1 -1
@@ 14,7 14,7 @@ namespace parserFSM
    {

      public:
        explicit UpdateHelper(const std::string &name, sys::Service *p) : BaseHelper(name, p)
        explicit UpdateHelper(sys::Service *p) : BaseHelper(p)
        {}

        auto processPost(Context &context) -> ProcessResult final;

M module-services/service-desktop/endpoints/security/SecurityEndpoint.hpp => module-services/service-desktop/endpoints/security/SecurityEndpoint.hpp +1 -2
@@ 28,8 28,7 @@ class SecurityEndpoint : public parserFSM::Endpoint

  public:
    explicit SecurityEndpoint(sys::Service *ownerServicePtr)
        : Endpoint(ownerServicePtr),
          helper(std::make_unique<parserFSM::SecurityEndpointHelper>("security", ownerServicePtr))
        : Endpoint(ownerServicePtr), helper(std::make_unique<parserFSM::SecurityEndpointHelper>(ownerServicePtr))
    {
        debugName = "SecurityEndpoint";
    }

M module-services/service-desktop/endpoints/security/SecurityEndpointHelper.hpp => module-services/service-desktop/endpoints/security/SecurityEndpointHelper.hpp +1 -1
@@ 19,7 19,7 @@ namespace parserFSM
    class SecurityEndpointHelper : public BaseHelper
    {
      public:
        explicit SecurityEndpointHelper(const std::string &name, sys::Service *p) : BaseHelper(name, p)
        explicit SecurityEndpointHelper(sys::Service *p) : BaseHelper(p)
        {}

        static constexpr auto PasscodeLength = 4;

M module-services/service-desktop/parser/ParserFSM.cpp => module-services/service-desktop/parser/ParserFSM.cpp +4 -6
@@ 58,9 58,7 @@ void StateMachine::parseHeader()

    auto messageStart = receivedMsg.find(message::endpointChar);
    if (messageStart == std::string::npos) {
        std::string message = "This is not a valid endpoint message! Type=" + receivedMsg.at(0);
        LOG_ERROR("%s", message.c_str());
        messageHandler->putToSendQueue(Context().createErrorResponse(http::Code::BadRequest, message));
        LOG_ERROR("This is not a valid endpoint message! Type=%c", receivedMsg.at(0));
        return;
    }



@@ 75,13 73,13 @@ void StateMachine::parseHeader()
    payloadLength = message::calcPayloadLength(header);
    if (payloadLength == 0) // failed to obtain payload length from msg
    {
        std::string message = "Damaged header!";
        LOG_ERROR("%s", message.c_str());
        messageHandler->putToSendQueue(Context().createErrorResponse(http::Code::BadRequest, message));
        LOG_ERROR("Damaged header!");
        state = State::NoMsg;
        return;
    }

    LOG_DEBUG("Payload length: %lu", payloadLength);

    message::removeHeader(receivedMsg);
    parseNewMessage();
}

M module-sys/SystemManager/SystemManager.cpp => module-sys/SystemManager/SystemManager.cpp +1 -1
@@ 190,7 190,7 @@ namespace sys

        LOG_INFO("Order of system services initialization:");
        for (const auto &service : sortedServices) {
            LOG_DEBUG("\t> %s", service.get().getName().c_str());
            LOG_INFO("\t> %s", service.get().getName().c_str());
        }
        std::for_each(sortedServices.begin(), sortedServices.end(), [this](const auto &service) {
            const auto startTimeout = service.get().getStartTimeout().count();

M module-utils/board/cross/log_rt1051.cpp => module-utils/board/cross/log_rt1051.cpp +12 -0
@@ 13,6 13,13 @@
/// - in critical seciton - return CRIT
/// - in interrupt return - IRQ
/// - else return thread name
static inline const char *getTaskDesc()
{
    return xTaskGetCurrentTaskHandle() == nullptr
               ? Log::Logger::CRIT_STR
               : xPortIsInsideInterrupt() ? Log::Logger::IRQ_STR : pcTaskGetName(xTaskGetCurrentTaskHandle());
}

namespace Log
{
    void Logger::addLogHeader(logger_level level, const char *file, int line, const char *function)


@@ 36,6 43,11 @@ namespace Log
                                           logColors->resetColor.data());
    }

    bool Logger::filterLogs(logger_level level)
    {
        return getLogLevel(getTaskDesc()) <= level;
    }

    void Logger::logToDevice(const char *fmt, va_list args)
    {
        loggerBufferCurrentPos = 0;

M module-utils/board/linux/log_linux.cpp => module-utils/board/linux/log_linux.cpp +5 -0
@@ 28,6 28,11 @@ namespace Log
                                           logColors->resetColor.data());
    }

    bool Logger::filterLogs(logger_level _level)
    {
        return _level >= level;
    }

    void Logger::logToDevice(const char *, va_list)
    {
        assert(false && "Not implemented");

M module-utils/log/Logger.cpp => module-utils/log/Logger.cpp +0 -27
@@ 6,7 6,6 @@
#include <gsl/util>
#include "LockGuard.hpp"
#include <Logger.hpp>
#include <functional>
#include "macros.h"

namespace Log


@@ 20,8 19,6 @@ namespace Log
                                                            {"ServiceFota", logger_level::LOGINFO},
                                                            {"ServiceEink", logger_level::LOGINFO},
                                                            {"ServiceDB", logger_level::LOGINFO},
                                                            {"ServiceDesktop_w2", logger_level::LOGINFO},
                                                            {"SysMgrService", logger_level::LOGERROR},
                                                            {CRIT_STR, logger_level::LOGTRACE},
                                                            {IRQ_STR, logger_level::LOGTRACE}};
    const char *Logger::levelNames[]                     = {"TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"};


@@ 29,13 26,6 @@ namespace Log
    Logger::Logger() : circularBuffer(circularBufferSize)
    {}

    const char *Logger::getTaskDesc()
    {
        return xTaskGetCurrentTaskHandle() == nullptr
                   ? Log::Logger::CRIT_STR
                   : xPortIsInsideInterrupt() ? Log::Logger::IRQ_STR : pcTaskGetName(xTaskGetCurrentTaskHandle());
    }

    void Logger::enableColors(bool enable)
    {
        LockGuard lock(mutex);


@@ 50,26 40,9 @@ namespace Log

    auto Logger::getLogLevel(const std::string &name) -> logger_level
    {
        LockGuard lock(mutex);
        if (auto it = filtered.find(name); it != std::end(filtered)) {
            return it->second;
        }
        filtered[name] = logger_level::LOGTRACE;
        return filtered[name];
    }

    bool Logger::setLogLevel(const std::string &name, logger_level level)
    {
        LockGuard lock(mutex);
        filtered[name] = level;
        return true;
    }

    bool Logger::filterLogs(logger_level level)
    {
        return getLogLevel(getTaskDesc()) <= level;
    }

    auto Logger::getLogs() -> std::string
    {
        LockGuard lock(mutex);

M module-utils/log/Logger.hpp => module-utils/log/Logger.hpp +7 -11
@@ 39,25 39,21 @@ namespace Log
        static constexpr auto CRIT_STR = "CRIT";
        static constexpr auto IRQ_STR  = "IRQ";

        /// Filter out not interesting logs via thread Name
        /// its' using fact that:
        /// - TRACE is level 0, for undefined lookups it will be always trace
        /// - it will be one time init for apps which doesn't tell what level they should have
        /// - for others it will be o1 lookup so it's fine
        /// this function appends to logged services list!
        [[nodiscard]] auto getLogLevel(const std::string &name) -> logger_level;
        bool setLogLevel(const std::string &name, logger_level);
        void logToDevice(const char *fmt, va_list args);

      private:
        Logger();

        const char *getTaskDesc();
        void addLogHeader(logger_level level,
                          const char *file     = nullptr,
                          int line             = -1,
                          const char *function = nullptr);
        [[nodiscard]] bool filterLogs(logger_level level);
        /// Filter out not interesting logs via thread Name
        /// its' using fact that:
        /// - TRACE is level 0, for unedfined lookups it will be alvways trace
        /// - it will be one time init for apps which doesn't tell what level they should have
        /// - for others it will be o1 lookup so it's fine
        [[nodiscard]] auto getLogLevel(const std::string &name) -> logger_level;
        void logToDevice(const char *fmt, va_list args);
        void logToDevice(Device device, std::string_view logMsg, size_t length);
        [[nodiscard]] size_t loggerBufferSizeLeft() const noexcept
        {

M test/get_os_log.py => test/get_os_log.py +4 -4
@@ 6,7 6,6 @@ import sys
import os.path
import atexit

from harness import log
from harness.harness import Harness
from harness.interface.error import TestError, Error
from harness.api.developermode import PhoneModeLock


@@ 22,13 21,14 @@ def set_passcode(harness: Harness, flag: bool):

def main():
    if len(sys.argv) == 1:
        log.error(f'Please pass log storage directory as the parameter: \'python {sys.argv[0]} <log dir>\' ')
        print(
            f'Please pass log storage directory as the parameter: \'python {sys.argv[0]} <log dir>\' ')
        raise TestError(Error.OTHER_ERROR)

    log_dir = str(sys.argv[1])

    if (not os.path.exists(log_dir)):
        log.error(f'Log storage directory {log_dir} not found')
        print(f'Log storage directory {log_dir} not found')
        raise TestError(Error.OTHER_ERROR)

    harness = Harness.from_detect()


@@ 43,5 43,5 @@ if __name__ == "__main__":
    try:
        main()
    except TestError as err:
        log.error(err)
        print(err)
        exit(err.get_error_code())

M test/pytest/conftest.py => test/pytest/conftest.py +9 -2
@@ 16,7 16,6 @@ from harness import utils
from harness.interface.error import TestError, Error
from harness.interface.CDCSerial import Keytype, CDCSerial as serial
from harness.interface.defs import key_codes
from harness.rt_harness_discovery import get_rt1051_harness


simulator_port = 'simulator'


@@ 69,8 68,16 @@ def harness(request):
    try:
        if port_name is None:
            log.warning("no port provided! trying automatic detection")
            harness = get_rt1051_harness(TIMEOUT)
            harness = None

            with utils.Timeout.limit(seconds=TIMEOUT):
                while not harness:
                    try:
                        harness = Harness.from_detect()
                    except TestError as e:
                        if e.get_error_code() == Error.PORT_NOT_FOUND:
                            log.info(f"waiting for a serial port… ({TIMEOUT- int(time.time() - timeout_started)})")
                            time.sleep(RETRY_EVERY_SECONDS)
        else:
            assert '/dev' in port_name or simulator_port in port_name


M test/pytest/test_updater.py => test/pytest/test_updater.py +0 -2
@@ 33,8 33,6 @@ def disable_some_logs(harness: Harness):
def test_update(harness: Harness):
    filename = "update.tar"

    disable_some_logs(harness)

    log.info(get_version(harness))
    PhoneModeLock(False).run(harness)
    put_file(harness, filename, "/sys/user/")

M test/requirements.txt => test/requirements.txt +0 -2
@@ 8,5 8,3 @@ pyserial==3.5
pytest==6.1.2
six==1.15.0
toml==0.10.2
tqdm=4.59.0
dataclass_json=1.3.7

D tools/requirements.txt => tools/requirements.txt +0 -3
@@ 1,3 0,0 @@
gitdb==4.0.5
requests==2.25.1
tqdm==4.59.0