summaryrefslogtreecommitdiffstats
path: root/s3p/list_failed_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/list_failed_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/list_failed_policy.sh')
-rwxr-xr-xs3p/list_failed_policy.sh49
1 files changed, 0 insertions, 49 deletions
diff --git a/s3p/list_failed_policy.sh b/s3p/list_failed_policy.sh
deleted file mode 100755
index 042dcf34..00000000
--- a/s3p/list_failed_policy.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-
-function print_usage_and_exit {
- echo "Usage: $0 <type> <log file name or rule name>"
- echo " - <type>: s for stability log , p for perf log , or other for simple policy name"
- echo " - <log file name or rule>"
- exit 1
-}
-
-[ "$#" -ne 2 ] && print_usage_and_exit
-case $1 in
-[sS])
- type='s'
- ;;
-[pP])
- type='p'
- ;;
-*)
- type='simple'
- ;;
-esac
-
-rules=()
-if [ -f $2 ] && [ $type == 's' ]; then
- resids=(`grep -o "get policy failed for resource [0-9]\+" $2 | cut -d ' ' -f 6`)
- for i in ${resids[@]}; do
- rules+=("oofCasablanca.Config_OOF_Optimization_s3p_$i.*")
- done
-elif [ -f $2 ] && [ $type == 'p' ]; then
- idx=`grep -o "Fail at idx [0-9]\+" $2 | cut -d ' ' -f 4`
- total=`cat perf_data.csv | wc -l`
- while [ "s$idx" > "s" ] && [ $idx -lt $total ]; do
- rules+=("oofCasablanca.Config_OOF_Optimization_s3p_$idx.*")
- idx=$((idx+1))
- done
-else
- rules+=($2)
-fi
-
-for NAME in ${rules[@]}; do
- BODY="{\"policyName\":\"${NAME}\"}"
- rescode=`curl --silent --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 POST -d $BODY --output /dev/null https://pdp:8081/pdp/api/listConfig`
- if [ "$rescode" == '200' ]; then
- echo "list policy $NAME in PDP success"
- else
- echo "list policy $NAME in PDP FAIL with rescode $rescode"
- fi
-done
-