diff options
author | Bilal A <bilal@research.att.com> | 2019-02-27 13:52:05 -0500 |
---|---|---|
committer | Bilal A <bilal@research.att.com> | 2019-02-27 14:06:23 -0500 |
commit | f762f7400752c848cba93d666f0b4549b667a134 (patch) | |
tree | 63acb6fe742ab93f439bae315c088f120ff99fb9 /s3p/generate.sh | |
parent | 7101ee5fe217b6f3d864e2bda979fc0c14f7db92 (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/generate.sh')
-rwxr-xr-x | s3p/generate.sh | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/s3p/generate.sh b/s3p/generate.sh deleted file mode 100755 index d28da1e8..00000000 --- a/s3p/generate.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash - -function print_usage_and_exit { - [ -z "$1" ] || echo "Error: $1" - echo "Usage: $0 <output_dir> <random_number>" - echo " - <output_dir>: directory where the generated csar file will be put into" - echo " - <random_number>: random number to choose which csar template to use" - exit 1 -} - -[ "$#" -ne 2 ] && print_usage_and_exit -OUTPUT=$1 -SEED=$2 -[ -d $OUTPUT ] || mkdir -p $OUTPUT -[ -d $OUTPUT ] || print_usage_and_exit "$OUTPUT is not a valid directory" -[[ $SEED =~ ^[0-9]+$ ]] || print_usage_and_exit "$SEED is not a integer" - - -ROOT_DIR=`dirname $(readlink -f $0)` -TMP_DIR=$ROOT_DIR/csar_tmp - -declare -A TEMPLATES -#fill templates -for path in $ROOT_DIR/templates/*; do - [ -d "$path" ] || continue # not directory, skip - dirname="$(basename "${path}")" - TEMPLATES[$dirname]=${path} -done -KEYS=(${!TEMPLATES[@]}) - -key=${KEYS[$(( 10#$SEED % ${#KEYS[@]} ))]} -src=${TEMPLATES[$key]} - -rm -rf $TMP_DIR -cp -r -f $src $TMP_DIR -find $TMP_DIR -type f | xargs sed -i "s/##RANDOM_RESOURCE_NAME##/s3p_${SEED}_${key}/g" -cd $TMP_DIR -echo $key -echo $src -zip -r "$ROOT_DIR/s3p_${SEED}_${key}.csar" * - -rm -f "$OUTPUT/s3p_${SEED}_${key}.csar" -mv -f "$ROOT_DIR/s3p_${SEED}_${key}.csar" $OUTPUT/ - -cd $ROOT_DIR -rm -rf $TMP_DIR |