From 213c0476ae799234115d316a809e3739f339ece5 Mon Sep 17 00:00:00 2001
From: Lluis Gifre <lluis.gifre@cttc.es>
Date: Wed, 27 Jul 2022 18:15:20 +0200
Subject: [PATCH] ECOC'22 functional test:

- removed redundant scripts and files
- added missing show_logs_slice.sh script
- partially arranged tutorial page
---
 scripts/show_logs_slice.sh            |  27 +++++++
 src/tests/ecoc22/expose_services.yaml | 112 --------------------------
 src/tests/ecoc22/show_logs_compute.sh |  17 ----
 src/tests/ecoc22/show_logs_context.sh |  17 ----
 src/tests/ecoc22/show_logs_device.sh  |  17 ----
 src/tests/ecoc22/show_logs_service.sh |  17 ----
 src/tests/ecoc22/show_logs_slice.sh   |  17 ----
 src/tests/ecoc22/show_logs_webui.sh   |  17 ----
 tutorial/2-0-run-experiments.md       |   2 +-
 tutorial/2-4-ecoc22.md                | 112 +++++++++++++++++++++++++-
 10 files changed, 139 insertions(+), 216 deletions(-)
 create mode 100755 scripts/show_logs_slice.sh
 delete mode 100644 src/tests/ecoc22/expose_services.yaml
 delete mode 100755 src/tests/ecoc22/show_logs_compute.sh
 delete mode 100755 src/tests/ecoc22/show_logs_context.sh
 delete mode 100755 src/tests/ecoc22/show_logs_device.sh
 delete mode 100755 src/tests/ecoc22/show_logs_service.sh
 delete mode 100755 src/tests/ecoc22/show_logs_slice.sh
 delete mode 100755 src/tests/ecoc22/show_logs_webui.sh

