From a6974c96b83e3c9056574010a40a7eaa391e23d9 Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Thu, 20 Jun 2013 10:57:09 -0700 Subject: [PATCH] pre-commit script no control blanks, xml bug solved --- example/diameter/launcher/DEPLOY.sh | 7 +- example/diameter/launcher/resources/README | 23 +++++++ .../diameter/launcher/resources/pre-start.sh | 69 +++++++++++-------- include/anna/xml/DocumentFile.hpp | 4 +- pre-commit.sh | 2 +- 5 files changed, 72 insertions(+), 33 deletions(-) create mode 100644 example/diameter/launcher/resources/README diff --git a/example/diameter/launcher/DEPLOY.sh b/example/diameter/launcher/DEPLOY.sh index e4593be..efa59ce 100755 --- a/example/diameter/launcher/DEPLOY.sh +++ b/example/diameter/launcher/DEPLOY.sh @@ -82,6 +82,7 @@ cp $EXEC $DPATH/ADL-launcher cp resources/* $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 @@ -93,9 +94,9 @@ cd - >/dev/null # Help: echo -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 "Go to '$DPATH' and see README file" +echo +echo "Done!" echo echo diff --git a/example/diameter/launcher/resources/README b/example/diameter/launcher/resources/README new file mode 100644 index 0000000..dbbf5ad --- /dev/null +++ b/example/diameter/launcher/resources/README @@ -0,0 +1,23 @@ + +ABOUT CONTENT +------------- +Stacks available at './stacks'. +The launcher uses the configuration given by '.dictionary' which points to a specification list. +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. + +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. + +DEPLOYED SCRIPTS +---------------- +You could get help about installed resources by mean 'help.sh', which launch a help request to +the started ADL-launcher process http interface. All the implemented http operations could be +launched through a script to make easy use. The http client 'curl' is used by default due to +its presence on common linux distributions. + diff --git a/example/diameter/launcher/resources/pre-start.sh b/example/diameter/launcher/resources/pre-start.sh index 3860b93..24c22b9 100755 --- a/example/diameter/launcher/resources/pre-start.sh +++ b/example/diameter/launcher/resources/pre-start.sh @@ -17,54 +17,69 @@ dictionary_dflt=`cat .dictionary 2>/dev/null` echo echo -# Fast start -quick () { - echo "Do you wish to answer wizard commandline configuration ? (y/n) [n]:" - read wizard - [[ "$wizard" = "" ]] && wizard=n - [[ "$wizard" = "n" ]] && exit -} - -[ "$httpServer_dflt" != "" -a "$diameterServer_dflt" != "" -a "$diameterServerSessions_dflt" != "" -a \ +# If all have values: +if [ "$httpServer_dflt" != "" -a "$diameterServer_dflt" != "" -a "$diameterServerSessions_dflt" != "" -a \ "$entity_dflt" != "" -a "$entityServerSessions_dflt" != "" -a \ - "$dictionary_dflt" != "" ] && quick + "$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 +[[ "$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 -[[ "$httpServer_dflt" = "" ]] && httpServer_dflt="localhost:9000" echo "HTTP Management interface address (using i.e. curl tool) as : socket literal [$httpServer_dflt]:" read httpServer [[ "$httpServer" = "" ]] && httpServer=$httpServer_dflt -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 "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 -[[ "$dictionary_dflt" = "" ]] && dictionary_dflt=dictionary.xml -echo "Diameter stack pathfiles [$dictionary_dflt]:" +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 -[[ "$diameterServer_dflt" = "" ]] && diameterServer_dflt="localhost:3868" -echo "Diameter own server address as : socket literal [$diameterServer_dflt]:" -read diameterServer -[[ "$diameterServer" = "" ]] && diameterServer=$diameterServer_dflt - -[[ "$diameterServerSessions_dflt" = "" ]] && diameterServerSessions_dflt=0 +# As server: echo "Diameter own server available connections (0: diameter server disabled) [$diameterServerSessions_dflt]:" read diameterServerSessions [[ "$diameterServerSessions" = "" ]] && diameterServerSessions=$diameterServerSessions_dflt +diameterServer= +if test "$diameterServerSessions" != "0" +then + echo "Diameter own server address as : socket literal [$diameterServer_dflt]:" + read diameterServer +fi +[[ "$diameterServer" = "" ]] && diameterServer=$diameterServer_dflt -[[ "$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" - -[[ "$entityServerSessions_dflt" = "" ]] && entityServerSessions_dflt=1 +# 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 $httpServer > .httpServer echo $dictionary > .dictionary echo $diameterServer > .diameterServer diff --git a/include/anna/xml/DocumentFile.hpp b/include/anna/xml/DocumentFile.hpp index 7e51f1c..9283e60 100644 --- a/include/anna/xml/DocumentFile.hpp +++ b/include/anna/xml/DocumentFile.hpp @@ -73,7 +73,7 @@ public: * \return Root node * \warning Need previous initialization */ - const Node* parse() throw(RuntimeException) { return (a_rootNode = parse()); } + const Node* parse() throw(RuntimeException) { return (a_rootNode = Document::parse()); } /** * Parse xml document with dtd and return root node @@ -81,7 +81,7 @@ public: * \return Root node * \warning Need previous initialization */ - const Node* parse(const DTD& dtd) throw(RuntimeException) { return (a_rootNode = parse(dtd)); } + const Node* parse(const DTD& dtd) throw(RuntimeException) { return (a_rootNode = Document::parse(dtd)); } /** * XML representation from loaded document diff --git a/pre-commit.sh b/pre-commit.sh index 12b9cec..8a7577b 100755 --- a/pre-commit.sh +++ b/pre-commit.sh @@ -112,5 +112,5 @@ for file in $files; do done # If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- +#exec git diff-index --check --cached $against -- -- 2.20.1