From 79bd21297c5df234ad210c19956efaa35e4af2ec Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Sun, 15 Mar 2015 12:06:00 +0100 Subject: [PATCH] Tunning of ADL configuration --- example/diameter/launcher/DEPLOY.sh | 1 + .../launcher/resources/basic/configure.sh | 3 +- .../launcher/resources/ft-client/README | 15 +++++----- .../resources/ft-client/tests/case_1.sh | 24 +++++++++++++++ .../resources/ft-client/tests/common.sh | 30 +++++++++++++++++++ 5 files changed, 65 insertions(+), 8 deletions(-) create mode 100755 example/diameter/launcher/resources/ft-client/tests/case_1.sh create mode 100755 example/diameter/launcher/resources/ft-client/tests/common.sh diff --git a/example/diameter/launcher/DEPLOY.sh b/example/diameter/launcher/DEPLOY.sh index d3725d3..eaec5b3 100755 --- a/example/diameter/launcher/DEPLOY.sh +++ b/example/diameter/launcher/DEPLOY.sh @@ -36,6 +36,7 @@ STARTED=\`pgrep \$EXE 2>/dev/null\` [ \$? -eq 0 ] && { echo "Already started!"; echo "\$STARTED" ; exit 1 ; } ./pre-start.sh 0> launcher.traces +rm -f counters/* # Execution line: ./\$EXE -cntDir counters $(for i in `cat args.txt | grep -v "^#"`; do echo -n "$i "; done)& echo \$! > .pid diff --git a/example/diameter/launcher/resources/basic/configure.sh b/example/diameter/launcher/resources/basic/configure.sh index 39a1e82..2d7470c 100755 --- a/example/diameter/launcher/resources/basic/configure.sh +++ b/example/diameter/launcher/resources/basic/configure.sh @@ -6,7 +6,7 @@ # Diameter dictionary: STD_DICTIONARY=stacks/avps_etsi.xml,stacks/avps_ietf.xml,stacks/avps_tgpp.xml,stacks/commands_baseProtocol.xml -APP_DICTIONARY=stacks/commands_pccPS_EricssonSAPC_se.xml +APP_DICTIONARY=stacks/commands_qosControl.xml DICTIONARY=$STD_DICTIONARY,$APP_DICTIONARY # Perhaps the stack is not fully defined: KINDNESS=-ignoreErrors @@ -44,6 +44,7 @@ cd \`dirname \$0\` STARTED=\`pgrep $1 2>/dev/null\` [ \$? -eq 0 ] && { echo "Already started!"; echo "\$STARTED" ; exit 1 ; } 0> launcher.traces +rm -f counters/* # Execution line: ./$@ & echo \$! > .pid diff --git a/example/diameter/launcher/resources/ft-client/README b/example/diameter/launcher/resources/ft-client/README index 37c1353..84e5128 100644 --- a/example/diameter/launcher/resources/ft-client/README +++ b/example/diameter/launcher/resources/ft-client/README @@ -4,13 +4,14 @@ Template for xml messages (message.dtd) and dictionaries (dictionary.dtd) are in 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). +The directory 'tests' contains resources to create FT test cases. The script 'common.sh' implement +a basic scheduler to launch a request to the server, waits for incoming activity, retrieve the +answer received and match such message with certain criteria. Execute 'case_1.sh' as example. + +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). But with +this simple scripts we could do something valid to start with. STARTING THE PROCESS -------------------- diff --git a/example/diameter/launcher/resources/ft-client/tests/case_1.sh b/example/diameter/launcher/resources/ft-client/tests/case_1.sh new file mode 100755 index 0000000..7eca089 --- /dev/null +++ b/example/diameter/launcher/resources/ft-client/tests/case_1.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +############# +# VARIABLES # +############# + + +############# +# FUNCTIONS # +############# + + +############# +# EXECUTION # +############# + +# Goto working directory +cd `dirname $0` + +# Source utils: +source common.sh + +# xxxx +echo "testing ..." diff --git a/example/diameter/launcher/resources/ft-client/tests/common.sh b/example/diameter/launcher/resources/ft-client/tests/common.sh new file mode 100755 index 0000000..839bf85 --- /dev/null +++ b/example/diameter/launcher/resources/ft-client/tests/common.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +############# +# VARIABLES # +############# +tmpdir=$(mktemp -d) + + +############# +# FUNCTIONS # +############# + +_exit () { + echo + echo $1 + echo + rm -rf $tmpdir + exit 1 +} + +sigint_handler() { + _exit "Script interrupted. Cleanup & exit ..." +} + +############# +# EXECUTION # +############# + +# Trap sigint signal: +trap sigint_handler SIGINT -- 2.20.1