diff options
author | krishnaa96 <krishna.moorthy6@wipro.com> | 2021-04-08 14:14:48 +0530 |
---|---|---|
committer | krishnaa96 <krishna.moorthy6@wipro.com> | 2021-04-08 14:14:48 +0530 |
commit | 7ef613de6d9cd794fd10ae43d98ffa9312418e68 (patch) | |
tree | 7fb698b06166d0227b6dc8c04347df4c5a11ed18 /test/functest/simulators | |
parent | aafb48a95fe5ace431ebe607cab660fddde8c2cc (diff) |
Update AAI query to DSL query - Slice termination
Issue-ID: OPTFRA-936
Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com>
Change-Id: I7a2bba7d23645c8bff9f503361a93fd3ac3ebc3a
Diffstat (limited to 'test/functest/simulators')
-rw-r--r-- | test/functest/simulators/oof_dependencies_simulators.py | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/test/functest/simulators/oof_dependencies_simulators.py b/test/functest/simulators/oof_dependencies_simulators.py index b0b7b32..53cc74e 100644 --- a/test/functest/simulators/oof_dependencies_simulators.py +++ b/test/functest/simulators/oof_dependencies_simulators.py @@ -23,7 +23,7 @@ import glob import json import os -from flask import Flask, jsonify +from flask import Flask, jsonify, request from osdf.utils.interfaces import json_from_file @@ -119,5 +119,45 @@ def get_nbr_list(cell_id, ts): return jsonify(data), 503 +@app.route("/simulated/aai/v23/dsl", methods=["PUT"]) +def dsl_query(): + + nsi_query = {"dsl": "service-instance*('service-instance-id','9629e36c-a3d9-4aed-8368-f72b8be1cd34') > " + "service-instance*('service-role','e2eserviceprofile-service')"} + + nssi_query = {"dsl": "service-instance*('service-instance-id','9629e36c-a3d9-4aed-8368-f72b8be1cd34') > " + "service-instance*('service-role','nsi')"} + + nsi_with_sp_query = {"dsl": "service-instance*('service-instance-id','9629e36c-a3d9-4aed-8368-f72b8be1cd34') > " + "service-instance*('service-role','e2eserviceprofile-service')(" + "'service-instance-id'," + "'660ca85c-1a0f-4521-a559-65f23e794699660ca85c-1a0f-4521-a559-65f23e794699')"} + + nssi_with_nsi_query = {"dsl": "service-instance*('service-instance-id','9629e36c-a3d9-4aed-8368-f72b8be1cd34') > " + "service-instance*('service-role','nsi')('service-instance-id'," + "'660ca85c-1a0f-4521-a559-65f23e794699')"} + + queries = { + "nsi": nsi_query, + "nssi_query": nssi_query, + "nsi_with_sp": nsi_with_sp_query, + "nssi_with_nsi": nssi_with_nsi_query + } + + count = { + "nsi": 1, + "nssi_query": 1, + "nsi_with_sp": 2, + "nssi_with_nsi": 2 + } + + request_body = request.get_json() + service_count = 0 + for query_type, query in queries.items(): + if request_body == query: + service_count = count[query_type] + return {'results': [{'service-instance': service_count}]} + + if __name__ == "__main__": app.run(debug=True, host='0.0.0.0') |