Adding resources creation and other helper scripts

 - prepare.sh
   Create all manner of resources needed for testing
   Also, creating manifest with all names and IDs for future use
   Automated detect, download and create of images
   cirros35, cirros40, ubuntu16

 - add_user_to_image.sh
   Semi-manual script to add user to ubuntu image
 - entropy_bench.pl
   Benchmark entropy levels on host
 - poke.sh
   direct curl to project resource using token
 - profiled_run.sh
   Execute any command several time or one and calculate avg time
 - simple_profile.sh
   Execute resource listings and calculate avg time

Fixes for cleanup.sh
 - container deletion
 - cleaning flavors
 - mask now cleans all with 'cvp' too

Change-Id: I073857abc2fbee730b983b1d8655e0fa16fee3fc
Related-PROD: PROD-30951
diff --git a/scripts/profiled_run.sh b/scripts/profiled_run.sh
new file mode 100755
index 0000000..f88362c
--- /dev/null
+++ b/scripts/profiled_run.sh
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+function help_and_exit {
+    echo "profiled_run.sh <command>"
+    exit 1
+}
+
+#if [ -z ${1+x} ]; then echo "First parameter should be command to run"; help_and_exit; fi
+#if [ -z ${2+x} ]; then echo "Second parameter should be count of time to run"; help_and_exit; fi
+total=${2}
+count=1
+cmd="${1}"
+
+declare all_req=()
+declare errors=()
+tmp_time=$(mktemp)
+tmp_out=$(mktemp)
+
+function timed_run {
+        if [ -z ${2+x} ]; then
+                echo "--> '${1}'"
+                /usr/bin/time --quiet -f'%e %x' -o ${tmp_time} /bin/bash -c "${1}" 1>/dev/null 2>${tmp_out}
+                real=$(cat ${tmp_time} | awk '{print $1}')
+                errlevel=$(cat ${tmp_time} | awk '{print $2}')
+                if [ 0 -eq ${errlevel} ]; then
+                        echo "#${count}(${real}s), '${1:0:12}...'";
+                        all_req+=("#${count}, ${real}, '${1}'");
+                else
+                        echo "#${count}, ERROR(${errlevel}): '${1}'"
+                        errors+=("#${count}: $(cat ${tmp_out})")
+                fi
+                ((count++))
+        else
+                echo "### Running '${1:0:12}...' ${2} times"
+                for (( idx=1; idx<=${2}; idx++ ))
+                do
+                        /usr/bin/time --quiet -f'%e %x' -o ${tmp_time} /bin/bash -c "${1}" 1>/dev/null 2>${tmp_out}
+                        real=$(cat ${tmp_time} | awk '{print $1}')
+                        errlevel=$(cat ${tmp_time} | awk '{print $2}')
+                        if [ 0 -eq ${errlevel} ]; then
+                                echo "#${count}/${total}, ${real}s";
+                                all_req+=("#${count}/${idx}, ${real}, '${1}'");
+                        else
+                                echo "#${count}/${total}, ERROR(${errlevel}): '${1}'"
+                                errors+=("#${count}: $(cat ${tmp_out})")
+                        fi
+                        ((count++))
+                done
+        fi
+}
+
+function errors {
+        echo "==== Errors"
+        for i in "${!errors[@]}"; do
+                printf "#%s\n\n" "${errors[$i]}"
+        done
+}
+
+function stats {
+        echo "==== Stats"
+        printf '%s\n' "${all_req[@]}" | awk 'BEGIN{min=999;avg=0}
+        {if($2<min){min=$2;}if($2>max){max=$2;}avg+=$2;}
+        END { print "Total requests: "NR", Timings: "min" <-- "avg/NR" --> "max;}'
+}
+
+function clean {
+        rm ${tmp_time}
+        rm ${tmp_out}
+}
+
+timed_run "${cmd}" ${total}
+stats
+errors
+clean
\ No newline at end of file