-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e289010
commit d60fd43
Showing
6 changed files
with
19 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
""" | ||
|
||
__author__ = 'Grzegorz Latuszek, Marcin Usielski, Michal Ernst' | ||
__copyright__ = 'Copyright (C) 2018-2023, Nokia' | ||
__copyright__ = 'Copyright (C) 2018-2024, Nokia' | ||
__email__ = '[email protected], [email protected], [email protected]' | ||
|
||
import codecs | ||
|
@@ -514,11 +514,6 @@ def configure_moler_main_logger(): | |
configure_moler_threads_logger() | ||
logger.info("More logs in: {}".format(_logging_path)) | ||
_list_libraries(logger=logger) | ||
if sys.version_info < (3, 7): | ||
logger.warning("****************************************************\n" | ||
"* Support for Python < 3.7 will be removed soon. *\n" | ||
"* Please update your Python to 3.7 at least. *\n" | ||
"****************************************************") | ||
global _main_logger | ||
_main_logger = logger | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
- be the state machine that controls which commands may run in given state | ||
""" | ||
__author__ = 'Grzegorz Latuszek, Marcin Usielski, Michal Ernst' | ||
__copyright__ = 'Copyright (C) 2018-2023, Nokia' | ||
__copyright__ = 'Copyright (C) 2018-2024, Nokia' | ||
__email__ = '[email protected], [email protected], [email protected]' | ||
|
||
import abc | ||
|
@@ -18,7 +18,7 @@ | |
import time | ||
import traceback | ||
import threading | ||
|
||
import queue | ||
from moler.cmd.commandtextualgeneric import CommandTextualGeneric | ||
from moler.connection_observer import ConnectionObserver | ||
from moler.config.loggers import configure_device_logger | ||
|
@@ -31,12 +31,6 @@ | |
from moler.device.abstract_device import AbstractDevice | ||
from moler.config.loggers import change_logging_suffix | ||
|
||
try: | ||
import queue | ||
except ImportError: | ||
# noinspection PyUnresolvedReferences | ||
import Queue as queue # For python 2 | ||
|
||
|
||
# TODO: name, logger/logger_name as param | ||
class TextualDevice(AbstractDevice): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,16 +7,16 @@ | |
__copyright__ = 'Copyright (C) 2018-2024, Nokia' | ||
__email__ = '[email protected], [email protected], [email protected]' | ||
|
||
from functools import wraps | ||
from types import FunctionType, MethodType | ||
from six import string_types | ||
from math import isclose | ||
import collections.abc as collections | ||
import copy | ||
import importlib | ||
import logging | ||
import re | ||
import sys | ||
import collections.abc | ||
from functools import wraps | ||
from types import FunctionType, MethodType | ||
from six import string_types | ||
from math import isclose | ||
|
||
|
||
class ClassProperty(property): | ||
|
@@ -203,7 +203,7 @@ def create_object_from_name(full_class_name, constructor_params): | |
def update_dict(target_dict, expand_dict): | ||
for key, value in expand_dict.items(): | ||
if (key in target_dict and isinstance(target_dict[key], dict) and isinstance(expand_dict[key], | ||
collections.Mapping)): | ||
collections.abc.Mapping)): | ||
update_dict(target_dict[key], expand_dict[key]) | ||
else: | ||
target_dict[key] = expand_dict[key] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,23 +3,17 @@ | |
"""Wrapper for observer registered in ThreadedMolerConnection (old name: ObservableConnection).""" | ||
|
||
__author__ = 'Marcin Usielski' | ||
__copyright__ = 'Copyright (C) 2020-2023, Nokia' | ||
__copyright__ = 'Copyright (C) 2020-2024, Nokia' | ||
__email__ = '[email protected]' | ||
|
||
import logging | ||
import traceback | ||
import threading | ||
from threading import Thread | ||
|
||
import queue | ||
from moler.util import tracked_thread | ||
from moler.config.loggers import TRACE | ||
from moler.exceptions import CommandFailure, MolerException | ||
|
||
try: | ||
import queue | ||
except ImportError: | ||
# noinspection PyUnresolvedReferences | ||
import Queue as queue # For python 2 | ||
from threading import Thread | ||
|
||
|
||
class ObserverThreadWrapper(object): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,25 +5,18 @@ | |
""" | ||
|
||
__author__ = 'Marcin Usielski' | ||
__copyright__ = 'Copyright (C) 2021-2023, Nokia' | ||
__copyright__ = 'Copyright (C) 2021-2024, Nokia' | ||
__email__ = '[email protected]' | ||
|
||
|
||
from threading import Lock | ||
import threading | ||
import logging | ||
import time | ||
from moler.runner import ConnectionObserverRunner | ||
from moler.exceptions import CommandTimeout | ||
from moler.exceptions import ConnectionObserverTimeout | ||
from moler.util.loghelper import log_into_logger | ||
from moler.helpers import copy_list | ||
import threading | ||
import logging | ||
import time | ||
|
||
try: | ||
import queue | ||
except ImportError: | ||
# noinspection PyUnresolvedReferences | ||
import Queue as queue # For python 2 | ||
|
||
|
||
class RunnerSingleThread(ConnectionObserverRunner): | ||
|
@@ -48,7 +41,7 @@ def __init__(self): | |
name="RunnerSingle-{}".format(RunnerSingleThread._th_nr) | ||
) | ||
RunnerSingleThread._th_nr += 1 | ||
self._connection_observer_lock = Lock() | ||
self._connection_observer_lock = threading.Lock() | ||
self._loop_thread.daemon = True | ||
self._loop_thread.start() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 +4,15 @@ | |
""" | ||
|
||
__author__ = 'Michal Ernst, Marcin Usielski' | ||
__copyright__ = 'Copyright (C) 2019-2023, Nokia' | ||
__copyright__ = 'Copyright (C) 2019-2024, Nokia' | ||
__email__ = '[email protected], [email protected]' | ||
|
||
import os | ||
import random | ||
import time | ||
import math | ||
import threading | ||
|
||
import queue | ||
from moler.io.raw.memory import ThreadedFifoBuffer | ||
from moler.device import DeviceFactory | ||
from moler.device.textualdevice import TextualDevice | ||
|
@@ -21,12 +21,6 @@ | |
from moler.helpers import copy_list | ||
from moler.util.moler_test import MolerTest | ||
|
||
try: | ||
import queue | ||
except ImportError: | ||
# noinspection PyUnresolvedReferences | ||
import Queue as queue # Python 2 and 3. | ||
|
||
|
||
def iterate_over_device_states(device, max_time=None, tests_per_device=300, max_no_of_threads=11, rerun=0, | ||
timeout_multiply=3.0): | ||
|