From: Eduardo Ramos Testillano Date: Wed, 19 Jun 2013 02:20:11 +0000 (-0700) Subject: - X-Git-Tag: REFACTORING_TESTING_LIBRARY~279 X-Git-Url: https://git.teslayout.com/public/public/public/?a=commitdiff_plain;h=44692a07c8149febf90b9c2c652a13ae79ceab9e;p=anna.git - --- diff --git a/example/diameter/launcher/DEPLOY.sh b/example/diameter/launcher/DEPLOY.sh index d574860..59097fc 100755 --- a/example/diameter/launcher/DEPLOY.sh +++ b/example/diameter/launcher/DEPLOY.sh @@ -2,7 +2,8 @@ # Functions & variables SETUPS_DIR=../../../source/diameter/stack/setups -MSGDTD_DIR=../../../source/diameter/codec/message.dtd +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 DPATH_dflt=$HOME/ADL @@ -16,50 +17,45 @@ _exit () { createRunScript () { -echo "#!/bin/ksh" > run.sh -echo "EXE=\`cat .exe 2>/dev/null\`" >> run.sh -echo "STARTED=\`ps -fea | grep \"\$EXE\" | grep -v grep\`" >> run.sh -echo "[ \"\$EXE\" != \"\" -a \"\$STARTED\" != \"\" ] && { echo \"Already started!\"; echo \"\$STARTED\" ; exit ; }" >> run.sh -echo "pre-start.sh" >> run.sh -echo "> launcher.traces" >> run.sh -echo "EXE=\"ndl_\`date '+%Y%m%d%H%M%S'\`\"" >> run.sh -echo "echo \$EXE > .exe" >> run.sh -#echo "rm \$EXE 2>/dev/null" >> run.sh -echo "echo ; echo \"Executable paths:\" ; echo" >> run.sh -echo "for i in \`ls execs/.*/*\` ; do echo \$i ; done" >> run.sh -echo "echo ; echo \"Input the executable path:\" ; read path ; while test \"\$path\" = \"\" ; do read path ; done" >> run.sh -echo "ln -s \$path \$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 "&" >> run.sh -chmod a+x run.sh -rm args.txt + echo "#!/bin/ksh" > run.sh + echo "EXE=\`cat .exe 2>/dev/null\`" >> run.sh + echo "STARTED=\`ps -fea | grep \"\$EXE\" | grep -v grep\`" >> run.sh + echo "[ \"\$EXE\" != \"\" -a \"\$STARTED\" != \"\" ] && { echo \"Already started!\"; echo \"\$STARTED\" ; exit ; }" >> 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 "&" >> run.sh + chmod a+x run.sh + rm args.txt } createDictionaryPaths () { for i in stacks/*commands*xml -do - stacks/dependence.sh $i >/dev/null - stack=`basename $i` - if test "$stack" != "$BASE_PROT" - then + 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 "${j},\c" >> .dictionary__${stack} + echo -n "${j}," >> .dictionary__${stack} done echo "stacks/$BASE_PROT,stacks/${stack}" >> .dictionary__${stack} - fi -done + fi + done -# Default: -ln -s .dictionary__commands_qosControl.xml .dictionary + # Default: + ln -s .dictionary__commands_qosControl.xml .dictionary } ############# @@ -70,22 +66,24 @@ echo "---------------------------------------" echo "Anna Diameter Launcher (ADL) deployment" echo "---------------------------------------" echo -echo "Input deployment path [$DPATH_dftl]:" +echo "Input deployment path [$DPATH_dflt]:" read DPATH [[ "$DPATH" = "" ]] && DPATH=$DPATH_dflt -mkdir -p $DPATH -mkdir $DPATH/stacks +[[ -d $DPATH ]] && _exit "The path '$DPATH' already exists. Remove it before continue..." echo "Basic checkings ..." -[[ ! -f $EXEC ]] && salir "Anna Diameter Launcher (ADL) is not installed in the system. Execute 'sudo scons install' for 'anna' suite." -[[ ! -d $SETUPS_DIR ]] && salir "Diameter stacks not found ($SETUPS_DIR). Perhaps you executed '$0' out of its parent path." +[[ ! -f $EXEC ]] && _exit "Anna Diameter Launcher (ADL) is not installed in the system. Execute 'sudo scons install' for 'anna' suite." +[[ ! -d $SETUPS_DIR ]] && _exit "Diameter stacks not found ($SETUPS_DIR). Perhaps you executed this script out of its parent path." echo "Copying ..." -cp $EXEC $DPATH/launcher +mkdir -p $DPATH +mkdir -p $DPATH/stacks +cp $EXEC $DPATH/ADL-launcher cp resources/* $DPATH cp $SETUPS_DIR/*xml $DPATH/stacks cp $SETUPS_DIR/*sh $DPATH/stacks -cp $MSGDTD_DIR $DPATH +cp $MSGDTD $DPATH +cp $DCTDTD $DPATH echo "Preparing ..." cd $DPATH @@ -94,16 +92,9 @@ createDictionaryPaths cd - >/dev/null # Help: -echo "Stacks available at '.dictionary__', create a symbolic link from '.dictionary'." >> tmp/README -echo "Template for xml messages: message.dtd (informative, not actually required by process)" >> tmp/README -echo "Start with 'run.sh'" >> tmp/README - -mv tmp ADL-installer -tar cvfz ADL-installer.tar.gz ADL-installer -rm -rf ADL-installer - echo -echo "Created ADL-installer.tar.gz !" +echo "Stacks available at '.dictionary__', create a symbolic link from '.dictionary'." +echo "That link points now to an QoS application dictionary. Template for xml messages (message.dtd) and" +echo " dictionaries (dictionary.dtd) are informative, not actually required by process. Start with 'run.sh'." +echo echo - - diff --git a/example/diameter/launcher/main.cpp b/example/diameter/launcher/main.cpp index 90f40ba..3c43302 100644 --- a/example/diameter/launcher/main.cpp +++ b/example/diameter/launcher/main.cpp @@ -497,7 +497,7 @@ void Launcher::resetCounters() throw() { std::string Launcher::help() const throw() { std::string result = "\n"; result += "\n ------------- HELP -------------\n"; - result += "\nThe Diameter Launcher process is a complete diameter agent with client and server"; + result += "\nThe ADL (ANNA Diameter Launcher) process is a complete diameter agent with client and server"; result += "\ncapabilities as well as balancer (proxy) features. It could be used as diameter server"; result += "\n(i.e. to simulate PCRF nodes, OCS systems, etc.), as diameter client (GGSNs, DPIs, etc.)"; result += "\nand balancer systems to provide failover to external round-robin launchers). Also, auxiliary"; @@ -515,14 +515,14 @@ std::string Launcher::help() const throw() { result += "\nProcess traces are dump on \"launcher.traces\" and could have any trace level (POSIX levels):"; result += "\nusually 'debug' or 'warning'. See ANNA documentation."; result += "\n"; - result += "\nThe ANNA::diameter built-in module provide a great set of characteristics as multiple connections"; + result += "\nThe ANNA::diameter_comm built-in module provide a great set of characteristics as multiple connections"; result += "\non both server and client side, definition for multiple-server entities (and not only two as standard"; result += "\nestablish as minimum), separate statistics analyzer per each resource, automatic CER/CEA and DWR/DWA"; result += "\ngeneration, expiration control and many more features"; result += "\n"; result += "\nOPERATIONS INTERFACE"; result += "\n"; - result += "\nNDL supports several operations via HTTP interface. The HTTP request body content will"; + result += "\nADL supports several operations via HTTP interface. The HTTP request body content will"; result += "\nbe an string with a command:"; result += "\n"; result += "\nFor example, we could launch an operation via curl:"; @@ -781,7 +781,7 @@ int main(int argc, const char** argv) { Launcher::Launcher() : anna::comm::Application("launcher", "DiameterLauncher", "1.1"), a_communicator(NULL) { a_myDiameterEngine = new MyDiameterEngine(); - a_myDiameterEngine->setRealm("NDL.ericsson.com"); + a_myDiameterEngine->setRealm("ADL.ericsson.com"); a_myDiameterEngine->setAutoBind(false); // allow to create client-sessions without binding them, in order to set timeouts. //a_myDiameterEngine->setFreezeEndToEndOnSending(); a_logFile = "launcher.log"; diff --git a/example/diameter/launcher/resources/pre-start.sh b/example/diameter/launcher/resources/pre-start.sh index 48f9ce3..3860b93 100755 --- a/example/diameter/launcher/resources/pre-start.sh +++ b/example/diameter/launcher/resources/pre-start.sh @@ -35,15 +35,15 @@ echo "HTTP Management interface address (using i.e. curl tool) as : read httpServer [[ "$httpServer" = "" ]] && httpServer=$httpServer_dflt -echo "Diameter dictionary: you could use NexusPL 'stackManagement' tool in order to build an autonomous dictionary" -echo " for any kind of application. See '/test.ss/diameter.ss/stackManagement.p/self_ruling_setups.sh'." +echo "Diameter dictionary: you could use '/opt/bin/anna/example_diameter_stackManagement' tool in order to build an" +echo " autonomous dictionary for any kind of application. See 'example/diameter/stackManagement/self_ruling_setups.sh'." echo [[ "$dictionary_dflt" = "" ]] && dictionary_dflt=dictionary.xml echo "Diameter stack pathfiles [$dictionary_dflt]:" read dictionary [[ "$dictionary" = "" ]] && dictionary=$dictionary_dflt -[[ "$diameterServer_dflt" = "" ]] && diameterServer_dflt="ocs2dfed1:3868" +[[ "$diameterServer_dflt" = "" ]] && diameterServer_dflt="localhost:3868" echo "Diameter own server address as : socket literal [$diameterServer_dflt]:" read diameterServer [[ "$diameterServer" = "" ]] && diameterServer=$diameterServer_dflt @@ -54,7 +54,7 @@ read diameterServerSessions [[ "$diameterServerSessions" = "" ]] && diameterServerSessions=$diameterServerSessions_dflt -[[ "$entity_dflt" = "" ]] && entity_dflt="ocs2dfed1:4000,ocs2dfed1:4001" +[[ "$entity_dflt" = "" ]] && entity_dflt="localhost:4000,localhost:4001" echo "Target diameter entity (pipe-separated : socket literal list) ["$entity_dflt"]:" read entity [[ "$entity" = "" ]] && entity="$entity_dflt"