Commit 9b75d8d8 authored by kesnar's avatar kesnar
Browse files

fix: policy fixes

parent 253c09f7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"
export TFS_COMPONENTS="${TFS_COMPONENTS} policy"

# Uncomment to activate Automation Manager
export TFS_COMPONENTS="${TFS_COMPONENTS} automation"
#export TFS_COMPONENTS="${TFS_COMPONENTS} automation"

# Uncomment to activate Optical CyberSecurity
#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager"
+15 −9
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ import eu.teraflow.policy.service.ServiceService;
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;
import io.smallrye.mutiny.groups.UniJoin;
import io.smallrye.mutiny.subscription.Cancellable;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
@@ -118,6 +119,7 @@ public class PolicyServiceImpl implements PolicyService {
            new ConcurrentHashMap<>();
    private ConcurrentHashMap<String, PolicyRuleDevice> alarmPolicyRuleDeviceMap =
            new ConcurrentHashMap<>();
    private ConcurrentHashMap<String, Cancellable> subscriptionList = new ConcurrentHashMap<>();

    @Inject
    public PolicyServiceImpl(
@@ -233,7 +235,9 @@ public class PolicyServiceImpl implements PolicyService {
                            final var multi = Multi.createBy().merging().streams(alarmResponseStreamList);
                            setPolicyRuleServiceToContext(policyRuleService, PROVISIONED_POLICYRULE_STATE);

                            monitorAlarmResponseForService(multi);
                            subscriptionList.put(
                                    policyRuleService.getPolicyRuleBasic().getPolicyRuleId(),
                                    monitorAlarmResponseForService(multi));

                            // TODO: Resubscribe to the stream, if it has ended

@@ -446,6 +450,9 @@ public class PolicyServiceImpl implements PolicyService {
                                                            "DeletePolicy with id: " + VALID_MESSAGE,
                                                            policyRuleBasic.getPolicyRuleId()));

                            contextService.removePolicyRule(policyRuleId);
                            subscriptionList.get(policyRuleId).cancel();

                            return policyRuleBasic.getPolicyRuleState();
                        });
    }
