From: Eduardo Ramos Testillano Date: Sun, 29 Nov 2015 22:19:30 +0000 (+0100) Subject: Optimiza deployment time X-Git-Tag: REFACTORING_TESTING_LIBRARY~71 X-Git-Url: https://git.teslayout.com/public/public/public/?a=commitdiff_plain;h=8d1fa21ccbef8b92919d221673e05b54d6ed787a;p=anna.git Optimiza deployment time --- diff --git a/example/diameter/launcher/DEPLOY.sh b/example/diameter/launcher/DEPLOY.sh index 93754ac..edcb4fc 100755 --- a/example/diameter/launcher/DEPLOY.sh +++ b/example/diameter/launcher/DEPLOY.sh @@ -6,7 +6,6 @@ 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 @@ -78,42 +77,6 @@ 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 # ############# @@ -214,12 +177,23 @@ mkdir -p $DPATH/DTDs mkdir -p $DPATH/counters 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 +else + cp $STACKMGMT_EXEC $DPATH/stack-mgmt +fi + cp -rL $DEPLOYMENTS_DIR/* $DPATH cp $SETUPS_DIR/*xml $DPATH/stacks cp $SETUPS_DIR/*sh $DPATH/stacks @@ -234,7 +208,8 @@ cp $SRVDTD $DPATH/DTDs echo "Preparing ..." cd $DPATH createRunScript $option -createDictionaryPaths +stacks/makeAutonomous.sh commands_qosControl.xml ./stack-mgmt +ln -s stacks/autonomous.commands_qosControl.xml dictionary.xml cd - >/dev/null # Help: diff --git a/example/diameter/launcher/DEPLOY_setups.sh b/example/diameter/launcher/DEPLOY_setups.sh index 3483c9f..42332a6 100755 --- a/example/diameter/launcher/DEPLOY_setups.sh +++ b/example/diameter/launcher/DEPLOY_setups.sh @@ -110,10 +110,12 @@ case $type in cd $target/ADML-serverGx echo s | ./configure.sh >/dev/null sed -i 's/3868/3869/' services.xml + # Gx dictionary: ln -sf stacks/other_examples/16777238.xml dictionary.xml cd - >/dev/null cd $target/ADML-serverRx echo s | ./configure.sh >/dev/null + # Rx dictionary: ln -sf stacks/other_examples/16777236.xml dictionary.xml cd - >/dev/null ;; diff --git a/source/diameter/stack/setups/makeAutonomous.sh b/source/diameter/stack/setups/makeAutonomous.sh new file mode 100755 index 0000000..92939d7 --- /dev/null +++ b/source/diameter/stack/setups/makeAutonomous.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +############# +# VARIABLES # +############# +BASE_PROTOCOL_XML=commands_baseProtocol.xml + +############# +# FUNCTIONS # +############# +_exit () { + echo + echo $1 + echo + exit 1 +} + +usage () { + echo + echo + echo "Usage: makeAutonomous.sh " + echo + echo " For example:" + echo " makeAutonomous.sh commands_qosControl.xml ./stack-mgmt" + echo + echo " A new dictionary will be created: autonomous.commands_qosControl.xml" + _exit +} + +############# +# EXECUTION # +############# +[ -z "$2" ] && usage + +COMMAND_XML=$1 +[ "$COMMAND_XML" = "$BASE_PROTOCOL_XML" ] && _exit "$COMMAND_XML skipped !" + +STACK_EXE=$2 +target=autonomous.${COMMAND_XML} +cd `dirname $0` + +echo -n "Creating $target ... " +0>.dict_list +./dependence.sh $COMMAND_XML >/dev/null +for i in `cat ${COMMAND_XML}.dep`; do echo -n "$i " >> .dict_list ; done +echo "$BASE_PROTOCOL_XML $COMMAND_XML" >> .dict_list + +# Create autonomous dictionary: +$STACK_EXE `cat .dict_list` >/dev/null +mv result.xml $target + +# Cleanup: +rm -f *.dep +rm -f example_diameter_stackManagement.trace* +rm .dict_list +echo "Done!" +