fix csit, cleanup dockerfile for osdf
[optf/osdf.git] / test / functest / simulators / oof_dependencies_simulators.py
old mode 100755 (executable)
new mode 100644 (file)
index b7e6cb5..b0b7b32
@@ -22,7 +22,8 @@ Simulators for dependencies of OSDF (e.g. HAS-API, Policy, SO-callback, etc.)
 import glob
 import json
 import os
-from flask import Flask, jsonify, request
+
+from flask import Flask, jsonify
 
 from osdf.utils.interfaces import json_from_file
 
@@ -93,18 +94,26 @@ def get_policies(sub_component):
     return jsonify(list_json)
 
 
-@app.route("/simulated/configdb/getCellList", methods=["GET"])
-def get_cell_list():
+@app.route("/simulated/policy/pdpx/decision/v1", methods=["POST"])
+def get_pdx_policies():
+    """
+    get the pdpx policy
+    """
+    return jsonify(json_from_file("policy/response-payloads/policy_response.json"))
+
+
+@app.route("/simulated/configdb/getCellList/<network_id>/<ts>", methods=["GET"])
+def get_cell_list(network_id, ts):
     data, status = get_payload_for_simulated_component('configdb',
-                                                       'getCellList-' + request.args.get('networkId') + '.json')
+                                                       'getCellList-' + network_id + '.json')
     if not status:
         return jsonify(data)
     return jsonify(data), 503
 
 
-@app.route("/simulated/configdb/getNbrList", methods=["GET"])
-def get_nbr_list():
-    data, status = get_payload_for_simulated_component('configdb', 'getNbrList-' + request.args.get('cellId') + '.json')
+@app.route("/simulated/configdb/getNbrList/<cell_id>/<ts>", methods=["GET"])
+def get_nbr_list(cell_id, ts):
+    data, status = get_payload_for_simulated_component('configdb', 'getNbrList-' + cell_id + '.json')
     if not status:
         return jsonify(data)
     return jsonify(data), 503