@@ -488,8 +495,8 @@ public class PolicyServiceImpl implements PolicyService {
        return alarmDescriptorList;
    }

    private void monitorAlarmResponseForService(Multi<AlarmResponse> multi) {
        multi
    private Cancellable monitorAlarmResponseForService(Multi<AlarmResponse> multi) {
        return multi
                .subscribe()
                .with(
                        alarmResponse -> {
@@ -728,8 +735,7 @@ public class PolicyServiceImpl implements PolicyService {
            // TODO: Temp fix for AlarmDescriptor object
            AlarmDescriptor alarmDescriptor =
                    new AlarmDescriptor(
                            //"alarmId-" + gen(),
                            null,
                            "",
                            "alarmDescription",
                            "alarmName-" + gen(),
                            policyRuleCondition.getKpiId(),
@@ -905,7 +911,7 @@ public class PolicyServiceImpl implements PolicyService {

        final var policyRuleTypeService = new PolicyRuleTypeService(policyRuleService);
        final var policyRule = new PolicyRule(policyRuleTypeService);
        contextService.setPolicyRule(policyRule);
        contextService.setPolicyRule(policyRule).subscribe().with(x -> {});
    }

    private void setPolicyRuleDeviceToContext(
@@ -918,6 +924,6 @@ public class PolicyServiceImpl implements PolicyService {

        final var policyRuleTypeService = new PolicyRuleTypeDevice(policyRuleDevice);
        final var policyRule = new PolicyRule(policyRuleTypeService);
        contextService.setPolicyRule(policyRule);
        contextService.setPolicyRule(policyRule).subscribe().with(x -> {});
    }
}
+104 −95
Original line number Diff line number Diff line
@@ -457,6 +457,10 @@ public final class ContextOuterClass {
     * <code>SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3;</code>
     */
    SERVICETYPE_TAPI_CONNECTIVITY_SERVICE(3),
    /**
     * <code>SERVICETYPE_TE = 4;</code>
     */
    SERVICETYPE_TE(4),
    UNRECOGNIZED(-1),
    ;
@@ -476,6 +480,10 @@ public final class ContextOuterClass {
     * <code>SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3;</code>
     */
    public static final int SERVICETYPE_TAPI_CONNECTIVITY_SERVICE_VALUE = 3;
    /**
     * <code>SERVICETYPE_TE = 4;</code>
     */
    public static final int SERVICETYPE_TE_VALUE = 4;
    public final int getNumber() {
@@ -506,6 +514,7 @@ public final class ContextOuterClass {
        case 1: return SERVICETYPE_L3NM;
        case 2: return SERVICETYPE_L2NM;
        case 3: return SERVICETYPE_TAPI_CONNECTIVITY_SERVICE;
        case 4: return SERVICETYPE_TE;
        default: return null;
      }
    }
@@ -74221,103 +74230,103 @@ public final class ContextOuterClass {
      "tionalStatusEnum\022%\n!DEVICEOPERATIONALSTA" +
      "TUS_UNDEFINED\020\000\022$\n DEVICEOPERATIONALSTAT" +
      "US_DISABLED\020\001\022#\n\037DEVICEOPERATIONALSTATUS" +
      "_ENABLED\020\002*\201\001\n\017ServiceTypeEnum\022\027\n\023SERVIC" +
      "_ENABLED\020\002*\225\001\n\017ServiceTypeEnum\022\027\n\023SERVIC" +
      "ETYPE_UNKNOWN\020\000\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n" +
      "\020SERVICETYPE_L2NM\020\002\022)\n%SERVICETYPE_TAPI_" +
      "CONNECTIVITY_SERVICE\020\003*\304\001\n\021ServiceStatus" +
      "Enum\022\033\n\027SERVICESTATUS_UNDEFINED\020\000\022\031\n\025SER" +
      "VICESTATUS_PLANNED\020\001\022\030\n\024SERVICESTATUS_AC" +
      "TIVE\020\002\022\032\n\026SERVICESTATUS_UPDATING\020\003\022!\n\035SE" +
      "RVICESTATUS_PENDING_REMOVAL\020\004\022\036\n\032SERVICE" +
      "STATUS_SLA_VIOLATED\020\005*\251\001\n\017SliceStatusEnu" +
      "m\022\031\n\025SLICESTATUS_UNDEFINED\020\000\022\027\n\023SLICESTA" +
      "TUS_PLANNED\020\001\022\024\n\020SLICESTATUS_INIT\020\002\022\026\n\022S" +
      "LICESTATUS_ACTIVE\020\003\022\026\n\022SLICESTATUS_DEINI" +
      "T\020\004\022\034\n\030SLICESTATUS_SLA_VIOLATED\020\005*]\n\020Con" +
      "figActionEnum\022\032\n\026CONFIGACTION_UNDEFINED\020" +
      "\000\022\024\n\020CONFIGACTION_SET\020\001\022\027\n\023CONFIGACTION_" +
      "DELETE\020\002*m\n\024ConstraintActionEnum\022\036\n\032CONS" +
      "TRAINTACTION_UNDEFINED\020\000\022\030\n\024CONSTRAINTAC" +
      "TION_SET\020\001\022\033\n\027CONSTRAINTACTION_DELETE\020\002*" +
      "\203\002\n\022IsolationLevelEnum\022\020\n\014NO_ISOLATION\020\000" +
      "\022\026\n\022PHYSICAL_ISOLATION\020\001\022\025\n\021LOGICAL_ISOL" +
      "ATION\020\002\022\025\n\021PROCESS_ISOLATION\020\003\022\035\n\031PHYSIC" +
      "AL_MEMORY_ISOLATION\020\004\022\036\n\032PHYSICAL_NETWOR" +
      "K_ISOLATION\020\005\022\036\n\032VIRTUAL_RESOURCE_ISOLAT" +
      "ION\020\006\022\037\n\033NETWORK_FUNCTIONS_ISOLATION\020\007\022\025" +
      "\n\021SERVICE_ISOLATION\020\0102\245\026\n\016ContextService" +
      "\022:\n\016ListContextIds\022\016.context.Empty\032\026.con" +
      "text.ContextIdList\"\000\0226\n\014ListContexts\022\016.c" +
      "ontext.Empty\032\024.context.ContextList\"\000\0224\n\n" +
      "GetContext\022\022.context.ContextId\032\020.context" +
      ".Context\"\000\0224\n\nSetContext\022\020.context.Conte" +
      "xt\032\022.context.ContextId\"\000\0225\n\rRemoveContex" +
      "t\022\022.context.ContextId\032\016.context.Empty\"\000\022" +
      "=\n\020GetContextEvents\022\016.context.Empty\032\025.co" +
      "ntext.ContextEvent\"\0000\001\022@\n\017ListTopologyId" +
      "s\022\022.context.ContextId\032\027.context.Topology" +
      "IdList\"\000\022=\n\016ListTopologies\022\022.context.Con" +
      "textId\032\025.context.TopologyList\"\000\0227\n\013GetTo" +
      "pology\022\023.context.TopologyId\032\021.context.To" +
      "pology\"\000\022E\n\022GetTopologyDetails\022\023.context" +
      ".TopologyId\032\030.context.TopologyDetails\"\000\022" +
      "7\n\013SetTopology\022\021.context.Topology\032\023.cont" +
      "ext.TopologyId\"\000\0227\n\016RemoveTopology\022\023.con" +
      "text.TopologyId\032\016.context.Empty\"\000\022?\n\021Get" +
      "TopologyEvents\022\016.context.Empty\032\026.context" +
      ".TopologyEvent\"\0000\001\0228\n\rListDeviceIds\022\016.co" +
      "ntext.Empty\032\025.context.DeviceIdList\"\000\0224\n\013" +
      "ListDevices\022\016.context.Empty\032\023.context.De" +
      "viceList\"\000\0221\n\tGetDevice\022\021.context.Device" +
      "Id\032\017.context.Device\"\000\0221\n\tSetDevice\022\017.con" +
      "text.Device\032\021.context.DeviceId\"\000\0223\n\014Remo" +
      "veDevice\022\021.context.DeviceId\032\016.context.Em" +
      "pty\"\000\022;\n\017GetDeviceEvents\022\016.context.Empty" +
      "\032\024.context.DeviceEvent\"\0000\001\022<\n\014SelectDevi" +
      "ce\022\025.context.DeviceFilter\032\023.context.Devi" +
      "ceList\"\000\022I\n\021ListEndPointNames\022\027.context." +
      "EndPointIdList\032\031.context.EndPointNameLis" +
      "t\"\000\0224\n\013ListLinkIds\022\016.context.Empty\032\023.con" +
      "text.LinkIdList\"\000\0220\n\tListLinks\022\016.context" +
      ".Empty\032\021.context.LinkList\"\000\022+\n\007GetLink\022\017" +
      ".context.LinkId\032\r.context.Link\"\000\022+\n\007SetL" +
      "ink\022\r.context.Link\032\017.context.LinkId\"\000\022/\n" +
      "\nRemoveLink\022\017.context.LinkId\032\016.context.E" +
      "mpty\"\000\0227\n\rGetLinkEvents\022\016.context.Empty\032" +
      "\022.context.LinkEvent\"\0000\001\022>\n\016ListServiceId" +
      "s\022\022.context.ContextId\032\026.context.ServiceI" +
      "dList\"\000\022:\n\014ListServices\022\022.context.Contex" +
      "tId\032\024.context.ServiceList\"\000\0224\n\nGetServic" +
      "e\022\022.context.ServiceId\032\020.context.Service\"" +
      "\000\0224\n\nSetService\022\020.context.Service\032\022.cont" +
      "ext.ServiceId\"\000\0226\n\014UnsetService\022\020.contex" +
      "t.Service\032\022.context.ServiceId\"\000\0225\n\rRemov" +
      "eService\022\022.context.ServiceId\032\016.context.E" +
      "mpty\"\000\022=\n\020GetServiceEvents\022\016.context.Emp" +
      "ty\032\025.context.ServiceEvent\"\0000\001\022?\n\rSelectS" +
      "ervice\022\026.context.ServiceFilter\032\024.context" +
      ".ServiceList\"\000\022:\n\014ListSliceIds\022\022.context" +
      ".ContextId\032\024.context.SliceIdList\"\000\0226\n\nLi" +
      "stSlices\022\022.context.ContextId\032\022.context.S" +
      "liceList\"\000\022.\n\010GetSlice\022\020.context.SliceId" +
      "\032\016.context.Slice\"\000\022.\n\010SetSlice\022\016.context" +
      ".Slice\032\020.context.SliceId\"\000\0220\n\nUnsetSlice" +
      "\022\016.context.Slice\032\020.context.SliceId\"\000\0221\n\013" +
      "RemoveSlice\022\020.context.SliceId\032\016.context." +
      "Empty\"\000\0229\n\016GetSliceEvents\022\016.context.Empt" +
      "y\032\023.context.SliceEvent\"\0000\001\0229\n\013SelectSlic" +
      "e\022\024.context.SliceFilter\032\022.context.SliceL" +
      "ist\"\000\022D\n\021ListConnectionIds\022\022.context.Ser" +
      "viceId\032\031.context.ConnectionIdList\"\000\022@\n\017L" +
      "istConnections\022\022.context.ServiceId\032\027.con" +
      "text.ConnectionList\"\000\022=\n\rGetConnection\022\025" +
      ".context.ConnectionId\032\023.context.Connecti" +
      "on\"\000\022=\n\rSetConnection\022\023.context.Connecti" +
      "on\032\025.context.ConnectionId\"\000\022;\n\020RemoveCon" +
      "nection\022\025.context.ConnectionId\032\016.context" +
      ".Empty\"\000\022C\n\023GetConnectionEvents\022\016.contex" +
      "t.Empty\032\030.context.ConnectionEvent\"\0000\001b\006p" +
      "roto3"
      "CONNECTIVITY_SERVICE\020\003\022\022\n\016SERVICETYPE_TE" +
      "\020\004*\304\001\n\021ServiceStatusEnum\022\033\n\027SERVICESTATU" +
      "S_UNDEFINED\020\000\022\031\n\025SERVICESTATUS_PLANNED\020\001" +
      "\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022\032\n\026SERVICESTA" +
      "TUS_UPDATING\020\003\022!\n\035SERVICESTATUS_PENDING_" +
      "REMOVAL\020\004\022\036\n\032SERVICESTATUS_SLA_VIOLATED\020" +
      "\005*\251\001\n\017SliceStatusEnum\022\031\n\025SLICESTATUS_UND" +
      "EFINED\020\000\022\027\n\023SLICESTATUS_PLANNED\020\001\022\024\n\020SLI" +
      "CESTATUS_INIT\020\002\022\026\n\022SLICESTATUS_ACTIVE\020\003\022" +
      "\026\n\022SLICESTATUS_DEINIT\020\004\022\034\n\030SLICESTATUS_S" +
      "LA_VIOLATED\020\005*]\n\020ConfigActionEnum\022\032\n\026CON" +
      "FIGACTION_UNDEFINED\020\000\022\024\n\020CONFIGACTION_SE" +
      "T\020\001\022\027\n\023CONFIGACTION_DELETE\020\002*m\n\024Constrai" +
      "ntActionEnum\022\036\n\032CONSTRAINTACTION_UNDEFIN" +
      "ED\020\000\022\030\n\024CONSTRAINTACTION_SET\020\001\022\033\n\027CONSTR" +
      "AINTACTION_DELETE\020\002*\203\002\n\022IsolationLevelEn" +
      "um\022\020\n\014NO_ISOLATION\020\000\022\026\n\022PHYSICAL_ISOLATI" +
      "ON\020\001\022\025\n\021LOGICAL_ISOLATION\020\002\022\025\n\021PROCESS_I" +
      "SOLATION\020\003\022\035\n\031PHYSICAL_MEMORY_ISOLATION\020" +
      "\004\022\036\n\032PHYSICAL_NETWORK_ISOLATION\020\005\022\036\n\032VIR" +
      "TUAL_RESOURCE_ISOLATION\020\006\022\037\n\033NETWORK_FUN" +
      "CTIONS_ISOLATION\020\007\022\025\n\021SERVICE_ISOLATION\020" +
      "\0102\245\026\n\016ContextService\022:\n\016ListContextIds\022\016" +
      ".context.Empty\032\026.context.ContextIdList\"\000" +
      "\0226\n\014ListContexts\022\016.context.Empty\032\024.conte" +
      "xt.ContextList\"\000\0224\n\nGetContext\022\022.context" +
      ".ContextId\032\020.context.Context\"\000\0224\n\nSetCon" +
      "text\022\020.context.Context\032\022.context.Context" +
      "Id\"\000\0225\n\rRemoveContext\022\022.context.ContextI" +
      "d\032\016.context.Empty\"\000\022=\n\020GetContextEvents\022" +
      "\016.context.Empty\032\025.context.ContextEvent\"\000" +
      "0\001\022@\n\017ListTopologyIds\022\022.context.ContextI" +
      "d\032\027.context.TopologyIdList\"\000\022=\n\016ListTopo" +
      "logies\022\022.context.ContextId\032\025.context.Top" +
      "ologyList\"\000\0227\n\013GetTopology\022\023.context.Top" +
      "ologyId\032\021.context.Topology\"\000\022E\n\022GetTopol" +
      "ogyDetails\022\023.context.TopologyId\032\030.contex" +
      "t.TopologyDetails\"\000\0227\n\013SetTopology\022\021.con" +
      "text.Topology\032\023.context.TopologyId\"\000\0227\n\016" +
      "RemoveTopology\022\023.context.TopologyId\032\016.co" +
      "ntext.Empty\"\000\022?\n\021GetTopologyEvents\022\016.con" +
      "text.Empty\032\026.context.TopologyEvent\"\0000\001\0228" +
      "\n\rListDeviceIds\022\016.context.Empty\032\025.contex" +
      "t.DeviceIdList\"\000\0224\n\013ListDevices\022\016.contex" +
      "t.Empty\032\023.context.DeviceList\"\000\0221\n\tGetDev" +
      "ice\022\021.context.DeviceId\032\017.context.Device\"" +
      "\000\0221\n\tSetDevice\022\017.context.Device\032\021.contex" +
      "t.DeviceId\"\000\0223\n\014RemoveDevice\022\021.context.D" +
      "eviceId\032\016.context.Empty\"\000\022;\n\017GetDeviceEv" +
      "ents\022\016.context.Empty\032\024.context.DeviceEve" +
      "nt\"\0000\001\022<\n\014SelectDevice\022\025.context.DeviceF" +
      "ilter\032\023.context.DeviceList\"\000\022I\n\021ListEndP" +
      "ointNames\022\027.context.EndPointIdList\032\031.con" +
      "text.EndPointNameList\"\000\0224\n\013ListLinkIds\022\016" +
      ".context.Empty\032\023.context.LinkIdList\"\000\0220\n" +
      "\tListLinks\022\016.context.Empty\032\021.context.Lin" +
      "kList\"\000\022+\n\007GetLink\022\017.context.LinkId\032\r.co" +
      "ntext.Link\"\000\022+\n\007SetLink\022\r.context.Link\032\017" +
      ".context.LinkId\"\000\022/\n\nRemoveLink\022\017.contex" +
      "t.LinkId\032\016.context.Empty\"\000\0227\n\rGetLinkEve" +
      "nts\022\016.context.Empty\032\022.context.LinkEvent\"" +
      "\0000\001\022>\n\016ListServiceIds\022\022.context.ContextI" +
      "d\032\026.context.ServiceIdList\"\000\022:\n\014ListServi" +
      "ces\022\022.context.ContextId\032\024.context.Servic" +
      "eList\"\000\0224\n\nGetService\022\022.context.ServiceI" +
      "d\032\020.context.Service\"\000\0224\n\nSetService\022\020.co" +
      "ntext.Service\032\022.context.ServiceId\"\000\0226\n\014U" +
      "nsetService\022\020.context.Service\032\022.context." +
      "ServiceId\"\000\0225\n\rRemoveService\022\022.context.S" +
      "erviceId\032\016.context.Empty\"\000\022=\n\020GetService" +
      "Events\022\016.context.Empty\032\025.context.Service" +
      "Event\"\0000\001\022?\n\rSelectService\022\026.context.Ser" +
      "viceFilter\032\024.context.ServiceList\"\000\022:\n\014Li" +
      "stSliceIds\022\022.context.ContextId\032\024.context" +
      ".SliceIdList\"\000\0226\n\nListSlices\022\022.context.C" +
      "ontextId\032\022.context.SliceList\"\000\022.\n\010GetSli" +
      "ce\022\020.context.SliceId\032\016.context.Slice\"\000\022." +
      "\n\010SetSlice\022\016.context.Slice\032\020.context.Sli" +
      "ceId\"\000\0220\n\nUnsetSlice\022\016.context.Slice\032\020.c" +
      "ontext.SliceId\"\000\0221\n\013RemoveSlice\022\020.contex" +
      "t.SliceId\032\016.context.Empty\"\000\0229\n\016GetSliceE" +
      "vents\022\016.context.Empty\032\023.context.SliceEve" +
      "nt\"\0000\001\0229\n\013SelectSlice\022\024.context.SliceFil" +
      "ter\032\022.context.SliceList\"\000\022D\n\021ListConnect" +
      "ionIds\022\022.context.ServiceId\032\031.context.Con" +
      "nectionIdList\"\000\022@\n\017ListConnections\022\022.con" +
      "text.ServiceId\032\027.context.ConnectionList\"" +
      "\000\022=\n\rGetConnection\022\025.context.ConnectionI" +
      "d\032\023.context.Connection\"\000\022=\n\rSetConnectio" +
      "n\022\023.context.Connection\032\025.context.Connect" +
      "ionId\"\000\022;\n\020RemoveConnection\022\025.context.Co" +
      "nnectionId\032\016.context.Empty\"\000\022C\n\023GetConne" +
      "ctionEvents\022\016.context.Empty\032\030.context.Co" +
      "nnectionEvent\"\0000\001b\006proto3"
    };
    descriptor = com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
+8 −28
Original line number Diff line number Diff line
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
---
apiVersion: v1
kind: Service
metadata:
  annotations:
    app.quarkus.io/commit-id: 8d0654b519e90fe0127e7d1419adce25fa3a179d
    app.quarkus.io/build-timestamp: 2023-07-10 - 09:41:26 +0000
    app.quarkus.io/commit-id: 253c09f7b13dadba57439fb61916ecde0b7af751
    app.quarkus.io/build-timestamp: 2023-10-02 - 10:48:40 +0000
    prometheus.io/scrape: "true"
    prometheus.io/path: /q/metrics
    prometheus.io/port: "8080"
@@ -42,8 +29,8 @@ apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    app.quarkus.io/commit-id: 8d0654b519e90fe0127e7d1419adce25fa3a179d
    app.quarkus.io/build-timestamp: 2023-07-10 - 09:41:26 +0000
    app.quarkus.io/commit-id: 253c09f7b13dadba57439fb61916ecde0b7af751
    app.quarkus.io/build-timestamp: 2023-10-02 - 10:48:40 +0000
    prometheus.io/scrape: "true"
    prometheus.io/path: /q/metrics
    prometheus.io/port: "8080"
@@ -60,8 +47,8 @@ spec:
  template:
    metadata:
      annotations:
        app.quarkus.io/commit-id: 8d0654b519e90fe0127e7d1419adce25fa3a179d
        app.quarkus.io/build-timestamp: 2023-07-10 - 09:41:26 +0000
        app.quarkus.io/commit-id: 253c09f7b13dadba57439fb61916ecde0b7af751
        app.quarkus.io/build-timestamp: 2023-10-02 - 10:48:40 +0000
        prometheus.io/scrape: "true"
        prometheus.io/path: /q/metrics
        prometheus.io/port: "8080"
@@ -76,12 +63,12 @@ spec:
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: MONITORING_SERVICE_HOST
              value: monitoringservice
            - name: CONTEXT_SERVICE_HOST
              value: contextservice
            - name: SERVICE_SERVICE_HOST
              value: serviceservice
            - name: MONITORING_SERVICE_HOST
              value: monitoringservice
          image: labs.etsi.org:5050/tfs/controller/policy:0.1.0
          imagePullPolicy: Always
          livenessProbe:
@@ -112,10 +99,3 @@ spec:
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 10
          resources:
            limits:
              cpu: 500m
              memory: 2048Mi
            requests:
              cpu: 50m
              memory: 512Mi
+41 −0
Original line number Diff line number Diff line
# Tests for P4 functionality of TeraFlowSDN

This directory contains the necessary scripts and configurations to run tests for the P4 functionality of TFS.

## Basic scripts

To run the experiments you should use the five scripts in the following order:
```
setup.sh
run_test_01_bootstrap.sh
run_test_02_create_service.sh
run_test_03_delete_service.sh
run_test_04_cleanup.sh
```

The setup script copies the necessary artifacts to the SBI service pod. It should be run just once, after a fresh install of TFS.
The bootstrap script registers the context, topology, links and, devices to TFS.
The create service scripts establishes a service between two endpoints.
The delete service script delete the aforementioned service.
Cleanup script deletes all the objects (context, topology, links, devices) from TFS.

## Objects file

The above bash scripts make use of the corresponding python scripts found under `./tests/` directory.
More important is the `./tests/Objects.py` file, which contains the definition of the Context, Topology, Devices, Links, Services. **This is the file that need changes in case of a new topology.**

Check the `./tests/Objects.py` file before running the experiment to make sure that the switches details are correct (ip address, port, etc.)

## Mininet topologies

In the `./mininet/` directory there are different mininet topology examples. The current `./tests/Objects.py` file corresponds to the `./mininet/4switch2path.py` topology. For more topologies please refer to `../p4`.

## P4 artifacts

In the `./p4/` directory there are the compiled p4 artifacts that contain the pipeline that will be pushed to the p4 switch, along with the p4-runtime definitions. 
The `./setup.sh` script copies from this directory. So if you need to change p4 program, make sure to put the compiled artifacts here.

## Latency probe

In the `./probe/` directory there is a little program which calculates latency between two hosts in mininet and sends them to the Monitoring component. For specific instructions, refer to the corresponding `./probe/README.md` file.
Loading