From: Eduardo Ramos Testillano Date: Sun, 13 Jul 2014 18:32:59 +0000 (+0200) Subject: Deploy lite version X-Git-Tag: REFACTORING_TESTING_LIBRARY~255 X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=commitdiff_plain;h=659d6188ba2150517f42a8a61699b42eb9c5f1c7 Deploy lite version --- diff --git a/example/diameter/launcher/DEPLOY.sh b/example/diameter/launcher/DEPLOY.sh index c6d58f1..bc76bbd 100755 --- a/example/diameter/launcher/DEPLOY.sh +++ b/example/diameter/launcher/DEPLOY.sh @@ -5,9 +5,9 @@ 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 -#EXEC=/opt/bin/anna/example_diameter_launcher EXEC=./debug/example_diameter_launcher DPATH_dflt=$HOME/ADL +RESOURCES_DIR=resources _exit () { echo @@ -39,8 +39,7 @@ createRunScript () { createDictionaryPaths () { - -for i in stacks/*commands*xml + for i in stacks/*commands*xml do stacks/dependence.sh $i >/dev/null stack=`basename $i` @@ -57,6 +56,9 @@ for i in stacks/*commands*xml # Default: ln -s .dictionary__commands_qosControl.xml .dictionary + + # Remove deps: + rm -f stacks/*.dep } ############# @@ -73,24 +75,30 @@ read DPATH [[ -d $DPATH ]] && _exit "The path '$DPATH' already exists. Remove it before continue..." echo "Basic checkings ..." -#[[ ! -f $EXEC ]] && _exit "Anna Diameter Launcher (ADL) is not installed in the system. Execute 'sudo scons install' for 'anna' suite." [[ ! -f $EXEC ]] && _exit "Anna Diameter Launcher (ADL) is not linked. Execute 'scons' for 'anna' suite." [[ ! -d $SETUPS_DIR ]] && _exit "Diameter stacks not found ($SETUPS_DIR). Perhaps you executed this script out of its parent path." +echo +echo "Deploy (f)ull version or (l)ite version [l]:" +read deploy_type +[[ "$deploy_type" = "" ]] && deploy_type=l +[[ "$deploy_type" = "l" ]] && RESOURCES_DIR=resources_lite + echo "Copying ..." mkdir -p $DPATH mkdir -p $DPATH/stacks +mkdir -p $DPATH/DTDs cp $EXEC $DPATH/ADL-launcher -cp resources/* $DPATH +cp -r $RESOURCES_DIR/* $DPATH cp $SETUPS_DIR/*xml $DPATH/stacks cp $SETUPS_DIR/*sh $DPATH/stacks cp $SETUPS_DIR/readme.txt $DPATH/stacks -cp $MSGDTD $DPATH -cp $DCTDTD $DPATH +cp $MSGDTD $DPATH/DTDs +cp $DCTDTD $DPATH/DTDs echo "Preparing ..." cd $DPATH -createRunScript +[[ "$deploy_type" != "l" ]] && createRunScript createDictionaryPaths cd - >/dev/null diff --git a/example/diameter/launcher/README b/example/diameter/launcher/README deleted file mode 100644 index f7660a6..0000000 --- a/example/diameter/launcher/README +++ /dev/null @@ -1,10 +0,0 @@ - -Use 'DEPLOY.sh', to bundle and install this launcher process. -The installation will include full configuration resources. - -Once installed, you could start the launcher process and perform -some basic taks, i.e., you could execute 'help.sh' to get help -information from the process http interface. - -See next instructions after deployment. - diff --git a/example/diameter/launcher/resources/README b/example/diameter/launcher/resources/README index dbbf5ad..52393f8 100644 --- a/example/diameter/launcher/resources/README +++ b/example/diameter/launcher/resources/README @@ -6,7 +6,7 @@ The launcher uses the configuration given by '.dictionary' which points to a spe Available different setups by mean files named as '.dictionary__'. Template for xml messages (message.dtd) and dictionaries (dictionary.dtd) are informative, not -actually required by process. +actually required by process. Located at './DTDs'. STARTING THE PROCESS -------------------- diff --git a/example/diameter/launcher/resources_lite/README b/example/diameter/launcher/resources_lite/README new file mode 100644 index 0000000..ffb4633 --- /dev/null +++ b/example/diameter/launcher/resources_lite/README @@ -0,0 +1,21 @@ + +ABOUT CONTENT +------------- +Stacks available at './stacks'. +The launcher uses the configuration given at './run.sh' variable definition section. Edit it + if you want to adapt your system networking setup. + +Template for xml messages (message.dtd) and dictionaries (dictionary.dtd) are informative, not +actually required by process. Located at './DTDs'. + +STARTING THE PROCESS +-------------------- +Start with 'run.sh'. You could manually edit such script adding parameters as '-trace debug' to +get complete 'launcher.traces'. Execute 'ADL-launcher' without arguments to see a complete +command-line help. + +OPERATION +--------- +Management interface for lite version is based on SIGUSR2 signal caugh. Use './operation.sh' +script to send any operation to the process. + diff --git a/example/diameter/launcher/resources_lite/hex_examples/tspCCA.hex b/example/diameter/launcher/resources_lite/hex_examples/tspCCA.hex new file mode 100644 index 0000000..401687a --- /dev/null +++ b/example/diameter/launcher/resources_lite/hex_examples/tspCCA.hex @@ -0,0 +1 @@ +0100018c4000011001000016ff7f245e9b81ce71000001074000003f63302d31302d37302d3233382d37342d7735703176657067312e766570632e6572696373736f6e2e73653b313430323932373534343b33000000010c4000000c000007d10000010840000019657063322e6570637265616c6d2e636f6d00000000000128400000146570637265616c6d2e636f6d000001026000000c01000016000001a06000000c000000010000019f6000000c00000000000003f8c000002c000028af00000410c0000010000028af004e200000000411c0000010000028af0007d00000000419c0000058000028af00000404c0000010000028af000000060000040ac000003c000028af00000416c0000010000028af000000030000041780000010000028af000000010000041880000010000028af000000000000027480000038000028af0000010a4000000c000028af0000027580000010000028af000000010000027680000010000028af00000003000003ffc0000010000028af00000002000001164000000c00000005 diff --git a/example/diameter/launcher/resources_lite/hex_examples/tspCCR.hex b/example/diameter/launcher/resources_lite/hex_examples/tspCCR.hex new file mode 100644 index 0000000..492384a --- /dev/null +++ b/example/diameter/launcher/resources_lite/hex_examples/tspCCR.hex @@ -0,0 +1 @@ +010002e8c000011001000016ff7f245e9b81ce71000001074000003f63302d31302d37302d3233382d37342d7735703176657067312e766570632e6572696373736f6e2e73653b313430323932373534343b3300000001026000000c01000016000001084000003263302d31302d37302d3233382d37342d7735703176657067312e766570632e6572696373736f6e2e736500000000012840000018766570632e6572696373736f6e2e73650000011b600000146570637265616c6d2e636f6d000001a06000000c000000010000019f6000000c0000000000000017c000000e000028af80010000000001166000000c00000000000001bb60000028000001c26000000c00000000000001bc60000013343637303139343034313800000000086000000c0a46ee6200000403c0000010000028af0000000500000015e000000d000028af060000000000040880000010000028af000003ec000001ca6000002c000001cb2000000c00000000000001cc2000001833353734373330343030363632383030000003f8c000002c000028af0000041080000010000028af08f0d1800000041180000010000028af02faf0800000041980000058000028af00000404c0000010000028af000000090000040ac000003c000028af0000041680000010000028af000000020000041780000010000028af000000010000041880000010000028af0000000000000012e0000011000028af32343039390000000000041a80000012000028af00010a46ee3a000000000016c0000019000028af8242f099006742f0990186a4010000000000001e6000000d7665706731000000000003e8c0000010000028af0000000000000400c0000010000028af00000001000001f5c0000012000028af00010a46ee3a0000000003fec0000020000028af000001f7c0000013000028af34383030303438000000027480000038000028af0000010a4000000c000028af0000027580000010000028af000000010000027680000010000028af00000003 diff --git a/example/diameter/launcher/resources_lite/operation.sh b/example/diameter/launcher/resources_lite/operation.sh new file mode 100755 index 0000000..585ca98 --- /dev/null +++ b/example/diameter/launcher/resources_lite/operation.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# General +EXE=./ADL-launcher + +_exit () { + echo + echo $1 + echo + exit 1 +} + +echo +echo +[[ "$1" = "" ]] && _exit "Use: $0 ; i.e.: $0 help" + +PID=$(pgrep `basename $EXE`) +[[ $? -ne 0 ]] && _exit "Can't found the process '$EXE'. Use './run.sh' to start it." + +# Send operation: +echo $1 > sigusr2.tasks.input +kill -s SIGUSR2 $PID + +sleep 1 +echo +echo +echo "You could see results on './sigusr2.tasks.output' file." +echo +echo + diff --git a/example/diameter/launcher/resources_lite/run.sh b/example/diameter/launcher/resources_lite/run.sh new file mode 100755 index 0000000..d837f70 --- /dev/null +++ b/example/diameter/launcher/resources_lite/run.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# Diameter dictionary and endpoints: +DICTIONARY=stacks/avps_etsi.xml,stacks/avps_ietf.xml,stacks/avps_tgpp.xml,stacks/commands_baseProtocol.xml,stacks/commands_pccPS_EricssonSAPC_se.xml +SERVER=localhost:3868 +ENTITY=192.168.12.11:3868,192.168.12.21:3868 +CONNS=10 + +# Perhaps the stack is not fully defined: +KINDNESS=-ignoreErrors + +# Tracing (comment the second line if you need detailed traces): +TRACING="-trace debug" +TRACING= + +# General +EXE=./ADL-launcher + +echo +echo +PID=$(pgrep `basename $EXE`) +if [ $? -eq 0 ] +then + echo "The process '$EXE' seems to be already started (pid: $PID)." + echo "Press ENTER to continue, CTRL-C to abort ..." + read dummy +fi + +echo "Run as a (c)lient, (s)erver, (b)alancer or (d)ummy [c]:" +read option +[[ "$option" = "" ]] && option=c + +case $option in + c) $EXE -dictionary $DICTIONARY -entity $ENTITY -entityServerSessions $CONNS -diameterServerSessions 0 $KINDNESS $TRACING & + ;; + + s) $EXE -dictionary $DICTIONARY -diameterServer $SERVER -diameterServerSessions $CONNS -entityServerSessions 0 $KINDNESS $TRACING & + ;; + + b) $EXE -dictionary $DICTIONARY -entity $ENTITY -entityServerSessions $CONNS -diameterServer $SERVER -diameterServerSessions $CONNS -balance $KINDNESS $TRACING & + ;; + + d) $EXE -dictionary $DICTIONARY -entityServerSessions 0 -diameterServerSessions 0 $KINDNESS $TRACING & + ;; + + *) echo "Option '$option' not implemented !!" + ;; +esac + diff --git a/source/diameter/stack/setups/commands_baseProtocol.xml b/source/diameter/stack/setups/commands_baseProtocol.xml old mode 100755 new mode 100644 diff --git a/source/diameter/stack/setups/commands_dccaMMS_EricssonGGSN_ar-uy.xml b/source/diameter/stack/setups/commands_dccaMMS_EricssonGGSN_ar-uy.xml old mode 100755 new mode 100644 diff --git a/source/diameter/stack/setups/commands_qosControl.xml b/source/diameter/stack/setups/commands_qosControl.xml old mode 100755 new mode 100644