Commit 8d671884 authored by Andrea Sgambelluri's avatar Andrea Sgambelluri
Browse files

tests: add the point-to-multipoint optical bench scenario

Descriptors, simulator configuration and the scripts that start and stop
the node agents for the P2MP scenario: leaves T1.1-T1.3 served by hub
T2.1 across two ROADMs.

Configuration only, with no pytest files. The functional tests this
scenario was developed with were copies of ofc24's and still pointed at
that folder's descriptors, so they could not run here; shipping them
would only claim a coverage that does not exist.

The agent scripts took their configuration from an absolute path on one
machine and published their ports on that machine's address. They now
resolve the configuration next to themselves and honour
NODE_AGENT_BIND_ADDR.

The README states what still has to be adapted: the transponder
descriptors address real bench hardware, and the topology declares no
links, which the optical controller needs to compute a path.
parent 041b3d0b
Loading
Loading
Loading
Loading
+60 −0
Changes for src/tests/PMPv1/README.md: 60 added lines, 0 removed lines.
Original line number Diff line number Diff line
# PMPv1 — point-to-multipoint optical scenario

Bench configuration for the point-to-multipoint (P2MP) optical scenario: one
hub transponder serving several leaf transponders across two ROADMs, used to
exercise the optical controller's P2MP path computation and the OpenConfig
driver's per-remote digital subcarrier groups.

This folder is **configuration and descriptors only**. It deliberately ships no
pytest files: the functional tests this scenario was developed with were
derived from `ofc24` and still referenced that folder's descriptors, so they
could not run here. Drive the scenario by hand as described below.

## Contents

| Path | Purpose |
|---|---|
| `descriptors/context.json` | admin context and topology |
| `descriptors/leaf_hub.json` | the devices: leaves T1.1–T1.3, hub T2.1, ROADMs R1/R2, pluggable hosts |
| `descriptors/pmp_bidir.json` | a bidirectional P2MP service, T1.1/T1.2/T1.3 → T2.1 |
| `descriptors/pmp_unidir.json` | the unidirectional equivalent |
| `node-agents-config/` | ConfD platform and transponder configuration for the simulators |
| `tree_transponders.sh` | starts three simulated transponders on ports 2023–2025 |
| `tree_roadms.sh` | starts the two simulated ROADMs on ports 2027–2028 |
| `remove_tree.sh` | stops and removes all of the above |
| `deploy_specs.sh` | TFS deployment settings used for this scenario |

## Running it

```bash
# From the repository root, with a deployed TFS:
source src/tests/PMPv1/deploy_specs.sh
./src/tests/PMPv1/tree_roadms.sh
./src/tests/PMPv1/tree_transponders.sh

# Load the scenario
./src/tests/tools/load_scenario/run.sh src/tests/PMPv1/descriptors/context.json
./src/tests/tools/load_scenario/run.sh src/tests/PMPv1/descriptors/leaf_hub.json
./src/tests/tools/load_scenario/run.sh src/tests/PMPv1/descriptors/pmp_bidir.json

# Tear down
./src/tests/PMPv1/remove_tree.sh
```

`NODE_AGENT_BIND_ADDR` controls the address the simulators publish their
NETCONF ports on; it defaults to all interfaces.

## Adapt before use

Unlike `ofc24` and `ofc25`, whose descriptors address the simulators their own
scripts create, this scenario was run against a mixed bench and its descriptors
are **site specific**:

- The leaf and hub transponders (`T1.1`–`T1.3`, `T2.1`) and the pluggable hosts
  (`r1_optical`, `r2_optical`) address real hardware on the CNIT bench
  (`10.30.7.7`, `10.30.7.8`). Repoint them at your own devices, or at the
  simulators started above.
- Only the ROADMs `R1`/`R2` match the simulators here, on ports 2027 and 2028.
- `leaf_hub.json` declares no links. The optical controller builds its graph
  from the links in Context, so add the links for your topology before
  requesting a P2MP service, or no path will be computed.
+167 −0
Changes for src/tests/PMPv1/deploy_specs.sh: 167 added lines, 0 removed lines.
Original line number Diff line number Diff line
#!/bin/bash
# Copyright 2022-2024 ETSI 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.


# ----- TeraFlowSDN ------------------------------------------------------------

# Set the URL of the internal MicroK8s Docker registry where the images will be uploaded to.
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 load_generator"
export TFS_COMPONENTS="context device pathcomp service nbi slice webui"

# Uncomment to activate Monitoring
#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"

# Uncomment to activate BGP-LS Speaker
#export TFS_COMPONENTS="${TFS_COMPONENTS} bgpls_speaker"

# Uncomment to activate Optical Controller
# To manage optical connections, "service" requires "opticalcontroller" to be deployed
# before "service", thus we "hack" the TFS_COMPONENTS environment variable prepending the
# "opticalcontroller" only if "service" is already in TFS_COMPONENTS, and re-export it.
if [[ "$TFS_COMPONENTS" == *"service"* ]]; then
    BEFORE="${TFS_COMPONENTS% service*}"
    AFTER="${TFS_COMPONENTS#* service}"
    export TFS_COMPONENTS="${BEFORE} opticalcontroller service ${AFTER}"
fi

# Uncomment to activate ZTP
#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp"

# Uncomment to activate Policy Manager
#export TFS_COMPONENTS="${TFS_COMPONENTS} policy"

# Uncomment to activate Optical CyberSecurity
#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager"

# Uncomment to activate L3 CyberSecurity
#export TFS_COMPONENTS="${TFS_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector"

# Uncomment to activate TE
#export TFS_COMPONENTS="${TFS_COMPONENTS} te"