diff --git a/scripts/show_logs_slice.sh b/scripts/show_logs_slice.sh
new file mode 100755
index 000000000..7c699ce92
--- /dev/null
+++ b/scripts/show_logs_slice.sh
@@ -0,0 +1,27 @@
+#!/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.
+
+########################################################################################################################
+# Define your deployment settings here
+########################################################################################################################
+
+# If not already set, set the name of the Kubernetes namespace to deploy to.
+export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"}
+
+########################################################################################################################
+# Automated steps start here
+########################################################################################################################
+
+kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/sliceservice
diff --git a/src/tests/ecoc22/expose_services.yaml b/src/tests/ecoc22/expose_services.yaml
deleted file mode 100644
index d51438361..000000000
--- a/src/tests/ecoc22/expose_services.yaml
+++ /dev/null
@@ -1,112 +0,0 @@
-# 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.
-
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: contextservice-public
-  labels:
-    app: contextservice
-spec:
-  type: NodePort
-  selector:
-    app: contextservice
-  ports:
-  - name: grpc
-    protocol: TCP
-    port: 1010
-    targetPort: 1010
-    nodePort: 30101
-  - name: redis
-    protocol: TCP
-    port: 6379
-    targetPort: 6379
-    nodePort: 30637
-  - name: http
-    protocol: TCP
-    port: 8080
-    targetPort: 8080
-    nodePort: 31808
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: deviceservice-public
-  labels:
-    app: deviceservice
-spec:
-  type: NodePort
-  selector:
-    app: deviceservice
-  ports:
-  - name: grpc
-    protocol: TCP
-    port: 2020
-    targetPort: 2020
-    nodePort: 30202
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: monitoringservice-public
-  labels:
-    app: monitoringservice
-spec:
-  type: NodePort
-  selector:
-    app: monitoringservice
-  ports:
-  - name: influx
-    protocol: TCP
-    port: 8086
-    targetPort: 8086
-    nodePort: 30886
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: computeservice-public
-spec:
-  type: NodePort
-  selector:
-    app: computeservice
-  ports:
-  - name: http
-    protocol: TCP
-    port: 8080
-    targetPort: 8080
-    nodePort: 30808
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: webuiservice-public
-  labels:
-    app: webuiservice
-spec:
-  type: NodePort
-  selector:
-    app: webuiservice
-  ports:
-  - name: http
-    protocol: TCP
-    port: 8004
-    targetPort: 8004
-    nodePort: 30800
-  - name: grafana
-    protocol: TCP
-    port: 3000
-    targetPort: 3000
-    nodePort: 30300
diff --git a/src/tests/ecoc22/show_logs_compute.sh b/src/tests/ecoc22/show_logs_compute.sh
deleted file mode 100755
index 7d27f477d..000000000
--- a/src/tests/ecoc22/show_logs_compute.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/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.
-
-K8S_NAMESPACE="ecoc22"
-kubectl --namespace $K8S_NAMESPACE logs deployment/computeservice
diff --git a/src/tests/ecoc22/show_logs_context.sh b/src/tests/ecoc22/show_logs_context.sh
deleted file mode 100755
index 814c486bd..000000000
--- a/src/tests/ecoc22/show_logs_context.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/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.
-
-K8S_NAMESPACE="ecoc22"
-kubectl --namespace $K8S_NAMESPACE logs deployment/contextservice -c server
diff --git a/src/tests/ecoc22/show_logs_device.sh b/src/tests/ecoc22/show_logs_device.sh
deleted file mode 100755
index 5e291e7ca..000000000
--- a/src/tests/ecoc22/show_logs_device.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/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.
-
-K8S_NAMESPACE="ecoc22"
-kubectl --namespace $K8S_NAMESPACE logs deployment/deviceservice
diff --git a/src/tests/ecoc22/show_logs_service.sh b/src/tests/ecoc22/show_logs_service.sh
deleted file mode 100755
index 0189b8c2e..000000000
--- a/src/tests/ecoc22/show_logs_service.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/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.
-
-K8S_NAMESPACE="ecoc22"
-kubectl --namespace $K8S_NAMESPACE logs deployment/serviceservice
diff --git a/src/tests/ecoc22/show_logs_slice.sh b/src/tests/ecoc22/show_logs_slice.sh
deleted file mode 100755
index b92aab8b7..000000000
--- a/src/tests/ecoc22/show_logs_slice.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/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.
-
-K8S_NAMESPACE="ecoc22"
-kubectl --namespace $K8S_NAMESPACE logs deployment/sliceservice
diff --git a/src/tests/ecoc22/show_logs_webui.sh b/src/tests/ecoc22/show_logs_webui.sh
deleted file mode 100755
index 5c6bada20..000000000
--- a/src/tests/ecoc22/show_logs_webui.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/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.
-
-K8S_NAMESPACE="ecoc22"
-kubectl --namespace $K8S_NAMESPACE logs deployment/webuiservice -c server
diff --git a/tutorial/2-0-run-experiments.md b/tutorial/2-0-run-experiments.md
index f87d00e98..82f6a56bf 100644
--- a/tutorial/2-0-run-experiments.md
+++ b/tutorial/2-0-run-experiments.md
@@ -8,5 +8,5 @@ commands you might need, configuring the network topology, and executing differe
 - [2.1. Configure the Python environment](./2-1-python-environment.md)
 - [2.2. OFC'22 Demo - Bootstrap devices, Monitor device Endpoints, Manage L3VPN Services](./2-2-ofc22.md)
 - [2.3. OECC/PSC'22 Demo (WORK IN PROGRESS)](./2-3-oeccpsc22.md)
-- [2.4. ECOC'22 Demo (PENDING)](./2-4-ecoc22.md)
+- [2.4. ECOC'22 Demo - Disjoint DC-2-DC L3VPN Service (WORK IN PROGRESS)](./2-4-ecoc22.md)
 - [2.5. NFV-SDN'22 Demo (PENDING)](./2-5-nfvsdn22.md)
diff --git a/tutorial/2-4-ecoc22.md b/tutorial/2-4-ecoc22.md
index f752bda84..0cf285faa 100644
--- a/tutorial/2-4-ecoc22.md
+++ b/tutorial/2-4-ecoc22.md
@@ -1 +1,111 @@
-# 2.4. ECOC'22 Demo (PENDING)
+# 2.4. ECOC'22 Demo - Disjoint DC-2-DC L3VPN Service (WORK IN PROGRESS)
+
+This functional test reproduces the experimental assessment of "Experimental Demonstration of Transport Network Slicing
+with SLA Using the TeraFlowSDN Controller" presented at [ECOC'22](https://www.ecoc2022.org/).
+
+## 2.4.1. Functional test folder
+
+This functional test can be found in folder `./src/tests/ecoc22/`. A convenience alias `./ecoc22/` pointing to that
+folder has been defined.
+
+## 2.4.2. Execute with real devices
+
+This functional test has only been tested with emulated devices; however, if you have access to real devices, you can
+modify the files `./ecoc22/tests/Objects.py` and `./ecoc22/tests/Credentials.py` to point to your devices, and map to
+your network topology.
+
+__Important__: The device drivers operating with real devices, e.g., OpenConfigDriver, P4Driver, and TransportApiDriver,
+               have to be considered as experimental. The configuration and monitoring capabilities they support are
+               limited or partially implemented/tested. Use them with care.
+
+
+## 2.4.3. Deployment and Dependencies
+
+To run this functional test, it is assumed you have deployed a MicroK8s-based Kubernetes environment and a TeraFlowSDN
+controller instance as described in the [Tutorial: Deployment Guide](./1-0-deployment.md), and you configured the
+Python environment as described in
+[Tutorial: Run Experiments Guide > 2.1. Configure Python Environment](./2-1-python-environment.md).
+Remember to source the scenario settings appropriately, e.g., `cd ~/tfs-ctrl && source my_deploy.sh` in each terminal
+you open.
+
+
+## 2.4.4. Access to the WebUI and Dashboard
+
+When the deployment completes, you can connect to the TeraFlowSDN WebUI and Dashboards as described in
+[Tutorial: Deployment Guide > 1.4. Access TeraFlowSDN WebUI and Grafana Dashboards](./1-4-access-webui.md)
+
+Notes:
+- the default credentials for the Grafana Dashboiard is user/pass: `admin`/`admin123+`.
+- this functional test does not involve the Monitoring component, so no monitoring data is plotted in Grafana.
+
+
+## 2.4.5. Test execution
+
+To execute this functional test, four main steps needs to be carried out:
+1. Device bootstrapping
+2. L3VPN Service creation
+3. L3VPN Service removal
+4. Cleanup
+
+Upon the execution of each test progresses, a report will be generated indicating PASSED / FAILED / SKIPPED. If there
+is some error during the execution, you should see a detailed report on the error. See the troubleshooting section if
+needed.
+
+You can check the logs of the different components using the appropriate `scripts/show_logs_[component].sh` scripts
+after you execute each step.
+
+
+### 2.4.5.1. Device bootstrapping
+
+This step configures some basic entities (Context and Topology), the devices, and the links in the topology. The
+expected results are:
+- The devices to be added into the Topology.
+- The devices to be pre-configured and initialized as ENABLED by the Automation component.
+- The monitoring for the device ports (named as endpoints in TeraFlowSDN) to be activated and data collection to
+automatically start.
+- The links to be added to the topology.
+
+To run this step, you can do it from the WebUI by uploading the file `./ecoc22/tests/descriptors_emulated.json` that
+contains the descriptors of the contexts, topologies, devices, and links, or by executing the
+`./ecoc22/run_test_01_bootstrap.sh` script.
+
+When the bootstrapping finishes, check in the Grafana L3-Monitoring Dashboard and you should see the monitoring data
+being plotted and updated every 5 seconds (by default). Given that there is no service configured, you should see a
+0-valued flat plot.
+
+In the WebUI, select the "admin" Context. Then, in the "Devices" tab you should see that 5 different emulated devices
+have been created and activated: 4 packet routers, and 1 optical line system controller. Besides, in the "Services" tab
+you should see that there is no service created. Note here that the emulated devices produce synthetic
+randomly-generated data and do not care about the services configured.
+
+
+### 2.4.5.2. L3VPN Service creation
+
+This step configures a new service emulating the request an OSM WIM would make by means of a Mock OSM instance.
+
+To run this step, execute the `./ecoc22/run_test_02_create_service.sh` script.
+
+When the script finishes, check the WebUI "Services" tab. You should see that two services have been created, one for
+the optical layer and another for the packet layer. Besides, you can check the "Devices" tab to see the configuration
+rules that have been configured in each device. In the Grafana Dashboard, given that there is now a service configured,
+you should see the plots with the monitored data for the device. By default, device R1-EMU is selected.
+
+### 2.4.5.3. L3VPN Service removal
+
+This step deconfigures the previously created services emulating the request an OSM WIM would make by means of a Mock
+OSM instance.
+
+To run this step, execute the `./ecoc22/run_test_03_delete_service.sh` script, or delete the L3NM service from the WebUI.
+
+When the script finishes, check the WebUI "Services" tab. You should see that the two services have been removed.
+Besides, in the "Devices" tab you can see that the appropriate configuration rules have been deconfigured. In the
+Grafana Dashboard, given that there is no service configured, you should see a 0-valued flat plot again.
+
+### 2.4.5.4. Cleanup
+
+This last step performs a cleanup of the scenario removing all the TeraFlowSDN entities for completeness.
+
+To run this step, execute the `./ecoc22/run_test_04_cleanup.sh` script.
+
+When the script finishes, check the WebUI "Devices" tab, you should see that the devices have been removed. Besides, in
+the "Services" tab you can see that the "admin" Context has no services given that that context has been removed.
-- 
GitLab