Commit adfd2178 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Tools - Mock MW SDN Ctrl:

- Renamed folder
- Improved error reporting
parent f29a712f
Loading
Loading
Loading
Loading
+27 −23
Original line number Diff line number Diff line
@@ -37,30 +37,30 @@ LOG_LEVEL = logging.DEBUG

NETWORK_NODES = [
    {'node-id': '172.18.0.1', 'ietf-network-topology:termination-point': [
        {'tp-id': '172.18.0.1:1', 'ietf-te-topology:te': {'name': 'ethernet'}},
        {'tp-id': '172.18.0.1:2', 'ietf-te-topology:te': {'name': 'antena'  }},
        {'tp-id': '1', 'ietf-te-topology:te': {'name': 'ethernet'}},
        {'tp-id': '2', 'ietf-te-topology:te': {'name': 'antena'  }},
    ]},
    {'node-id': '172.18.0.2', 'ietf-network-topology:termination-point': [
        {'tp-id': '172.18.0.2:1', 'ietf-te-topology:te': {'name': 'ethernet'}},
        {'tp-id': '172.18.0.2:2', 'ietf-te-topology:te': {'name': 'antena'  }},
        {'tp-id': '1', 'ietf-te-topology:te': {'name': 'ethernet'}},
        {'tp-id': '2', 'ietf-te-topology:te': {'name': 'antena'  }},
    ]},
    {'node-id': '172.18.0.3', 'ietf-network-topology:termination-point': [
        {'tp-id': '172.18.0.3:1', 'ietf-te-topology:te': {'name': 'ethernet'}},
        {'tp-id': '172.18.0.3:2', 'ietf-te-topology:te': {'name': 'antena'  }},
        {'tp-id': '1', 'ietf-te-topology:te': {'name': 'ethernet'}},
        {'tp-id': '2', 'ietf-te-topology:te': {'name': 'antena'  }},
    ]},
    {'node-id': '172.18.0.4', 'ietf-network-topology:termination-point': [
        {'tp-id': '172.18.0.4:1', 'ietf-te-topology:te': {'name': 'ethernet'}},
        {'tp-id': '172.18.0.4:2', 'ietf-te-topology:te': {'name': 'antena'  }},
        {'tp-id': '1', 'ietf-te-topology:te': {'name': 'ethernet'}},
        {'tp-id': '2', 'ietf-te-topology:te': {'name': 'antena'  }},
    ]}
]
NETWORK_LINKS = [
    {
        'source'     : {'source-node': '172.18.0.1', 'source-tp': '172.18.0.1:2'},
        'destination': {'dest-node'  : '172.18.0.2', 'dest-tp'  : '172.18.0.2:2'},
        'source'     : {'source-node': '172.18.0.1', 'source-tp': '2'},
        'destination': {'dest-node'  : '172.18.0.2', 'dest-tp'  : '2'},
    },
    {
        'source'     : {'source-node': '172.18.0.3', 'source-tp': '172.18.0.3:2'},
        'destination': {'dest-node'  : '172.18.0.4', 'dest-tp'  : '172.18.0.4:2'},
        'source'     : {'source-node': '172.18.0.3', 'source-tp': '2'},
        'destination': {'dest-node'  : '172.18.0.4', 'dest-tp'  : '2'},
    }
]
NETWORK_SERVICES = {}
@@ -91,6 +91,7 @@ class Services(Resource):
        return jsonify({'ietf-eth-tran-service:etht-svc': {'etht-svc-instances': services}})

    def post(self):
        try:
            json_request = request.json
            if not json_request: abort(400)
            if not isinstance(json_request, dict): abort(400)
@@ -102,6 +103,9 @@ class Services(Resource):
            etht_svc_name = svc_data['etht-svc-name']
            NETWORK_SERVICES[etht_svc_name] = svc_data
            return jsonify({}), 201
        except:
            LOGGER.exception('Exception in POST')


class DelServices(Resource):
    def delete(self, service_uuid : str):
+3 −3
Original line number Diff line number Diff line
@@ -12,8 +12,8 @@ Follow the steps below to perform the test:
## 1. Deploy TeraFlowSDN controller and the scenario
Deploy the test scenario "microwave_deploy.sh":
```bash
source src/tests/tools/microwave_deploy.sh
./deploy.sh
source src/tests/tools/mock_mw_sdn_ctrl/scenario/microwave_deploy.sh
./deploy/all.sh
```

## 2. Install requirements and run the Mock MicroWave SDN controller
@@ -27,7 +27,7 @@ pip install Flask==2.1.3 Flask-RESTful==0.3.9

Run the Mock MicroWave SDN Controller as follows:
```bash
python src/tests/tools/mock_sdn_ctrl/MockMWSdnCtrl.py
python src/tests/tools/mock_mw_sdn_ctrl/MockMWSdnCtrl.py
```

## 3. Deploy the test descriptors
Loading