aboutsummaryrefslogtreecommitdiffstats
path: root/test/functest/simulators
diff options
context:
space:
mode:
Diffstat (limited to 'test/functest/simulators')
-rw-r--r--test/functest/simulators/configdb/response-payloads/getCellList-1000.json1
-rw-r--r--test/functest/simulators/configdb/response-payloads/getNbrList-cell0.json10
-rw-r--r--test/functest/simulators/configdb/response-payloads/getNbrList-cell1.json10
-rw-r--r--test/functest/simulators/configdb/response-payloads/getNbrList-cell2.json10
-rwxr-xr-xtest/functest/simulators/oof_dependencies_simulators.py19
-rwxr-xr-xtest/functest/simulators/simulated-config/osdf_config.yaml12
6 files changed, 61 insertions, 1 deletions
diff --git a/test/functest/simulators/configdb/response-payloads/getCellList-1000.json b/test/functest/simulators/configdb/response-payloads/getCellList-1000.json
new file mode 100644
index 0000000..df23f6e
--- /dev/null
+++ b/test/functest/simulators/configdb/response-payloads/getCellList-1000.json
@@ -0,0 +1 @@
+["cell0","cell1","cell2"] \ No newline at end of file
diff --git a/test/functest/simulators/configdb/response-payloads/getNbrList-cell0.json b/test/functest/simulators/configdb/response-payloads/getNbrList-cell0.json
new file mode 100644
index 0000000..e0986d8
--- /dev/null
+++ b/test/functest/simulators/configdb/response-payloads/getNbrList-cell0.json
@@ -0,0 +1,10 @@
+[
+ {
+ "cellId": "cell1",
+ "pciValue": 1
+ },
+ {
+ "cellId": "cell2",
+ "pciValue": 2
+ }
+] \ No newline at end of file
diff --git a/test/functest/simulators/configdb/response-payloads/getNbrList-cell1.json b/test/functest/simulators/configdb/response-payloads/getNbrList-cell1.json
new file mode 100644
index 0000000..d6ed353
--- /dev/null
+++ b/test/functest/simulators/configdb/response-payloads/getNbrList-cell1.json
@@ -0,0 +1,10 @@
+[
+ {
+ "cellId": "cell0",
+ "pciValue": 0
+ },
+ {
+ "cellId": "cell2",
+ "pciValue": 2
+ }
+] \ No newline at end of file
diff --git a/test/functest/simulators/configdb/response-payloads/getNbrList-cell2.json b/test/functest/simulators/configdb/response-payloads/getNbrList-cell2.json
new file mode 100644
index 0000000..1ea80be
--- /dev/null
+++ b/test/functest/simulators/configdb/response-payloads/getNbrList-cell2.json
@@ -0,0 +1,10 @@
+[
+ {
+ "cellId": "cell0",
+ "pciValue": 0
+ },
+ {
+ "cellId": "cell1",
+ "pciValue": 1
+ }
+] \ No newline at end of file
diff --git a/test/functest/simulators/oof_dependencies_simulators.py b/test/functest/simulators/oof_dependencies_simulators.py
index bdb552d..9c20e79 100755
--- a/test/functest/simulators/oof_dependencies_simulators.py
+++ b/test/functest/simulators/oof_dependencies_simulators.py
@@ -20,9 +20,9 @@
Simulators for dependencies of OSDF (e.g. HAS-API, Policy, SO-callback, etc.)
"""
import glob
+from flask import Flask, jsonify, request
from osdf.utils.interfaces import json_from_file
-from flask import Flask, jsonify, request
app = Flask(__name__)
@@ -80,5 +80,22 @@ def get_policies(sub_component):
return jsonify([json_from_file(x) for x in files])
+@app.route("/simulated/configdb/getCellList", methods=["GET"])
+def get_cell_list():
+ data, status = get_payload_for_simulated_component('configdb',
+ 'getCellList-' + request.args.get('networkId') + '.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')
+ if not status:
+ return jsonify(data)
+ return jsonify(data), 503
+
+
if __name__ == "__main__":
app.run(debug=True)
diff --git a/test/functest/simulators/simulated-config/osdf_config.yaml b/test/functest/simulators/simulated-config/osdf_config.yaml
index 0a77fe2..dbdcc91 100755
--- a/test/functest/simulators/simulated-config/osdf_config.yaml
+++ b/test/functest/simulators/simulated-config/osdf_config.yaml
@@ -32,3 +32,15 @@ sdcONAPInstanceID: ONAP-OSDF
osdfPlacementUrl: "http://127.0.0.1:24699/osdf/api/v2/placement"
osdfPlacementUsername: "test"
osdfPlacementPassword: "testpwd"
+
+# config db api
+configDbUrl: http://127.0.0.1:5000/simulated/configdb
+configDbUserName: osdf
+configDbPassword: passwd
+configDbGetCellListUrl: 'getCellList'
+configDbGetNbrListUrl: 'getNbrList'
+
+# Credentials for PCIHandler
+pciHMSUsername: "" # pcihandler username for call back.
+pciHMSPassword: "" # pcihandler password for call back.
+