# Uncomment to activate Forecaster
#export TFS_COMPONENTS="${TFS_COMPONENTS} forecaster"

# Uncomment to activate E2E Orchestrator
#export TFS_COMPONENTS="${TFS_COMPONENTS} e2e_orchestrator"

# Set the tag you want to use for your images.
export TFS_IMAGE_TAG="dev"

# Set the name of the Kubernetes namespace to deploy TFS to.
export TFS_K8S_NAMESPACE="tfs"

# Set additional manifest files to be applied after the deployment
export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml"

# Uncomment to monitor performance of components
export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/servicemonitors.yaml"

# Uncomment when deploying Optical CyberSecurity
#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/cachingservice.yaml"

# Set the new Grafana admin password
export TFS_GRAFANA_PASSWORD="admin123+"

# Disable skip-build flag to rebuild the Docker images.
export TFS_SKIP_BUILD=""


# ----- CockroachDB ------------------------------------------------------------

# Set the namespace where CockroackDB will be deployed.
export CRDB_NAMESPACE="crdb"

# Set the external port CockroackDB Postgre SQL interface will be exposed to.
export CRDB_EXT_PORT_SQL="26257"

# Set the external port CockroackDB HTTP Mgmt GUI interface will be exposed to.
export CRDB_EXT_PORT_HTTP="8081"

# Set the database username to be used by Context.
export CRDB_USERNAME="tfs"

# Set the database user's password to be used by Context.
export CRDB_PASSWORD="tfs123"

# Set CockroachDB installation mode to 'single'. This option is convenient for development and testing.
# See ./deploy/all.sh or ./deploy/crdb.sh for additional details
export CRDB_DEPLOY_MODE="single"

# Disable flag for dropping database, if it exists.
export CRDB_DROP_DATABASE_IF_EXISTS="YES"

# Disable flag for re-deploying CockroachDB from scratch.
export CRDB_REDEPLOY="YES"


# ----- NATS -------------------------------------------------------------------

# Set the namespace where NATS will be deployed.
export NATS_NAMESPACE="nats"

# Set the external port NATS Client interface will be exposed to.
export NATS_EXT_PORT_CLIENT="4222"

# Set the external port NATS HTTP Mgmt GUI interface will be exposed to.
export NATS_EXT_PORT_HTTP="8222"

# Disable flag for re-deploying NATS from scratch.
export NATS_REDEPLOY=""


# ----- QuestDB ----------------------------------------------------------------

# Set the namespace where QuestDB will be deployed.
export QDB_NAMESPACE="qdb"

# Set the external port QuestDB Postgre SQL interface will be exposed to.
export QDB_EXT_PORT_SQL="8812"

# Set the external port QuestDB Influx Line Protocol interface will be exposed to.
export QDB_EXT_PORT_ILP="9009"

# Set the external port QuestDB HTTP Mgmt GUI interface will be exposed to.
export QDB_EXT_PORT_HTTP="9000"

# Set the database username to be used for QuestDB.
export QDB_USERNAME="admin"

# Set the database user's password to be used for QuestDB.
export QDB_PASSWORD="quest"

# Set the table name to be used by Monitoring for KPIs.
export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis"

# Set the table name to be used by Slice for plotting groups.
export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups"

# Disable flag for dropping tables if they exist.
export QDB_DROP_TABLES_IF_EXIST="YES"

# Disable flag for re-deploying QuestDB from scratch.
export QDB_REDEPLOY=""


# ----- K8s Observability ------------------------------------------------------

# Set the external port Prometheus Mgmt HTTP GUI interface will be exposed to.
export PROM_EXT_PORT_HTTP="9090"

# Set the external port Grafana HTTP Dashboards will be exposed to.
export GRAF_EXT_PORT_HTTP="3000"
+11 −0
Changes for src/tests/PMPv1/descriptors/context.json: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
{
    "contexts": [
        {"context_id": {"context_uuid": {"uuid": "admin"}}}
    ],
    "topologies": [
        {"topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}},
        "device_ids":[],
        "link_ids":[]
        }
    ]
}
 No newline at end of file
+1282 −0

File added.

Preview size limit exceeded, changes collapsed.

+26 −0
Changes for src/tests/PMPv1/descriptors/pmp_bidir.json: 26 added lines, 0 removed lines.
Original line number Diff line number Diff line
{
    "services": [
        {
            "service_id": {
                "context_id": {"context_uuid": {"uuid": "admin"}},
                "service_uuid": {"uuid": "optical-connection-bidir"}
            },
            "service_type": 6,
            "service_status": {"service_status": 1},
            "service_endpoint_ids": [
                {"device_id": {"device_uuid": {"uuid": "T1.1"}}, "endpoint_uuid": {"uuid": "1"}},
                {"device_id": {"device_uuid": {"uuid": "T1.2"}}, "endpoint_uuid": {"uuid": "3"}},
                {"device_id": {"device_uuid": {"uuid": "T1.3"}}, "endpoint_uuid": {"uuid": "5"}},
                {"device_id": {"device_uuid": {"uuid": "T2.1"}}, "endpoint_uuid": {"uuid": "1"}}
            ],
            "service_constraints": [
                {"custom": {"constraint_type": "bandwidth[gbps]", "constraint_value": "100.0"}},
                {"custom": {"constraint_type": "bidirectionality", "constraint_value": "1"}},
                {"custom": {"constraint_type": "type", "constraint_value": "pmp"}},
                {"custom": {"constraint_type": "optical-band-width[GHz]", "constraint_value": "200"}},
                {"custom": {"constraint_type": "subcarriers_per_src", "constraint_value": "4,4,4"}}
            ],
            "service_config": {"config_rules": []}
        }
    ]
}
 No newline at end of file
Loading