Split reporting_target from http_target in yardstick_verify 67/29467/2
authorchenjiankun <chenjiankun1@huawei.com>
Tue, 28 Feb 2017 03:42:48 +0000 (03:42 +0000)
committerchenjiankun <chenjiankun1@huawei.com>
Tue, 28 Feb 2017 09:15:01 +0000 (09:15 +0000)
JIRA: YARDSTICK-576

Currently the reporting_target reuse the http_target.
But if we want to custom reporting_target, the http_target is also change,
and the yardstick result will store in mongoDB.
So I add reporting_target to split them.

Change-Id: Ib0e4e8ec9a55f49027f9776931fdaa7dc194654b
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
tests/ci/yardstick-verify

index 575bdc8..2986c9f 100755 (executable)
@@ -34,6 +34,7 @@ OPTIONS:
    -h      Show this message
    -r      Http target (example: -r 213.77.62.197/results)
    -i      Influxdb target (example: -i 127.0.0.1:8086)
+   -m      Reporting target (example: -m 213.77.62.197/results)
 
            Default target is dump to file ($DISPATCHER_FILE_NAME)
 
@@ -44,8 +45,9 @@ DISPATCHER_TYPE=file
 DISPATCHER_FILE_NAME="/tmp/yardstick.out"
 DISPATCHER_HTTP_TARGET="http://testresults.opnfv.org/test/api/v1/results"
 DISPATCHER_INFLUXDB_TARGET=
+REPORTING_TARGET="${DISPATCHER_HTTP_TARGET}"
 
-while getopts "r:i:h" OPTION; do
+while getopts "r:i:m:h" OPTION; do
     case $OPTION in
         h)
             usage
@@ -61,6 +63,9 @@ while getopts "r:i:h" OPTION; do
             DISPATCHER_INFLUXDB_TARGET=http://${OPTARG}
             DISPATCHER_FILE_NAME=
             ;;
+        m)
+            REPORTING_TARGET=http://${OPTARG}
+            ;;
         *)
             echo "${OPTION} is not a valid argument"
             exit 1
@@ -150,7 +155,7 @@ report(){
           \"start_date\":\"${2}\",
           \"stop_date\":\"${3}\",
           \"details\":\"\"}" \
-          "${DISPATCHER_HTTP_TARGET}"
+          "${REPORTING_TARGET}"
 }
 
 run_test()