summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorShankaranarayanan Puzhavakath Narayanan <snarayanan@research.att.com>2020-03-20 14:49:44 +0000
committerGerrit Code Review <gerrit@onap.org>2020-03-20 14:49:44 +0000
commit420f4b3a4ca25d5de5c9318b2ca89e1ef126b278 (patch)
tree5aa3a38e453d999a6ab0704c2651a08520088a19 /test
parentfa538d59b8982a48fd58f024a30a59616d43cf81 (diff)
parent6f3312c6576eefdbac120214b1adc0f150b72d98 (diff)
Merge "fix csit, cleanup dockerfile for osdf"
Diffstat (limited to 'test')
-rwxr-xr-xtest/functest/scripts/start-simulators.sh7
-rwxr-xr-xtest/functest/scripts/stop-simulators.sh7
-rwxr-xr-xtest/functest/simulators/build_sim_image.sh1
-rw-r--r--test/functest/simulators/oof_dependencies_simulators.py11
4 files changed, 23 insertions, 3 deletions
diff --git a/test/functest/scripts/start-simulators.sh b/test/functest/scripts/start-simulators.sh
index a3f3db1..66507d4 100755
--- a/test/functest/scripts/start-simulators.sh
+++ b/test/functest/scripts/start-simulators.sh
@@ -20,7 +20,12 @@
# This script is in osdf/test/functest/scripts/
-SCRIPTDIR=$(dirname $(readlink -f $0))
+if [[ `uname` == "Darwin" ]]
+then
+ SCRIPTDIR=$(dirname $(greadlink -f $0))
+else
+ SCRIPTDIR=$(dirname $(readlink -f $0))
+fi
FUNC_TEST_DIR=$(dirname $SCRIPTDIR)
TEST_DIR=$(dirname $FUNC_TEST_DIR)
OSDF_DIR=$(dirname $TEST_DIR)
diff --git a/test/functest/scripts/stop-simulators.sh b/test/functest/scripts/stop-simulators.sh
index c9dd126..e80a080 100755
--- a/test/functest/scripts/stop-simulators.sh
+++ b/test/functest/scripts/stop-simulators.sh
@@ -23,7 +23,12 @@
# We don't need all the directory names here and the "cd", but it may be needed later on
# Also, it will be a guard against some bad config where the directory doesn't exist
-SCRIPTDIR=$(dirname $(readlink -f $0))
+if [[ `uname` == "Darwin" ]]
+then
+ SCRIPTDIR=$(dirname $(greadlink -f $0))
+else
+ SCRIPTDIR=$(dirname $(readlink -f $0))
+fi
FUNC_TEST_DIR=$(dirname $SCRIPTDIR)
TEST_DIR=$(dirname $FUNC_TEST_DIR)
OSDF_DIR=$(dirname $TEST_DIR)
diff --git a/test/functest/simulators/build_sim_image.sh b/test/functest/simulators/build_sim_image.sh
index 6d6cb13..c6bde2a 100755
--- a/test/functest/simulators/build_sim_image.sh
+++ b/test/functest/simulators/build_sim_image.sh
@@ -38,6 +38,7 @@ 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 $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
cp $OSDF_DIR/requirements.txt $DOCKER_DIR
cp -r $SIMULATORS_DIR/start_sim.sh $DOCKER_DIR/
diff --git a/test/functest/simulators/oof_dependencies_simulators.py b/test/functest/simulators/oof_dependencies_simulators.py
index 2995861..b0b7b32 100644
--- a/test/functest/simulators/oof_dependencies_simulators.py
+++ b/test/functest/simulators/oof_dependencies_simulators.py
@@ -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,6 +94,14 @@ def get_policies(sub_component):
return jsonify(list_json)
+@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',