X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FDEPLOY.sh;h=fe353711b8f22e8f1573cbd5e7303d24bd236894;hb=d028ac4d72c144d25e160121d76ae815e8f37318;hp=7963f07d36c06f1c24c79b6015103f0bc4121c38;hpb=74730c7d0e4f713c932d6b06a07644d1c3c6c6c1;p=anna.git diff --git a/example/diameter/launcher/DEPLOY.sh b/example/diameter/launcher/DEPLOY.sh index 7963f07..fe35371 100755 --- a/example/diameter/launcher/DEPLOY.sh +++ b/example/diameter/launcher/DEPLOY.sh @@ -6,8 +6,8 @@ SETUPS_DIR=../../../source/diameter/stack/setups MSGDTD=../../../include/anna/diameter/codec/message.dtd DCTDTD=../../../include/anna/diameter/stack/dictionary.dtd -BASE_PROT=commands_baseProtocol.xml SERVICES=./resources/services_examples +STACK_EXAMPLES=./resources/stack_examples SRVDTD=$SERVICES/services.dtd # Executables in priority order: @@ -29,19 +29,21 @@ _exit () { } usage () { - echo "Usage: $0 [deployment_type: a|b|f] [deployment_path]" + echo "Usage: $0 [deployment_type: a|b|f|s] [deployment_path]" echo echo " deployment_type:" echo " a=advanced" echo " b=basic" echo " f=function test client" + echo " s=system test client" echo " deployment_path:" echo " non-existent path directory." echo echo " For example:" - echo " $0 b $HOME/ADML/basicServer" - echo " $0 b $HOME/ADML/MMSbalancer" - echo " $0 f $HOME/ADML/tester" + echo " $0 b $HOME/ADML-basicServer" + echo " $0 b $HOME/ADML-MMSbalancer" + echo " $0 f $HOME/ADML-tester" + echo " $0 s $HOME/ADML-stress-client" echo exit 0 } @@ -52,64 +54,29 @@ createRunScript () { [ "$1" = "b" ] && return local other= - [ "$1" = "a" ] && { exe=ADML-launcher ; other="--httpServer \`grep -v ^# .httpServer\`"; } - [ "$1" = "f" ] && { exe=ADML-ftclient ; ln -s ADML-launcher $exe ; } + [ "$1" = "a" ] && other="--httpServer \`grep -v ^# .httpServer\`" + [ "$1" = "f" ] && ln -s ADML-launcher $EXE + [ "$1" = "s" ] && { other="--disableLogs"; ln -s ADML-launcher $EXE ; } echo "Creating 'run.sh' script ..." cat << EOF > run.sh #!/bin/bash cd \`dirname \$0\` -EXE=$exe -STARTED=\`pgrep \$EXE 2>/dev/null\` +EXE=$EXE +STARTED=\`pgrep \$EXE$ 2>/dev/null\` [ \$? -eq 0 ] && { echo "Already started!"; echo "\$STARTED" ; exit 1 ; } ./pre-start.sh 0> launcher.trace -rm -f counters/* +rm -f counters/* test-reports/* # Execution line: -./\$EXE --services services.xml --cntDir counters $other & +./\$EXE --services services.xml --cntDir counters --tmDir test-reports $other & echo \$! > .pid EOF chmod a+x run.sh } -createDictionaryPaths () { - echo "Creating dictionaries ..." - - for i in stacks/*commands*xml - do - stacks/dependence.sh $i >/dev/null - stack=`basename $i` - if test "$stack" != "$BASE_PROT" - then - > .dictionary-${stack} - for j in `cat ${i}.dep` - do - echo -n "${j} " >> .dictionary-${stack} - done - echo "stacks/$BASE_PROT stacks/${stack}" >> .dictionary-${stack} - fi - done - - # Create autonomous dictionaries: - mkdir stacks/autonomous - for i in `ls .dictionary-*` - do - name=$(echo $i | cut -d\- -f2) - $STACKMGMT_EXEC `cat $i` >/dev/null - mv result.xml stacks/autonomous/$name - done - - # Cleanup: - rm -f stacks/*.dep - rm -f .dictionary-* - rm -f example_diameter_stackManagement.trace* - - # Default: - ln -s stacks/autonomous/commands_qosControl.xml dictionary.xml -} - ############# # EXECUTION # ############# @@ -138,6 +105,7 @@ for STACKMGMT_EXEC in ${STACKMGMT_EXECS[@]}; do echo "not found" done [ -z "$available" ] && _exit "Anna Diameter Stack Management Tool is not installed neither linked. See README.md (Install section)." +STACKMGMT_EXEC=`readlink -f $STACKMGMT_EXEC` [ ! -d $SETUPS_DIR ] && _exit "Diameter stacks not found ($SETUPS_DIR)." @@ -150,6 +118,7 @@ then echo " (a)dvanced version: includes burst management script and templates for different scenarios. Automatic configuration during start." echo " (b)asic version: 4 types of launcher (client, server, balancer, dummy), lightly configured and managed through SIGURS2 method." echo " (f)unction test client: special client with regexp scheduler script based on splitted traffic logs. Requires a server to perform the tests." + echo " (s)ystem test client: special client for stress testing. Requires a server/s to perform the tests." echo echo "Input option [b]:" read option @@ -162,19 +131,25 @@ case $option in a) echo "Advanced deployment" DEPLOYMENTS_DIR=deployments/advanced - DPATH_dflt=$HOME/ADML/advanced + DPATH_dflt=$HOME/ADML-advanced ;; b) echo "Basic deployment" DEPLOYMENTS_DIR=deployments/basic - DPATH_dflt=$HOME/ADML/basic + DPATH_dflt=$HOME/ADML-basic ;; f) echo "FT deployment" DEPLOYMENTS_DIR=deployments/ft-client - DPATH_dflt=$HOME/ADML/ft-client + DPATH_dflt=$HOME/ADML-ft-client + ;; + + s) + echo "ST deployment" + DEPLOYMENTS_DIR=deployments/st-client + DPATH_dflt=$HOME/ADML-st-client ;; *) @@ -193,32 +168,48 @@ else fi [ -d $DPATH ] && _exit "The installation path '$DPATH' must not exists." +EXE=`basename $DPATH` echo "Copying to '$DPATH' ..." mkdir -p $DPATH mkdir -p $DPATH/stacks mkdir -p $DPATH/DTDs mkdir -p $DPATH/counters -[ "option" = "b" ] && mkdir -p $DPATH/services +mkdir -p $DPATH/test-reports +[ "$option" = "b" ] && mkdir -p $DPATH/services + +# ADML executable: if [ "$EXEC" = "$EXEC_installed" ] then ln -s $EXEC_installed $DPATH/ADML-launcher else cp $EXEC $DPATH/ADML-launcher fi + +# Stack management tool: +if [ "$STACKMGMT_EXEC" = "$STACKMGMT_EXEC_installed" ] +then + ln -s $STACKMGMT_EXEC_installed $DPATH/stacks/stack-mgmt +fi +# Copy binary just in case: +[ ! -f $DPATH/stacks/stack-mgmt ] && cp $STACKMGMT_EXEC $DPATH/stacks/stack-mgmt + cp -rL $DEPLOYMENTS_DIR/* $DPATH cp $SETUPS_DIR/*xml $DPATH/stacks cp $SETUPS_DIR/*sh $DPATH/stacks cp $SETUPS_DIR/readme.txt $DPATH/stacks +mkdir $DPATH/stacks/other_examples +cp $STACK_EXAMPLES/* $DPATH/stacks/other_examples cp $MSGDTD $DPATH/DTDs cp $DCTDTD $DPATH/DTDs cp $SRVDTD $DPATH/DTDs -[ "option" = "b" ] && cp $SERVICES/* $DPATH/services +[ "$option" = "b" ] && cp $SERVICES/* $DPATH/services echo "Preparing ..." cd $DPATH createRunScript $option -createDictionaryPaths +stacks/makeAutonomous.sh commands_qosControl.xml stacks/stack-mgmt >/dev/null +ln -s stacks/autonomous.commands_qosControl.xml dictionary.xml cd - >/dev/null # Help: