From 2ddc4abd3627f5f5b4df32de199f364aa3844491 Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Sun, 15 Mar 2015 04:44:38 +0100 Subject: [PATCH] Launcher resources refactoring. New type included: FT testing client. --- example/diameter/launcher/DEPLOY.sh | 78 +++++++++++++------ .../launcher/resources/{ => advanced}/1.xml | 0 .../resources/{ => advanced}/1xml-23.txt | 0 .../launcher/resources/{ => advanced}/README | 0 .../resources/{ => advanced}/answerXml.sh | 0 .../resources/{ => advanced}/args.txt | 0 .../resources/{ => advanced}/batch.sh | 0 .../resources/{ => advanced}/burst.sh | 0 .../{ => advanced}/clientSocketManager.sh | 0 .../launcher/resources/{ => advanced}/code.sh | 0 .../resources/{ => advanced}/collect.sh | 0 .../resources/{ => advanced}/data-initial.msk | 0 .../{ => advanced}/data-termination.msk | 0 .../resources/{ => advanced}/data-update1.msk | 0 .../resources/{ => advanced}/data-update2.msk | 0 .../launcher/resources/{ => advanced}/data.sh | 0 .../resources/{ => advanced}/decode.sh | 0 .../{ => advanced}/diameterServerSessions.sh | 0 .../launcher/resources/{ => advanced}/help.sh | 0 .../resources/{ => advanced}/loadXml.sh | 0 .../resources/{ => advanced}/pre-start.sh | 28 +++---- .../resources/{ => advanced}/sendXml.sh | 0 .../launcher/resources/{ => advanced}/sms.msk | 0 .../launcher/resources/{ => advanced}/sms.sh | 0 .../basic}/README | 0 .../basic}/configure.sh | 2 - .../basic}/hex_examples/tspCCA.hex | 0 .../basic}/hex_examples/tspCCR.hex | 0 .../basic}/operation.sh | 0 .../basic}/xml_examples/ccr.xml | 0 .../launcher/resources/ft-client/README | 26 +++++++ .../launcher/resources/ft-client/args.txt | 4 + .../launcher/resources/ft-client/hex_examples | 1 + .../launcher/resources/ft-client/operation.sh | 1 + .../launcher/resources/ft-client/pre-start.sh | 63 +++++++++++++++ .../launcher/resources/ft-client/xml_examples | 1 + 36 files changed, 163 insertions(+), 41 deletions(-) rename example/diameter/launcher/resources/{ => advanced}/1.xml (100%) rename example/diameter/launcher/resources/{ => advanced}/1xml-23.txt (100%) rename example/diameter/launcher/resources/{ => advanced}/README (100%) rename example/diameter/launcher/resources/{ => advanced}/answerXml.sh (100%) rename example/diameter/launcher/resources/{ => advanced}/args.txt (100%) rename example/diameter/launcher/resources/{ => advanced}/batch.sh (100%) rename example/diameter/launcher/resources/{ => advanced}/burst.sh (100%) rename example/diameter/launcher/resources/{ => advanced}/clientSocketManager.sh (100%) rename example/diameter/launcher/resources/{ => advanced}/code.sh (100%) rename example/diameter/launcher/resources/{ => advanced}/collect.sh (100%) rename example/diameter/launcher/resources/{ => advanced}/data-initial.msk (100%) rename example/diameter/launcher/resources/{ => advanced}/data-termination.msk (100%) rename example/diameter/launcher/resources/{ => advanced}/data-update1.msk (100%) rename example/diameter/launcher/resources/{ => advanced}/data-update2.msk (100%) rename example/diameter/launcher/resources/{ => advanced}/data.sh (100%) rename example/diameter/launcher/resources/{ => advanced}/decode.sh (100%) rename example/diameter/launcher/resources/{ => advanced}/diameterServerSessions.sh (100%) rename example/diameter/launcher/resources/{ => advanced}/help.sh (100%) rename example/diameter/launcher/resources/{ => advanced}/loadXml.sh (100%) rename example/diameter/launcher/resources/{ => advanced}/pre-start.sh (73%) rename example/diameter/launcher/resources/{ => advanced}/sendXml.sh (100%) rename example/diameter/launcher/resources/{ => advanced}/sms.msk (100%) rename example/diameter/launcher/resources/{ => advanced}/sms.sh (100%) rename example/diameter/launcher/{resources_lite => resources/basic}/README (100%) rename example/diameter/launcher/{resources_lite => resources/basic}/configure.sh (98%) rename example/diameter/launcher/{resources_lite => resources/basic}/hex_examples/tspCCA.hex (100%) rename example/diameter/launcher/{resources_lite => resources/basic}/hex_examples/tspCCR.hex (100%) rename example/diameter/launcher/{resources_lite => resources/basic}/operation.sh (100%) rename example/diameter/launcher/{resources_lite => resources/basic}/xml_examples/ccr.xml (100%) create mode 100644 example/diameter/launcher/resources/ft-client/README create mode 100755 example/diameter/launcher/resources/ft-client/args.txt create mode 120000 example/diameter/launcher/resources/ft-client/hex_examples create mode 120000 example/diameter/launcher/resources/ft-client/operation.sh create mode 100755 example/diameter/launcher/resources/ft-client/pre-start.sh create mode 120000 example/diameter/launcher/resources/ft-client/xml_examples diff --git a/example/diameter/launcher/DEPLOY.sh b/example/diameter/launcher/DEPLOY.sh index 04361e2..d3725d3 100755 --- a/example/diameter/launcher/DEPLOY.sh +++ b/example/diameter/launcher/DEPLOY.sh @@ -1,14 +1,18 @@ #!/bin/bash -# Functions & variables +############# +# VARIABLES # +############# 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=./debug/example_diameter_launcher DPATH_dflt=$HOME/ADL -RESOURCES_DIR=resources +############# +# FUNCTIONS # +############# _exit () { echo echo $1 @@ -16,30 +20,32 @@ _exit () { exit } +# $1: deployment type createRunScript () { - echo "#!/bin/bash" > run.sh - echo "EXE=\`cat .exe 2>/dev/null\`" >> run.sh - echo "STARTED=\`pgrep \$EXE2>/dev/null\`" >> run.sh - echo "[ \$? -eq 0 ] && { echo \"Already started!\"; echo \"\$STARTED\" ; exit 1 ; }" >> run.sh - echo "./pre-start.sh" >> run.sh - echo "> launcher.traces" >> run.sh - echo "EXE=\"./ADL-launcher\"" >> run.sh - echo "echo \$EXE > .exe" >> run.sh - echo >> run.sh - echo -n "\$EXE " >> run.sh - for i in `cat args.txt | grep -v "^#"` - do - echo -n "$i " >> run.sh - done - echo -n "-cntDir counters " >> run.sh - echo "&" >> run.sh + # Basic launcher 'run.sh' will be created at deployment configuration: + [ "$1" = "b" ] && return + [ "$1" = "a" ] && exe=ADL-launcher + [ "$1" = "f" ] && { exe=ADL-ftclient ; ln -s ADL-launcher $exe ; } + + cat << EOF > run.sh +#!/bin/bash +cd \`dirname \$0\` +EXE=$exe +STARTED=\`pgrep \$EXE 2>/dev/null\` +[ \$? -eq 0 ] && { echo "Already started!"; echo "\$STARTED" ; exit 1 ; } +./pre-start.sh +0> launcher.traces +# Execution line: +./\$EXE -cntDir counters $(for i in `cat args.txt | grep -v "^#"`; do echo -n "$i "; done)& +echo \$! > .pid +EOF + chmod a+x run.sh rm args.txt } createDictionaryPaths () { - for i in stacks/*commands*xml do stacks/dependence.sh $i >/dev/null @@ -81,10 +87,32 @@ echo "Basic checkings ..." [ ! -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 "Deploy one of these versions:" +echo +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." +echo +echo "Input option [b]:" +read option +[ "$option" = "" ] && option=b +case $option in + a) + RESOURCES_DIR=resources/advanced + ;; + + b) + RESOURCES_DIR=resources/basic + ;; + + f) + RESOURCES_DIR=resources/ft-client + ;; + + *) + _exit "Unknown option !!" + ;; +esac echo "Copying ..." mkdir -p $DPATH @@ -92,7 +120,7 @@ mkdir -p $DPATH/stacks mkdir -p $DPATH/DTDs mkdir -p $DPATH/counters cp $EXEC $DPATH/ADL-launcher -cp -r $RESOURCES_DIR/* $DPATH +cp -rL $RESOURCES_DIR/* $DPATH cp $SETUPS_DIR/*xml $DPATH/stacks cp $SETUPS_DIR/*sh $DPATH/stacks cp $SETUPS_DIR/readme.txt $DPATH/stacks @@ -101,7 +129,7 @@ cp $DCTDTD $DPATH/DTDs echo "Preparing ..." cd $DPATH -[ "$deploy_type" != "l" ] && createRunScript +createRunScript $option createDictionaryPaths cd - >/dev/null diff --git a/example/diameter/launcher/resources/1.xml b/example/diameter/launcher/resources/advanced/1.xml similarity index 100% rename from example/diameter/launcher/resources/1.xml rename to example/diameter/launcher/resources/advanced/1.xml diff --git a/example/diameter/launcher/resources/1xml-23.txt b/example/diameter/launcher/resources/advanced/1xml-23.txt similarity index 100% rename from example/diameter/launcher/resources/1xml-23.txt rename to example/diameter/launcher/resources/advanced/1xml-23.txt diff --git a/example/diameter/launcher/resources/README b/example/diameter/launcher/resources/advanced/README similarity index 100% rename from example/diameter/launcher/resources/README rename to example/diameter/launcher/resources/advanced/README diff --git a/example/diameter/launcher/resources/answerXml.sh b/example/diameter/launcher/resources/advanced/answerXml.sh similarity index 100% rename from example/diameter/launcher/resources/answerXml.sh rename to example/diameter/launcher/resources/advanced/answerXml.sh diff --git a/example/diameter/launcher/resources/args.txt b/example/diameter/launcher/resources/advanced/args.txt similarity index 100% rename from example/diameter/launcher/resources/args.txt rename to example/diameter/launcher/resources/advanced/args.txt diff --git a/example/diameter/launcher/resources/batch.sh b/example/diameter/launcher/resources/advanced/batch.sh similarity index 100% rename from example/diameter/launcher/resources/batch.sh rename to example/diameter/launcher/resources/advanced/batch.sh diff --git a/example/diameter/launcher/resources/burst.sh b/example/diameter/launcher/resources/advanced/burst.sh similarity index 100% rename from example/diameter/launcher/resources/burst.sh rename to example/diameter/launcher/resources/advanced/burst.sh diff --git a/example/diameter/launcher/resources/clientSocketManager.sh b/example/diameter/launcher/resources/advanced/clientSocketManager.sh similarity index 100% rename from example/diameter/launcher/resources/clientSocketManager.sh rename to example/diameter/launcher/resources/advanced/clientSocketManager.sh diff --git a/example/diameter/launcher/resources/code.sh b/example/diameter/launcher/resources/advanced/code.sh similarity index 100% rename from example/diameter/launcher/resources/code.sh rename to example/diameter/launcher/resources/advanced/code.sh diff --git a/example/diameter/launcher/resources/collect.sh b/example/diameter/launcher/resources/advanced/collect.sh similarity index 100% rename from example/diameter/launcher/resources/collect.sh rename to example/diameter/launcher/resources/advanced/collect.sh diff --git a/example/diameter/launcher/resources/data-initial.msk b/example/diameter/launcher/resources/advanced/data-initial.msk similarity index 100% rename from example/diameter/launcher/resources/data-initial.msk rename to example/diameter/launcher/resources/advanced/data-initial.msk diff --git a/example/diameter/launcher/resources/data-termination.msk b/example/diameter/launcher/resources/advanced/data-termination.msk similarity index 100% rename from example/diameter/launcher/resources/data-termination.msk rename to example/diameter/launcher/resources/advanced/data-termination.msk diff --git a/example/diameter/launcher/resources/data-update1.msk b/example/diameter/launcher/resources/advanced/data-update1.msk similarity index 100% rename from example/diameter/launcher/resources/data-update1.msk rename to example/diameter/launcher/resources/advanced/data-update1.msk diff --git a/example/diameter/launcher/resources/data-update2.msk b/example/diameter/launcher/resources/advanced/data-update2.msk similarity index 100% rename from example/diameter/launcher/resources/data-update2.msk rename to example/diameter/launcher/resources/advanced/data-update2.msk diff --git a/example/diameter/launcher/resources/data.sh b/example/diameter/launcher/resources/advanced/data.sh similarity index 100% rename from example/diameter/launcher/resources/data.sh rename to example/diameter/launcher/resources/advanced/data.sh diff --git a/example/diameter/launcher/resources/decode.sh b/example/diameter/launcher/resources/advanced/decode.sh similarity index 100% rename from example/diameter/launcher/resources/decode.sh rename to example/diameter/launcher/resources/advanced/decode.sh diff --git a/example/diameter/launcher/resources/diameterServerSessions.sh b/example/diameter/launcher/resources/advanced/diameterServerSessions.sh similarity index 100% rename from example/diameter/launcher/resources/diameterServerSessions.sh rename to example/diameter/launcher/resources/advanced/diameterServerSessions.sh diff --git a/example/diameter/launcher/resources/help.sh b/example/diameter/launcher/resources/advanced/help.sh similarity index 100% rename from example/diameter/launcher/resources/help.sh rename to example/diameter/launcher/resources/advanced/help.sh diff --git a/example/diameter/launcher/resources/loadXml.sh b/example/diameter/launcher/resources/advanced/loadXml.sh similarity index 100% rename from example/diameter/launcher/resources/loadXml.sh rename to example/diameter/launcher/resources/advanced/loadXml.sh diff --git a/example/diameter/launcher/resources/pre-start.sh b/example/diameter/launcher/resources/advanced/pre-start.sh similarity index 73% rename from example/diameter/launcher/resources/pre-start.sh rename to example/diameter/launcher/resources/advanced/pre-start.sh index e009d71..49a83ff 100755 --- a/example/diameter/launcher/resources/pre-start.sh +++ b/example/diameter/launcher/resources/advanced/pre-start.sh @@ -24,23 +24,23 @@ if [ "$httpServer_dflt" != "" -a "$diameterServer_dflt" != "" -a "$diameterServ then echo "Do you wish to answer wizard commandline configuration ? (y/n) [n]:" read wizard - [[ "$wizard" = "" ]] && wizard=n - [[ "$wizard" = "n" ]] && exit + [ "$wizard" = "" ] && wizard=n + [ "$wizard" = "n" ] && exit fi # DEFAULTS -[[ "$httpServer_dflt" = "" ]] && httpServer_dflt="localhost:9000" -[[ "$diameterServer_dflt" = "" ]] && diameterServer_dflt="localhost:3868" -[[ "$diameterServerSessions_dflt" = "" ]] && diameterServerSessions_dflt=1 -[[ "$entity_dflt" = "" ]] && entity_dflt="localhost:4000,localhost:4001" -[[ "$entityServerSessions_dflt" = "" ]] && entityServerSessions_dflt=0 -[[ "$dictionary_dflt" = "" ]] && dictionary_dflt=dictionary.xml +[ "$httpServer_dflt" = "" ] && httpServer_dflt="localhost:9000" +[ "$diameterServer_dflt" = "" ] && diameterServer_dflt="localhost:3868" +[ "$diameterServerSessions_dflt" = "" ] && diameterServerSessions_dflt=1 +[ "$entity_dflt" = "" ] && entity_dflt="localhost:4000,localhost:4001" +[ "$entityServerSessions_dflt" = "" ] && entityServerSessions_dflt=0 +[ "$dictionary_dflt" = "" ] && dictionary_dflt=dictionary.xml # Wizard echo "HTTP Management interface address (using i.e. curl tool) as : socket literal [$httpServer_dflt]:" read httpServer -[[ "$httpServer" = "" ]] && httpServer=$httpServer_dflt +[ "$httpServer" = "" ] && httpServer=$httpServer_dflt echo "Diameter dictionary: you could use '/opt/bin/anna/example_diameter_stackManagement' tool in order to build" echo " autonomous dictionaries for any kind of application. The key is to concatenate xml contents (ietf, 3gpp," @@ -51,12 +51,12 @@ echo "By default, a QoS Application setup is suggested. Input the desired config echo echo " [$dictionary_dflt]:" read dictionary -[[ "$dictionary" = "" ]] && dictionary=$dictionary_dflt +[ "$dictionary" = "" ] && dictionary=$dictionary_dflt # As server: echo "Diameter own server available connections (0: diameter server disabled) [$diameterServerSessions_dflt]:" read diameterServerSessions -[[ "$diameterServerSessions" = "" ]] && diameterServerSessions=$diameterServerSessions_dflt +[ "$diameterServerSessions" = "" ] && diameterServerSessions=$diameterServerSessions_dflt diameterServer= if test "$diameterServerSessions" != "0" @@ -64,12 +64,12 @@ then echo "Diameter own server address as : socket literal [$diameterServer_dflt]:" read diameterServer fi -[[ "$diameterServer" = "" ]] && diameterServer=$diameterServer_dflt +[ "$diameterServer" = "" ] && diameterServer=$diameterServer_dflt # As client: echo "Diameter entity server sessions (0: diameter entity disabled) [$entityServerSessions_dflt]:" read entityServerSessions -[[ "$entityServerSessions" = "" ]] && entityServerSessions=$entityServerSessions_dflt +[ "$entityServerSessions" = "" ] && entityServerSessions=$entityServerSessions_dflt entity= if test "$entityServerSessions" != "0" @@ -77,7 +77,7 @@ then echo "Target diameter entity (pipe-separated : socket literal list) ["$entity_dflt"]:" read entity fi -[[ "$entity" = "" ]] && entity="$entity_dflt" +[ "$entity" = "" ] && entity="$entity_dflt" # Configure: echo $httpServer > .httpServer diff --git a/example/diameter/launcher/resources/sendXml.sh b/example/diameter/launcher/resources/advanced/sendXml.sh similarity index 100% rename from example/diameter/launcher/resources/sendXml.sh rename to example/diameter/launcher/resources/advanced/sendXml.sh diff --git a/example/diameter/launcher/resources/sms.msk b/example/diameter/launcher/resources/advanced/sms.msk similarity index 100% rename from example/diameter/launcher/resources/sms.msk rename to example/diameter/launcher/resources/advanced/sms.msk diff --git a/example/diameter/launcher/resources/sms.sh b/example/diameter/launcher/resources/advanced/sms.sh similarity index 100% rename from example/diameter/launcher/resources/sms.sh rename to example/diameter/launcher/resources/advanced/sms.sh diff --git a/example/diameter/launcher/resources_lite/README b/example/diameter/launcher/resources/basic/README similarity index 100% rename from example/diameter/launcher/resources_lite/README rename to example/diameter/launcher/resources/basic/README diff --git a/example/diameter/launcher/resources_lite/configure.sh b/example/diameter/launcher/resources/basic/configure.sh similarity index 98% rename from example/diameter/launcher/resources_lite/configure.sh rename to example/diameter/launcher/resources/basic/configure.sh index 335e4ff..39a1e82 100755 --- a/example/diameter/launcher/resources_lite/configure.sh +++ b/example/diameter/launcher/resources/basic/configure.sh @@ -41,10 +41,8 @@ createRunScript () { cat << EOF > run.sh #!/bin/bash cd \`dirname \$0\` -EXE=\`cat .exe 2>/dev/null\` STARTED=\`pgrep $1 2>/dev/null\` [ \$? -eq 0 ] && { echo "Already started!"; echo "\$STARTED" ; exit 1 ; } -echo $1 > .exe 0> launcher.traces # Execution line: ./$@ & diff --git a/example/diameter/launcher/resources_lite/hex_examples/tspCCA.hex b/example/diameter/launcher/resources/basic/hex_examples/tspCCA.hex similarity index 100% rename from example/diameter/launcher/resources_lite/hex_examples/tspCCA.hex rename to example/diameter/launcher/resources/basic/hex_examples/tspCCA.hex diff --git a/example/diameter/launcher/resources_lite/hex_examples/tspCCR.hex b/example/diameter/launcher/resources/basic/hex_examples/tspCCR.hex similarity index 100% rename from example/diameter/launcher/resources_lite/hex_examples/tspCCR.hex rename to example/diameter/launcher/resources/basic/hex_examples/tspCCR.hex diff --git a/example/diameter/launcher/resources_lite/operation.sh b/example/diameter/launcher/resources/basic/operation.sh similarity index 100% rename from example/diameter/launcher/resources_lite/operation.sh rename to example/diameter/launcher/resources/basic/operation.sh diff --git a/example/diameter/launcher/resources_lite/xml_examples/ccr.xml b/example/diameter/launcher/resources/basic/xml_examples/ccr.xml similarity index 100% rename from example/diameter/launcher/resources_lite/xml_examples/ccr.xml rename to example/diameter/launcher/resources/basic/xml_examples/ccr.xml diff --git a/example/diameter/launcher/resources/ft-client/README b/example/diameter/launcher/resources/ft-client/README new file mode 100644 index 0000000..37c1353 --- /dev/null +++ b/example/diameter/launcher/resources/ft-client/README @@ -0,0 +1,26 @@ +ABOUT CONTENT +------------- +Template for xml messages (message.dtd) and dictionaries (dictionary.dtd) are informative, not +actually required by process. They are located at './DTDs'. Stacks are available at './stacks'. +There are also some stuff (hex/xml examples, etc.) which could be useful. + +The script 'test.sh is an example of scheduler which launch a request to the server and then +waits for a specific answer to continuing testing. Some functions could be reused to prepare +any kind of testing. The method used is quite simple: monitor the launcher traffic log for +incoming activity. An advanced FT test framework involves the use of the ANNA::diameter API +in an ad-hoc diameter client executable (for example we could define an incoming handler in +different libraries which represent different test cases, linking them to a common simple +diameter client agent). + +STARTING THE PROCESS +-------------------- +Launch the executable process without arguments to see a complete command-line help. +Don't be scared. There are plenty of possibilities but the 'run.sh' script has been prepared +for the type of launcher you wanted. + +OPERATION +--------- +Management interface for this version is based on SIGUSR2 signal caugh. Use './operation.sh' +script to send any operation to the process. Ask for help with that script to see all the +operations supported. + diff --git a/example/diameter/launcher/resources/ft-client/args.txt b/example/diameter/launcher/resources/ft-client/args.txt new file mode 100755 index 0000000..2ee9a85 --- /dev/null +++ b/example/diameter/launcher/resources/ft-client/args.txt @@ -0,0 +1,4 @@ +-dictionary `grep -v ^# .dictionary` +-entity `grep -v ^# .entity` +-entityServerSessions `grep -v ^# .entityServerSessions` +-splitLog diff --git a/example/diameter/launcher/resources/ft-client/hex_examples b/example/diameter/launcher/resources/ft-client/hex_examples new file mode 120000 index 0000000..9eee58b --- /dev/null +++ b/example/diameter/launcher/resources/ft-client/hex_examples @@ -0,0 +1 @@ +../basic/hex_examples \ No newline at end of file diff --git a/example/diameter/launcher/resources/ft-client/operation.sh b/example/diameter/launcher/resources/ft-client/operation.sh new file mode 120000 index 0000000..a61ab5e --- /dev/null +++ b/example/diameter/launcher/resources/ft-client/operation.sh @@ -0,0 +1 @@ +../basic/operation.sh \ No newline at end of file diff --git a/example/diameter/launcher/resources/ft-client/pre-start.sh b/example/diameter/launcher/resources/ft-client/pre-start.sh new file mode 100755 index 0000000..b1863af --- /dev/null +++ b/example/diameter/launcher/resources/ft-client/pre-start.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +# Remove logs: +rm *.log* *.csv 2>/dev/null + +# Client sockets: +entity_dflt=`cat .entity 2>/dev/null` +entityServerSessions_dflt=`cat .entityServerSessions 2>/dev/null` + +# Stack: +dictionary_dflt=`cat .dictionary 2>/dev/null` + +echo +echo +# If all have values: +if [ "$entity_dflt" != "" -a "$entityServerSessions_dflt" != "" -a "$dictionary_dflt" != "" ] +then + echo "Do you wish to answer wizard commandline configuration ? (y/n) [n]:" + read wizard + [ "$wizard" = "" ] && wizard=n + [ "$wizard" = "n" ] && exit +fi + +# DEFAULTS +#[ "$entity_dflt" = "" ] && entity_dflt="192.168.12.11:3868,192.168.12.21:3868" +[ "$entity_dflt" = "" ] && entity_dflt="localhost:3868" +[ "$entityServerSessions_dflt" = "" ] && entityServerSessions_dflt=10 +[ "$dictionary_dflt" = "" ] && dictionary_dflt=dictionary.xml + + +# Wizard +echo "Diameter dictionary: you could use '/opt/bin/anna/example_diameter_stackManagement' tool in order to build" +echo " autonomous dictionaries for any kind of application. The key is to concatenate xml contents (ietf, 3gpp," +echo " vendor-specific, etc.). See 'example/diameter/stackManagement/self_ruling_setups.sh' for this." +echo +echo "This launcher can also join them providing a comma-separated list (dictionaries available on ./stack)." +echo "By default, a QoS Application setup is suggested. Input the desired configuration instead, or press ENTER:" +echo +echo " [$dictionary_dflt]:" +read dictionary +[ "$dictionary" = "" ] && dictionary=$dictionary_dflt + +# As client: +echo "Diameter entity server sessions (0: diameter entity disabled) [$entityServerSessions_dflt]:" +read entityServerSessions +[ "$entityServerSessions" = "" ] && entityServerSessions=$entityServerSessions_dflt + +entity= +if test "$entityServerSessions" != "0" +then + echo "Target diameter entity (pipe-separated : socket literal list) ["$entity_dflt"]:" + read entity +fi +[ "$entity" = "" ] && entity="$entity_dflt" + +# Configure: +echo $dictionary > .dictionary +echo $entity > .entity +echo $entityServerSessions > .entityServerSessions + +echo +echo + diff --git a/example/diameter/launcher/resources/ft-client/xml_examples b/example/diameter/launcher/resources/ft-client/xml_examples new file mode 120000 index 0000000..903e6fe --- /dev/null +++ b/example/diameter/launcher/resources/ft-client/xml_examples @@ -0,0 +1 @@ +../basic/xml_examples \ No newline at end of file -- 2.20.1