aboutsummaryrefslogtreecommitdiffstats
path: root/test/functest/simulators
diff options
context:
space:
mode:
Diffstat (limited to 'test/functest/simulators')
-rw-r--r--test/functest/simulators/aai/response-payloads/nsi_instance.json13
-rw-r--r--test/functest/simulators/aai/response-payloads/nsi_instance_with_args.json45
-rwxr-xr-xtest/functest/simulators/build_sim_image.sh1
-rw-r--r--test/functest/simulators/oof_dependencies_simulators.py22
4 files changed, 67 insertions, 14 deletions
diff --git a/test/functest/simulators/aai/response-payloads/nsi_instance.json b/test/functest/simulators/aai/response-payloads/nsi_instance.json
new file mode 100644
index 0000000..b09d2e4
--- /dev/null
+++ b/test/functest/simulators/aai/response-payloads/nsi_instance.json
@@ -0,0 +1,13 @@
+{
+ "service-instance-id": "9629e36c-a3d9-4aed-8368-f72b8be1cd34",
+ "service-instance-name": "nsi_test_0211",
+ "service-type": "embb",
+ "service-role": "nsi",
+ "environment-context": "cn",
+ "model-invariant-id": "21d57d4b-52ad-4d3c-a798-248b5bb9124a",
+ "model-version-id": "bfba363e-e39c-4bd9-a9d5-1371c28f4d22",
+ "resource-version": "1581418601616",
+ "orchestration-status": "active",
+ "relationship-list": {
+ "relationship": [
+]}}
diff --git a/test/functest/simulators/aai/response-payloads/nsi_instance_with_args.json b/test/functest/simulators/aai/response-payloads/nsi_instance_with_args.json
new file mode 100644
index 0000000..19e5ac1
--- /dev/null
+++ b/test/functest/simulators/aai/response-payloads/nsi_instance_with_args.json
@@ -0,0 +1,45 @@
+{
+ "service-instance-id": "9629e36c-a3d9-4aed-8368-f72b8be1cd34",
+ "service-instance-name": "nsi_test_0211",
+ "service-type": "embb",
+ "service-role": "nsi",
+ "environment-context": "cn",
+ "model-invariant-id": "21d57d4b-52ad-4d3c-a798-248b5bb9124a",
+ "model-version-id": "bfba363e-e39c-4bd9-a9d5-1371c28f4d22",
+ "resource-version": "1581418601616",
+ "orchestration-status": "active",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "allotted-resource",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v23/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/d88b6ce6-19be-439d-8553-4f9d6cce0494/allotted-resources/allotted-resource/07138106-f535-413b-b002-40ba24f95937",
+ "relationship-data": [
+ {
+ "relationship-key": "customer.global-customer-id",
+ "relationship-value": "5GCustomer"
+ },
+ {
+ "relationship-key": "service-subscription.service-type",
+ "relationship-value": "5G"
+ },
+ {
+ "relationship-key": "service-instance.service-instance-id",
+ "relationship-value": "cdad9f49-4201-4e3a-aac1-b0f27902c299"
+ },
+ {
+ "relationship-key": "allotted-resource.id",
+ "relationship-value": "07138106-f535-413b-b002-40ba24f95937"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "allotted-resource.description"
+ },
+ {
+ "property-key": "allotted-resource.allotted-resource-name",
+ "property-value": "Allotted_coe"
+ }
+ ]
+ }
+]}}
diff --git a/test/functest/simulators/build_sim_image.sh b/test/functest/simulators/build_sim_image.sh
index 5d46ecb..6a71d3c 100755
--- a/test/functest/simulators/build_sim_image.sh
+++ b/test/functest/simulators/build_sim_image.sh
@@ -43,6 +43,7 @@ cp $SIMULATORS_DIR/simulated-config/*.config $DOCKER_DIR/sim/config/
cp -r $SIMULATORS_DIR/configdb $DOCKER_DIR/sim
cp -r $SIMULATORS_DIR/has-api $DOCKER_DIR/sim
cp -r $SIMULATORS_DIR/policy $DOCKER_DIR/sim
+cp -r $SIMULATORS_DIR/aai $DOCKER_DIR/sim
cp $TEST_DIR/policy-local-files/*.json $DOCKER_DIR/sim/policy/response-payloads/pdp-has-vcpe-good
cp $TEST_DIR/placement-tests/policy_response.json $DOCKER_DIR/sim/policy/response-payloads/
cp $SIMULATORS_DIR/oof_dependencies_simulators.py $DOCKER_DIR/sim/oof_dependencies_simulators.py
diff --git a/test/functest/simulators/oof_dependencies_simulators.py b/test/functest/simulators/oof_dependencies_simulators.py
index 53cc74e..d7b1f04 100644
--- a/test/functest/simulators/oof_dependencies_simulators.py
+++ b/test/functest/simulators/oof_dependencies_simulators.py
@@ -118,36 +118,30 @@ def get_nbr_list(cell_id, ts):
return jsonify(data)
return jsonify(data), 503
+@app.route("/simulated/aai/v23/nodes/service-instances/service-instance/<service_id>", methods=["GET"])
+def get_aai_instances(service_id):
+ data, status = get_payload_for_simulated_component('aai', 'nsi_instance.json')
+ if not status:
+ return jsonify(data)
+ 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') > "
+ nssi_query = {"dsl": "service-instance*('service-instance-id','9629e36c-a3d9-4aed-8368-f72b8be1cd34')('workload-context', 'CN') > "
"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') > "
+ nssi_with_nsi_query = {"dsl": "service-instance*('service-instance-id','9629e36c-a3d9-4aed-8368-f72b8be1cd34')('workload-context', 'CN') > "
"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
}