Loading scripts/run_tests_locally-device.sh 0 → 100755 +28 −0 Original line number Diff line number Diff line #!/bin/bash # Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. PROJECTDIR=`pwd` cd $PROJECTDIR/src RCFILE=$PROJECTDIR/coverage/.coveragerc # Run unitary tests and analyze coverage of code at same time # Useful flags for pytest: #-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ device/tests/test_unitary.py src/device/service/drivers/openconfig/OpenConfigDriver.py +0 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ from device.service.driver_api.AnyTreeTools import TreeNode, get_subnode, set_su from .templates import ALL_RESOURCE_KEYS, EMPTY_CONFIG, compose_config, get_filter, parse from .RetryDecorator import retry DEBUG_MODE = False logging.getLogger('ncclient.manager').setLevel(logging.DEBUG if DEBUG_MODE else logging.WARNING) logging.getLogger('ncclient.transport.ssh').setLevel(logging.DEBUG if DEBUG_MODE else logging.WARNING) Loading src/webui/Config.py +3 −0 Original line number Diff line number Diff line Loading @@ -36,3 +36,6 @@ CONTEXT_SERVICE_PORT = int(os.environ.get('CONTEXTSERVICE_SERVICE_PORT_GRPC', 10 DEVICE_SERVICE_ADDRESS = os.environ.get('DEVICESERVICE_SERVICE_HOST', 'deviceservice') DEVICE_SERVICE_PORT = int(os.environ.get('DEVICESERVICE_SERVICE_PORT_GRPC', 2020)) SERVICE_SERVICE_ADDRESS = os.environ.get('SERVICESERVICE_SERVICE_HOST', 'serviceservice') SERVICE_SERVICE_PORT = int(os.environ.get('SERVICESERVICE_SERVICE_PORT_GRPC', 3030)) src/webui/Dockerfile +3 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,9 @@ COPY --chown=webui:webui context/client/. context/client COPY --chown=webui:webui device/__init__.py device/__init__.py COPY --chown=webui:webui device/proto/. device/proto COPY --chown=webui:webui device/client/. device/client COPY --chown=webui:webui service/__init__.py service/__init__.py COPY --chown=webui:webui service/proto/. service/proto COPY --chown=webui:webui service/client/. service/client COPY --chown=webui:webui webui/. webui # Start webui service Loading src/webui/grafana_dashboard.json +6 −8 Original line number Diff line number Diff line Loading @@ -227,12 +227,12 @@ "current": { "selected": true, "text": [ "R1-INF", "R3-INF" "R1-EMU", "R3-EMU" ], "value": [ "R1-INF", "R3-INF" "R1-EMU", "R3-EMU" ] }, "datasource": null, Loading @@ -257,12 +257,10 @@ "current": { "selected": true, "text": [ "13/2/0", "13/2/1" "13/1/2" ], "value": [ "13/2/0", "13/2/1" "13/1/2" ] }, "datasource": null, Loading Loading
scripts/run_tests_locally-device.sh 0 → 100755 +28 −0 Original line number Diff line number Diff line #!/bin/bash # Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. PROJECTDIR=`pwd` cd $PROJECTDIR/src RCFILE=$PROJECTDIR/coverage/.coveragerc # Run unitary tests and analyze coverage of code at same time # Useful flags for pytest: #-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ device/tests/test_unitary.py
src/device/service/drivers/openconfig/OpenConfigDriver.py +0 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ from device.service.driver_api.AnyTreeTools import TreeNode, get_subnode, set_su from .templates import ALL_RESOURCE_KEYS, EMPTY_CONFIG, compose_config, get_filter, parse from .RetryDecorator import retry DEBUG_MODE = False logging.getLogger('ncclient.manager').setLevel(logging.DEBUG if DEBUG_MODE else logging.WARNING) logging.getLogger('ncclient.transport.ssh').setLevel(logging.DEBUG if DEBUG_MODE else logging.WARNING) Loading
src/webui/Config.py +3 −0 Original line number Diff line number Diff line Loading @@ -36,3 +36,6 @@ CONTEXT_SERVICE_PORT = int(os.environ.get('CONTEXTSERVICE_SERVICE_PORT_GRPC', 10 DEVICE_SERVICE_ADDRESS = os.environ.get('DEVICESERVICE_SERVICE_HOST', 'deviceservice') DEVICE_SERVICE_PORT = int(os.environ.get('DEVICESERVICE_SERVICE_PORT_GRPC', 2020)) SERVICE_SERVICE_ADDRESS = os.environ.get('SERVICESERVICE_SERVICE_HOST', 'serviceservice') SERVICE_SERVICE_PORT = int(os.environ.get('SERVICESERVICE_SERVICE_PORT_GRPC', 3030))
src/webui/Dockerfile +3 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,9 @@ COPY --chown=webui:webui context/client/. context/client COPY --chown=webui:webui device/__init__.py device/__init__.py COPY --chown=webui:webui device/proto/. device/proto COPY --chown=webui:webui device/client/. device/client COPY --chown=webui:webui service/__init__.py service/__init__.py COPY --chown=webui:webui service/proto/. service/proto COPY --chown=webui:webui service/client/. service/client COPY --chown=webui:webui webui/. webui # Start webui service Loading
src/webui/grafana_dashboard.json +6 −8 Original line number Diff line number Diff line Loading @@ -227,12 +227,12 @@ "current": { "selected": true, "text": [ "R1-INF", "R3-INF" "R1-EMU", "R3-EMU" ], "value": [ "R1-INF", "R3-INF" "R1-EMU", "R3-EMU" ] }, "datasource": null, Loading @@ -257,12 +257,10 @@ "current": { "selected": true, "text": [ "13/2/0", "13/2/1" "13/1/2" ], "value": [ "13/2/0", "13/2/1" "13/1/2" ] }, "datasource": null, Loading