Add first work package for REST API implementation
[anna.git] / example / diameter / launcher / deployments / advanced / burst.sh
index b05b6e0..7b912cf 100755 (executable)
@@ -1,7 +1,4 @@
 #!/bin/bash
-> curl_log.txt
-TRACE="--trace-ascii curl_log.txt"
-SERVER=`cat .httpServer`
 burstMargin__dflt=1
 
 salir () {
@@ -51,7 +48,7 @@ uso () {
    echo
    echo "     resume:"
    echo "        Resume an stopped burst launch from the same point (start will reset"
-   echo "        the work pointer to the first burst list position). This is equivalent" 
+   echo "        the work pointer to the first burst list position). This is equivalent"
    echo "        to one-message-push operation."
    echo
    echo "     repeat [[yes] | no]:"
@@ -77,18 +74,14 @@ uso () {
    echo "        Show programmed burst message for order provided."
    echo
    echo
-   salir 
-}
-
-_curl () {
-   curl -m 5 --data "$1" $TRACE ${SERVER}
+   salir
 }
 
 echo
 echo
 [[ "$1" = "" ]] && uso
 case $1 in
-   clear) _curl "burst|clear"
+   clear) ./operation.sh "burst|clear"
    ;;
    load) [[ "$3" = "" ]] && uso
          [[ ! -f "${3}.sh" ]] && salir "Burst generation file '${3}.sh' not found!"
@@ -97,43 +90,43 @@ case $1 in
          then
             count=$2
             RESTO=$((count%4))
-            [[ "$RESTO" != "0" ]] && salir "Data context should load a multiple of 4 (messages generated by data.sh)" 
+            [[ "$RESTO" != "0" ]] && salir "Data context should load a multiple of 4 (messages generated by data.sh)"
          fi
          count=1
          while test "$count" -le "$2"
          do
             ${3}.sh $count > .${3}.xml
             echo -n "Loading message ${count}; "
-            _curl "burst|load|.${3}.xml"
+            ./operation.sh  "burst|load|.${3}.xml"
             count=$((count+1))
          done
    ;;
    start) load=$burstMargin__dflt
           [[ "$2" != "" ]] && load=$2
           entero $load
-          _curl "burst|start|$load"
+          ./operation.sh "burst|start|$load"
    ;;
    pop) release=$burstMargin__dflt
           [[ "$2" != "" ]] && release=$2
           entero $release
-          _curl "burst|pop|$release"
+          ./operation.sh "burst|pop|$release"
    ;;
    push) [[ "$2" = "" ]] && uso
          entero $2
-         _curl "burst|push|$2"
+         ./operation.sh "burst|push|$2"
    ;;
-   stop) _curl "burst|stop"
+   stop) ./operation.sh "burst|stop"
    ;;
-   resume) _curl "burst|push|1"
+   resume) ./operation.sh "burst|push|1"
    ;;
    repeat) repeat=yes
           [[ "$2" != "" ]] && repeat=$2
-          _curl "burst|repeat|$repeat"
+          ./operation.sh "burst|repeat|$repeat"
    ;;
    send) amount=1
          [[ "$2" != "" ]] && amount=$2
          entero $amount
-         _curl "burst|send|$amount"
+         ./operation.sh "burst|send|$amount"
    ;;
    sendXS) [[ "$2" = "" ]] && uso
          limit=$3
@@ -157,13 +150,13 @@ case $1 in
             TPS=$READ_TPS
             [[ "$TPS" = "0" ]] && salir "Test stopped due to 0-tps value read"
             # Background:
-            _curl "burst|send|$amount" &
+            ./operation.sh "burst|send|$amount" &
             count=$((count+amount))
             AFTER_ns=`date +%s%N`
             # Real tps:
             REAL_TPS=$(calc "1000000000 * $count / ($AFTER_ns - $BEGIN_ns)")
             echo $REAL_TPS > .real_tps
-            
+
             COEF=1
             [[ $(calc "$TPS > $REAL_TPS") = "1" ]] && COEF=$(calc "$REAL_TPS / $TPS")
             K=$(calc "$COEF ^ 10")
@@ -173,11 +166,11 @@ case $1 in
    ;;
    goto) [[ "$2" = "" ]] && uso
          entero $2
-         _curl "burst|goto|$2"
+         ./operation.sh "burst|goto|$2"
    ;;
    look) [[ "$2" = "" ]] && uso
          entero $2
-         _curl "burst|look|$2"
+         ./operation.sh "burst|look|$2"
    ;;
    *) uso
 esac