From 45f86f703ad0b3fd83321c4fb464a0817053f53d Mon Sep 17 00:00:00 2001 From: gifrerenom <lluis.gifre@cttc.es> Date: Thu, 19 Sep 2024 12:42:19 +0000 Subject: [PATCH] Pre-merge code cleanup --- my_deploy.sh | 10 +++++---- src/context/proto | 1 - src/device/requirements.in | 1 + src/device/tests/qkd/unit/LICENSE | 21 ------------------- .../qkd/unit/test_set_new_configuration.py | 2 +- src/tests/tools/mock_qkd_nodes/mock.py | 15 ++++++++++++- src/tests/tools/mock_qkd_nodes/start.sh | 17 +++++++++++++-- 7 files changed, 37 insertions(+), 30 deletions(-) delete mode 120000 src/context/proto delete mode 100644 src/device/tests/qkd/unit/LICENSE diff --git a/my_deploy.sh b/my_deploy.sh index 4ca545943..88be82b63 100755 --- a/my_deploy.sh +++ b/my_deploy.sh @@ -20,9 +20,7 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -export TFS_COMPONENTS="context device pathcomp service slice nbi webui app" - -# export load_generator +export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator" # Uncomment to activate Monitoring (old) #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" @@ -72,6 +70,10 @@ export TFS_COMPONENTS="context device pathcomp service slice nbi webui app" # export TLS_CERT_PATH="src/dlt/gateway/keys/ca.crt" #fi +# Uncomment to activate QKD App +#export TFS_COMPONENTS="${TFS_COMPONENTS} app" + + # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" @@ -122,7 +124,7 @@ export CRDB_DEPLOY_MODE="single" export CRDB_DROP_DATABASE_IF_EXISTS="" # Disable flag for re-deploying CockroachDB from scratch. -export CRDB_REDEPLOY="YES" +export CRDB_REDEPLOY="" # ----- NATS ------------------------------------------------------------------- diff --git a/src/context/proto b/src/context/proto deleted file mode 120000 index 0ae252a78..000000000 --- a/src/context/proto +++ /dev/null @@ -1 +0,0 @@ -../../proto/src/python \ No newline at end of file diff --git a/src/device/requirements.in b/src/device/requirements.in index a3f6a763b..bf5e6a2b3 100644 --- a/src/device/requirements.in +++ b/src/device/requirements.in @@ -32,6 +32,7 @@ python-json-logger==2.0.2 #pytz==2021.3 #redis==4.1.2 requests==2.27.1 +requests-mock==1.9.3 xmltodict==0.12.0 tabulate ipaddress diff --git a/src/device/tests/qkd/unit/LICENSE b/src/device/tests/qkd/unit/LICENSE deleted file mode 100644 index 6b678c507..000000000 --- a/src/device/tests/qkd/unit/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017 FullStory, Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/src/device/tests/qkd/unit/test_set_new_configuration.py b/src/device/tests/qkd/unit/test_set_new_configuration.py index d4b202489..438e46d74 100644 --- a/src/device/tests/qkd/unit/test_set_new_configuration.py +++ b/src/device/tests/qkd/unit/test_set_new_configuration.py @@ -30,7 +30,7 @@ def qkd_driver1(): @pytest.fixture def qkd_driver3(): # Initialize the QKD driver for QKD3 - return QKDDriver(address=MOCK_QKD1_ADDRRESS, port=MOCK_PORT3, username='user', password='pass') + return QKDDriver(address=MOCK_QKD3_ADDRRESS, port=MOCK_PORT3, username='user', password='pass') def create_qkd_app(driver, qkdn_id, backing_qkdl_id, client_app_id=None): """ diff --git a/src/tests/tools/mock_qkd_nodes/mock.py b/src/tests/tools/mock_qkd_nodes/mock.py index 2ab60c65d..7a606f6ca 100644 --- a/src/tests/tools/mock_qkd_nodes/mock.py +++ b/src/tests/tools/mock_qkd_nodes/mock.py @@ -1,5 +1,18 @@ -import os +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# 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. +import os from flask import Flask, request from YangValidator import YangValidator diff --git a/src/tests/tools/mock_qkd_nodes/start.sh b/src/tests/tools/mock_qkd_nodes/start.sh index cf8ee7533..b1bc56d5a 100755 --- a/src/tests/tools/mock_qkd_nodes/start.sh +++ b/src/tests/tools/mock_qkd_nodes/start.sh @@ -1,13 +1,26 @@ #!/bin/bash -cd "$(dirname "$0")" +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# 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. +cd "$(dirname "$0")" -#!/bin/bash killbg() { for p in "${pids[@]}" ; do kill "$p"; done } + trap killbg EXIT pids=() flask --app mock run --host 0.0.0.0 --port 11111 & -- GitLab