Commit 963cb8ad authored by Pablo Armingol's avatar Pablo Armingol
Browse files

Merge branch 'develop' of https://labs.etsi.org/rep/tfs/controller into...

Merge branch 'develop' of https://labs.etsi.org/rep/tfs/controller into feat/381-tid-new-nbi-for-optical-slices
parents 6ae0b169 a89808fe
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ class WimconnectorIETFL2VPN(SdnConnectorBase):
        """
        SETTINGS = {    # min_endpoints, max_endpoints, vpn_service_type
            'ELINE': (2,    2, 'vpws'), # Virtual Private Wire Service
            'ELAN' : (2, None, 'vpls'), # Virtual Private LAN  Service
            'ELAN' : (2, None, 'bgp-vpls'), # Virtual Private LAN  Service
        }
        settings = SETTINGS.get(service_type)
        if settings is None: raise NotImplementedError('Unsupported service_type({:s})'.format(str(service_type)))
@@ -291,12 +291,12 @@ class WimconnectorIETFL2VPN(SdnConnectorBase):
            if access_priority is not None:
                availability = {}
                availability["access-priority"] = access_priority
                availability["single-active"] = [None]
                availability["single-active"] = None
                site_network_access["availability"] = availability

                constraint = {}
                constraint['constraint-type'] = 'end-to-end-diverse'
                constraint['target'] = {'all-other-accesses': [None]}
                constraint['target'] = {'all-other-accesses': None}

                access_diversity = {}
                access_diversity['constraints'] = {'constraint': []}
+0 −1
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ enum KpiSampleType {
    KPISAMPLETYPE_ML_CONFIDENCE                 = 401;  //. can be used by both optical and L3 without any issue

    KPISAMPLETYPE_OPTICAL_SECURITY_STATUS       = 501;  //. can be used by both optical and L3 without any issue
    KPISAMPLETYPE_OPTICAL_POWER_TOTAL_INPUT     = 502;
    KPISAMPLETYPE_OPTICAL_TOTAL_INPUT_POWER     = 503;

    KPISAMPLETYPE_L3_UNIQUE_ATTACK_CONNS        = 601;
+35 −2
Original line number Diff line number Diff line
@@ -19,11 +19,44 @@ PROJECTDIR=`pwd`
cd $PROJECTDIR/src
# RCFILE=$PROJECTDIR/coverage/.coveragerc

export KFK_SERVER_ADDRESS='127.0.0.1:9092'
CRDB_SQL_ADDRESS=$(kubectl get service cockroachdb-public --namespace crdb -o jsonpath='{.spec.clusterIP}')
export CRDB_URI="cockroachdb://tfs:tfs123@${CRDB_SQL_ADDRESS}:26257/tfs_telemetry?sslmode=require"
RCFILE=$PROJECTDIR/coverage/.coveragerc
# RCFILE=$PROJECTDIR/coverage/.coveragerc

export KFK_SERVER_ADDRESS='127.0.0.1:9094'

IP_KPI=$(kubectl get all --all-namespaces | grep service/kpi-managerservice | awk '{print $4}')
export IP_KPI
echo "KPI Manager Service IP: ${IP_KPI}"

IP_TELE=$(kubectl get all --all-namespaces | grep service/telemetryservice | awk '{print $4}')
export IP_TELE
echo "Telemetry Frontend Service IP: ${IP_TELE}"

IP_CONTEXT=$(kubectl get all --all-namespaces | grep service/contextservice | awk '{print $4}')
export IP_CONTEXT
echo "Context Service IP: ${IP_CONTEXT}"

# Start Kafka port-forward in background
kubectl port-forward -n kafka service/kafka-public 9094:9094 > /dev/null 2>&1 &
KAFKA_PF_PID=$!

# Function to cleanup port-forward on exit
cleanup() {
    # echo "Cleaning up Kafka port-forward (PID: ${KAFKA_PF_PID})..."
    kill ${KAFKA_PF_PID} 2>/dev/null || true
    wait ${KAFKA_PF_PID} 2>/dev/null || true
    sleep 1
}

trap cleanup EXIT INT TERM
echo "Waiting for Kafka port-forward to be ready..."
sleep 1

# Verify port-forward is working
if ! nc -z 127.0.0.1 9094 2>/dev/null; then
    echo "WARNING: Kafka port-forward may not be ready yet"
fi

python3 -m pytest --log-level=INFO --log-cli-level=INFO --verbose \
    telemetry/backend/tests/test_backend.py
+13 −0
Original line number Diff line number Diff line
@@ -19,6 +19,19 @@ RCFILE=$PROJECTDIR/coverage/.coveragerc

export KFK_SERVER_ADDRESS='127.0.0.1:9092'


IP_KPI=$(kubectl get all --all-namespaces | grep service/kpi-managerservice | awk '{print $4}')
export IP_KPI
echo "KPI Manager Service IP: ${IP_KPI}"

IP_TELE=$(kubectl get all --all-namespaces | grep service/telemetryservice | awk '{print $4}')
export IP_TELE
echo "Telemetry Frontend Service IP: ${IP_TELE}"

IP_CONTEXT=$(kubectl get all --all-namespaces | grep service/contextservice | awk '{print $4}')
export IP_CONTEXT
echo "Context Service IP: ${IP_CONTEXT}"

# This is unit test (should be tested with container-lab running)
python3 -m pytest --log-level=info --log-cli-level=info --verbose \
    telemetry/backend/tests/gnmi_oc/test_unit_GnmiOpenConfigCollector.py::test_full_workflow
+3 −3
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ class WimconnectorIETFL2VPN(SdnConnectorBase):
        """
        SETTINGS = {    # min_endpoints, max_endpoints, vpn_service_type
            'ELINE': (2,    2, 'vpws'), # Virtual Private Wire Service
            'ELAN' : (2, None, 'vpls'), # Virtual Private LAN  Service
            'ELAN' : (2, None, 'bgp-vpls'), # Virtual Private LAN  Service
        }
        settings = SETTINGS.get(service_type)
        if settings is None: raise NotImplementedError('Unsupported service_type({:s})'.format(str(service_type)))
@@ -288,12 +288,12 @@ class WimconnectorIETFL2VPN(SdnConnectorBase):
            if access_priority is not None:
                availability = {}
                availability["access-priority"] = access_priority
                availability["single-active"] = [None]
                availability["single-active"] = None
                site_network_access["availability"] = availability

                constraint = {}
                constraint['constraint-type'] = 'end-to-end-diverse'
                constraint['target'] = {'all-other-accesses': [None]}
                constraint['target'] = {'all-other-accesses': None}

                access_diversity = {}
                access_diversity['constraints'] = {'constraint': []}
Loading