summaryrefslogtreecommitdiffstats
path: root/s3p/clean_policy.sh
diff options
context:
space:
mode:
authorBilal A <bilal@research.att.com>2019-02-27 13:52:05 -0500
committerBilal A <bilal@research.att.com>2019-02-27 14:06:23 -0500
commitf762f7400752c848cba93d666f0b4549b667a134 (patch)
tree63acb6fe742ab93f439bae315c088f120ff99fb9 /s3p/clean_policy.sh
parent7101ee5fe217b6f3d864e2bda979fc0c14f7db92 (diff)
Changes directory structure of S3P Tests
Changes Include: a) Moving performance and stability tests into two separate directories. Change-Id: Ib98713b2c37658de16c5eb6ee8918b867bdf5b8a Issue-ID: POLICY-1462 Signed-off-by: Bilal A <bilal@research.att.com>
Diffstat (limited to 's3p/clean_policy.sh')
-rwxr-xr-xs3p/clean_policy.sh41
1 files changed, 0 insertions, 41 deletions
diff --git a/s3p/clean_policy.sh b/s3p/clean_policy.sh
deleted file mode 100755
index 7b45ea8b..00000000
--- a/s3p/clean_policy.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-
-function print_usage_and_exit {
- [ -z "$1" ] || echo "Error: $1"
- echo "Usage: $0 [ <dir> | <rulename> ]"
- echo " - <dir> directory where the s3p csar files stores, policies related to them will be cleaned from PDP/PAP"
- echo " - <rulename> rulename to be cleaned"
- exit 1
-}
-
-[ "$#" -ne 1 ] && print_usage_and_exit
-
-rules=()
-if [ -d $1 ]; then
- files=(`find "$1" -maxdepth 1 -name "*.csar" -printf "%f\n"`)
- for i in ${files[@]}; do
- fn=`echo $i | cut -d '.' -f 1`
- rules+=("oofCasablanca.Config_OOF_Optimization_${fn}.1.xml")
- done
-else
- rules+=($1)
-fi
-
-for NAME in ${rules[@]}; do
- BODY="{\"policyComponent\":\"PDP\",\"policyType\":\"Optimization\",\"pdpGroup\":\"default\",\"policyName\":\"${NAME}\"}"
- rescode=`curl --silent --output /dev/null --write-out %{http_code} -k -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'ClientAuth: cHl0aG9uOnRlc3Q=' -H 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' -H 'Environment: TEST' -X DELETE -d $BODY https://pdp:8081/pdp/api/deletePolicy`
- if [ "$rescode" == "200" ]; then
- echo "delete $NAME in PDP success"
- else
- echo "delete $NAME in PDP FAIL with rescode $rescode"
- fi
-
- BODY="{\"policyName\":\"${NAME}\",\"policyComponent\":\"PAP\",\"policyType\":\"Optimization\",\"deleteCondition\":\"ALL\"}"
- rescode=`curl --silent --output /dev/null --write-out %{http_code} -k -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'ClientAuth: cHl0aG9uOnRlc3Q=' -H 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' -H 'Environment: TEST' -X DELETE -d $BODY https://pdp:8081/pdp/api/deletePolicy`
- if [ "$rescode" == "200" ]; then
- echo "delete $NAME in PAP success"
- else
- echo "delete $NAME in PAP FAIL with rescode $rescode"
- fi
-done
-