diff --git a/src/tests/scenario2/Scenario.md b/src/tests/scenario2/Scenario.md new file mode 100644 index 0000000000000000000000000000000000000000..8dad4691ade669522b5c82a5e4ed07e5d0279492 --- /dev/null +++ b/src/tests/scenario2/Scenario.md @@ -0,0 +1,47 @@ +# Scenario: + +- 4 TFS instances + + - domain D1 (source for e-2-e service) + 5 routers + 1 DC + R1@D1/2 <--> R2@D1/1 + R2@D1/3 <--> R3@D1/2 + R2@D1/5 <--> R5@D1/2 + R3@D1/4 <--> R4@D1/3 + R4@D1/5 <--> R5@D1/4 + R5@D1/1 <--> R1@D1/5 + R1@D1/100 <--> DCGW@D1/eth1 + + - domain D2 (transit for e-2-e service) + 6 routers + R1@D2/2 <--> R2@D2/1 + R1@D2/6 <--> R6@D2/1 + R1@D2/5 <--> R5@D2/1 + R2@D2/3 <--> R3@D2/2 + R2@D2/4 <--> R4@D2/2 + R2@D2/5 <--> R5@D2/2 + R2@D2/6 <--> R6@D2/2 + R3@D2/6 <--> R6@D2/3 + R4@D2/5 <--> R5@D2/4 + + - domain D3 (transit for e-2-e service) + 4 routers + R1@D3/2 <--> R2@D3/1 + R2@D3/3 <--> R3@D3/2 + R3@D3/4 <--> R4@D3/3 + R4@D3/1 <--> R1@D3/4 + R2@D3/4 <--> R4@D3/2 + + - domain D4 (end for e-2-e service) + 3 routers + R1@D4/2 <--> R2@D4/1 + R1@D4/3 <--> R3@D4/1 + R2@D4/3 <--> R3@D4/2 + R3@D4/100 <--> DCGW@D4/eth1 + + - interdomain links + R4@D1/10 <--> R1@D2/10 + R5@D1/10 <--> R1@D3/10 + R4@D2/10 <--> R2@D4/10 + R5@D2/10 <--> R2@D3/10 + R3@D3/10 <--> R1@D4/10 diff --git a/src/tests/scenario2/Workflows.md b/src/tests/scenario2/Workflows.md new file mode 100644 index 0000000000000000000000000000000000000000..3e8e592a56ba9d52ad0de3c5f7a4910508054f9c --- /dev/null +++ b/src/tests/scenario2/Workflows.md @@ -0,0 +1,78 @@ +######################### +# NFV-SDN pending tasks +######################### + +Preparation +----------- + +IDC: on start + - subscribe to Context events + +DLT: on start + - subscribe to DLT events + - start gRPC server + + +Workflow #1 - Send/Receive changes through DLT +---------------------------------------------- +IDC: subscribe to changes in Context +IDC: on event from context + - if not change in local domain: return + - compute abstraction + - get local abstracted topology from context + - update local abstracted topology + - set local abstracted topology in context + - convert changes to records + - issue change records to DLT + - on OK from DLT, end + +DLT: on request to store record + - store record on blockchain + - retrieve status + - check result + +DLT: on event received + - find record id in event + - retrieve record using record id + - update Context with data in record + - check result + + +Workflow #2 - Activate inter-domain slices with SLAs +---------------------------------------------------- + +PathComp: +- request inter-domain context +- perform inter-domain pathcomp + +Slice: CreateSlice +- detect type of request +- if not multi-domain, use local single-domain logic +- issue request to IDC + +Slice: OrderSliceWithSLAs +- create service S +- associate policy + +Policy: CreatePolicy +... + +IDC: +- request to PathComp the inter-domain path +- parse returned inter-domain path +- for each domain involved + - if local domain + - request to Slice: OrderSliceWithSLAs + - if remote domain + - add record in DLT: (context=remote-domain) + +DLT: on OrderSiceWithSLAs + - issue request to IDC + - would be local slice + - request to Slice create slice, service, policy as usual + - record slice updated in DLT + + +Workflow #3 - Resolve SLA violation on inter-domain slice +--------------------------------------------------------- + diff --git a/src/tests/scenario2/deploy_all.sh b/src/tests/scenario2/deploy_all.sh index b1563ad3b7cfa8a0d34e05dd3fb237396e6c692d..fe0651e0385752bcf777857f1bc57baad6a95904 100755 --- a/src/tests/scenario2/deploy_all.sh +++ b/src/tests/scenario2/deploy_all.sh @@ -1,22 +1,22 @@ #!/bin/bash # Delete old namespaces -kubectl delete namespace tfs-dom1 tfs-dom2 tfs-dom3 tfs-dom4 +kubectl delete namespace tfs-dom1 #tfs-dom2 tfs-dom3 tfs-dom4 # Delete secondary ingress controllers kubectl delete -f nfvsdn22/nginx-ingress-controller-dom1.yaml -kubectl delete -f nfvsdn22/nginx-ingress-controller-dom2.yaml -kubectl delete -f nfvsdn22/nginx-ingress-controller-dom3.yaml -kubectl delete -f nfvsdn22/nginx-ingress-controller-dom4.yaml +#kubectl delete -f nfvsdn22/nginx-ingress-controller-dom2.yaml +#kubectl delete -f nfvsdn22/nginx-ingress-controller-dom3.yaml +#kubectl delete -f nfvsdn22/nginx-ingress-controller-dom4.yaml # Delete MockBlockchain kubectl delete namespace tfs-bchain # Create secondary ingress controllers kubectl apply -f nfvsdn22/nginx-ingress-controller-dom1.yaml -kubectl apply -f nfvsdn22/nginx-ingress-controller-dom2.yaml -kubectl apply -f nfvsdn22/nginx-ingress-controller-dom3.yaml -kubectl apply -f nfvsdn22/nginx-ingress-controller-dom4.yaml +#kubectl apply -f nfvsdn22/nginx-ingress-controller-dom2.yaml +#kubectl apply -f nfvsdn22/nginx-ingress-controller-dom3.yaml +#kubectl apply -f nfvsdn22/nginx-ingress-controller-dom4.yaml # Create MockBlockchain ./deploy_mock_blockchain.sh @@ -26,13 +26,13 @@ source nfvsdn22/deploy_specs_dom1.sh ./deploy.sh # Deploy TFS for Domain 2 -source nfvsdn22/deploy_specs_dom2.sh -./deploy.sh +#source nfvsdn22/deploy_specs_dom2.sh +#./deploy.sh # Deploy TFS for Domain 3 -source nfvsdn22/deploy_specs_dom3.sh -./deploy.sh +#source nfvsdn22/deploy_specs_dom3.sh +#./deploy.sh # Deploy TFS for Domain 4 -source nfvsdn22/deploy_specs_dom4.sh -./deploy.sh +#source nfvsdn22/deploy_specs_dom4.sh +#./deploy.sh diff --git a/src/tests/scenario2/descriptors/domain1.json b/src/tests/scenario2/descriptors/domain1.json index 94a60d8c6e387ab579f3f2a2fb936195f168048b..6ee9bedc6c1cddf895c2189dc11a53844ea96847 100644 --- a/src/tests/scenario2/descriptors/domain1.json +++ b/src/tests/scenario2/descriptors/domain1.json @@ -1,14 +1,31 @@ { "contexts": [ { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_ids": [], "service_ids": [] + "context_id": {"context_uuid": {"uuid": "D1"}}, + "topology_ids": [ + {"context_id": {"context_uuid": {"uuid": "D1"}}, "topology_uuid": {"uuid": "admin"}} + ], "service_ids": [] } ], "topologies": [ { - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}}, - "device_ids": [], "link_ids": [] + "topology_id": {"context_id": {"context_uuid": {"uuid": "D1"}}, "topology_uuid": {"uuid": "admin"}}, + "device_ids": [ + {"device_uuid": {"uuid": "DC1-GW@D1"}}, + {"device_uuid": {"uuid": "R1@D1"}}, + {"device_uuid": {"uuid": "R2@D1"}}, + {"device_uuid": {"uuid": "R3@D1"}}, + {"device_uuid": {"uuid": "R4@D1"}}, + {"device_uuid": {"uuid": "R5@D1"}} + ], "link_ids": [ + {"link_uuid": {"uuid": "DC1-GW@D1/eth1==R1@D1/100"}}, + {"link_uuid": {"uuid": "R1@D1/2==R2@D1/1"}}, + {"link_uuid": {"uuid": "R2@D1/3==R3@D1/2"}}, + {"link_uuid": {"uuid": "R2@D1/5==R5@D1/2"}}, + {"link_uuid": {"uuid": "R3@D1/4==R4@D1/3"}}, + {"link_uuid": {"uuid": "R4@D1/5==R5@D1/4"}}, + {"link_uuid": {"uuid": "R5@D1/1==R1@D1/5"}} + ] } ], "devices": [ diff --git a/src/tests/scenario2/descriptors/domain2.json b/src/tests/scenario2/descriptors/domain2.json index 2fdd3b9e5efd13cb5d31b2fc1d38ed9b2323ded4..1a53bc289d3f834e7833635e1c035334da3d838c 100644 --- a/src/tests/scenario2/descriptors/domain2.json +++ b/src/tests/scenario2/descriptors/domain2.json @@ -1,13 +1,13 @@ { "contexts": [ { - "context_id": {"context_uuid": {"uuid": "admin"}}, + "context_id": {"context_uuid": {"uuid": "D2"}}, "topology_ids": [], "service_ids": [] } ], "topologies": [ { - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "D2"}}, "topology_uuid": {"uuid": "admin"}}, "device_ids": [], "link_ids": [] } ], diff --git a/src/tests/scenario2/descriptors/domain3.json b/src/tests/scenario2/descriptors/domain3.json index aa61145ba0290544e7438c15163270b32c3fda1b..f80ed681f0124957e8050f727b4c4f610770f14d 100644 --- a/src/tests/scenario2/descriptors/domain3.json +++ b/src/tests/scenario2/descriptors/domain3.json @@ -1,13 +1,13 @@ { "contexts": [ { - "context_id": {"context_uuid": {"uuid": "admin"}}, + "context_id": {"context_uuid": {"uuid": "D3"}}, "topology_ids": [], "service_ids": [] } ], "topologies": [ { - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "D3"}}, "topology_uuid": {"uuid": "admin"}}, "device_ids": [], "link_ids": [] } ], diff --git a/src/tests/scenario2/descriptors/domain4.json b/src/tests/scenario2/descriptors/domain4.json index ffafde7c5f0fb2e0039ede21fc9bc0fa3901c985..00da2d7c2e22dc152eaec48e4707e2730c38768f 100644 --- a/src/tests/scenario2/descriptors/domain4.json +++ b/src/tests/scenario2/descriptors/domain4.json @@ -1,13 +1,13 @@ { "contexts": [ { - "context_id": {"context_uuid": {"uuid": "admin"}}, + "context_id": {"context_uuid": {"uuid": "D4"}}, "topology_ids": [], "service_ids": [] } ], "topologies": [ { - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "D4"}}, "topology_uuid": {"uuid": "admin"}}, "device_ids": [], "link_ids": [] } ], diff --git a/src/tests/scenario2/reset.sh b/src/tests/scenario2/reset.sh new file mode 100755 index 0000000000000000000000000000000000000000..2bf2cd05559f632b960a5674ea59e334f5123a53 --- /dev/null +++ b/src/tests/scenario2/reset.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +kubectl --namespace tfs-dom1 scale --replicas=0 \ + deployment/contextservice deployment/deviceservice deployment/pathcompservice deployment/serviceservice \ + deployment/sliceservice deployment/dltservice deployment/interdomainservice deployment/webuiservice + +kubectl --namespace tfs-dom1 scale --replicas=1 \ + deployment/contextservice deployment/deviceservice deployment/pathcompservice deployment/serviceservice \ + deployment/sliceservice deployment/dltservice deployment/interdomainservice deployment/webuiservice diff --git a/src/tests/scenario2/show_deploy.sh b/src/tests/scenario2/show_deploy.sh new file mode 100755 index 0000000000000000000000000000000000000000..081b5d3f9430cc3f68b0c1abdf39f0b05eeefae5 --- /dev/null +++ b/src/tests/scenario2/show_deploy.sh @@ -0,0 +1,26 @@ +#!/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. + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +echo "Deployment Resources:" +kubectl --namespace tfs-dom1 get all +printf "\n" + +echo "Deployment Ingress:" +kubectl --namespace tfs-dom1 get ingress +printf "\n"