Commit fc59f26b authored by kesnar's avatar kesnar
Browse files

backup

parent f1931d1c
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"
+8 −2
Original line number Diff line number Diff line
@@ -198,7 +198,9 @@ public class PolicyServiceImpl implements PolicyService {
                                return policyRuleState;
                            }
                            contextService.setPolicyRule(policyRule).subscribe().with(x -> {});
                            LOGGER.infof("THIS IS A TEST! 1");
                            setPolicyRuleServiceToContext(policyRuleService, VALIDATED_POLICYRULE_STATE);
                            LOGGER.infof("THIS IS A TEST! 2");
                            noAlarms = 0;

                            // Create an alarmIds list that contains the promised ids returned from setKpiAlarm
@@ -208,7 +210,8 @@ public class PolicyServiceImpl implements PolicyService {
                                LOGGER.infof(alarmDescriptor.toString());
                                alarmIds.add(monitoringService.setKpiAlarm(alarmDescriptor));
                            }

                            LOGGER.infof("THIS IS A TEST!");
                            LOGGER.infof("%s", alarmIds);
                            // Transform the alarmIds into promised alarms returned from the
                            // getAlarmResponseStream
                            List<Multi<AlarmResponse>> alarmResponseStreamList = new ArrayList<>();
@@ -725,7 +728,8 @@ public class PolicyServiceImpl implements PolicyService {
            // TODO: Temp fix for AlarmDescriptor object
            AlarmDescriptor alarmDescriptor =
                    new AlarmDescriptor(
                            "alarmId-" + gen(),
                            //"alarmId-" + gen(),
                            null,
                            "alarmDescription",
                            "alarmName-" + gen(),
                            policyRuleCondition.getKpiId(),
@@ -770,6 +774,7 @@ public class PolicyServiceImpl implements PolicyService {
        final var kpiValueRange = convertPolicyRuleConditionToKpiValueRange(policyRuleCondition);

        return new AlarmDescriptor(
                            //"alarmId-" + gen(),
                "alarmId-" + gen(),
                "alarmDescription",
                "alarmName-" + gen(),
@@ -800,6 +805,7 @@ public class PolicyServiceImpl implements PolicyService {
        }

        return new AlarmDescriptor(
                            //"alarmId-" + gen(),
                "alarmId-" + gen(),
                "alarmDescription",
                "alarmName-" + gen(),
+10 −7
Original line number Diff line number Diff line
@@ -23,6 +23,9 @@ quarkus:
      context:
        host: ${quarkus.kubernetes.env.vars.context-service-host}
        port: 1010
      context_policy:
        host: ${quarkus.kubernetes.env.vars.context-service-host}
        port: 1010
      monitoring:
        host: ${quarkus.kubernetes.env.vars.monitoring-service-host}
        port: 7070
@@ -60,11 +63,11 @@ quarkus:
        context-service-host: "contextservice"
        monitoring-service-host: "monitoringservice"
        service-service-host: "serviceservice"
    resources:
      requests:
        cpu: 50m
        memory: 512Mi
      limits:
        cpu: 500m
        memory: 2048Mi
#    resources:
#      requests:
#        cpu: 50m
#        memory: 512Mi
#      limits:
#        cpu: 500m
#        memory: 2048Mi
+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.
+14 −0
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.
Loading