6 SETUPS_DIR=../../../source/diameter/stack/setups
7 MSGDTD=../../../include/anna/diameter/codec/message.dtd
8 DCTDTD=../../../include/anna/diameter/stack/dictionary.dtd
9 BASE_PROT=commands_baseProtocol.xml
10 SERVICES=./resources/services_examples
11 STACK_EXAMPLES=./resources/stack_examples
12 SRVDTD=$SERVICES/services.dtd
14 # Executables in priority order:
15 EXEC_installed=/opt/bin/anna/example_diameter_launcher
16 EXECS=( $EXEC_installed ./release/example_diameter_launcher ./debug/example_diameter_launcher )
19 STACKMGMT_EXEC_installed=/opt/bin/anna/example_diameter_stackManagement
20 STACKMGMT_EXECS=( $STACKMGMT_EXEC_installed ../stackManagement/release/example_diameter_stackManagement ../stackManagement/debug/example_diameter_stackManagement )
34 echo "Usage: $0 [deployment_type: a|b|f|s] [deployment_path]"
36 echo " deployment_type:"
39 echo " f=function test client"
40 echo " s=system test client"
41 echo " deployment_path:"
42 echo " non-existent path directory."
45 echo " $0 b $HOME/ADML/basicServer"
46 echo " $0 b $HOME/ADML/MMSbalancer"
47 echo " $0 f $HOME/ADML/tester"
48 echo " $0 s $HOME/ADML/stress-client"
55 # Basic launcher 'run.sh' will be created at deployment configuration:
56 [ "$1" = "b" ] && return
59 [ "$1" = "a" ] && other="--httpServer \`grep -v ^# .httpServer\`"
60 [ "$1" = "f" ] && ln -s ADML-launcher $EXE
61 [ "$1" = "s" ] && { other="--disableLogs"; ln -s ADML-launcher $EXE ; }
63 echo "Creating 'run.sh' script ..."
69 STARTED=\`pgrep \$EXE$ 2>/dev/null\`
70 [ \$? -eq 0 ] && { echo "Already started!"; echo "\$STARTED" ; exit 1 ; }
73 rm -f counters/* test-reports/*
75 ./\$EXE --services services.xml --cntDir counters --tmDir test-reports $other &
82 createDictionaryPaths () {
83 echo "Creating dictionaries ..."
85 for i in stacks/*commands*xml
87 stacks/dependence.sh $i >/dev/null
89 if test "$stack" != "$BASE_PROT"
91 > .dictionary-${stack}
92 for j in `cat ${i}.dep`
94 echo -n "${j} " >> .dictionary-${stack}
96 echo "stacks/$BASE_PROT stacks/${stack}" >> .dictionary-${stack}
100 # Create autonomous dictionaries:
101 mkdir stacks/autonomous
102 for i in `ls .dictionary-*`
104 name=$(echo $i | cut -d\- -f2)
105 $STACKMGMT_EXEC `cat $i` >/dev/null
106 mv result.xml stacks/autonomous/$name
112 rm -f example_diameter_stackManagement.trace*
115 ln -s stacks/autonomous/commands_qosControl.xml dictionary.xml
123 echo "---------------------------------------"
124 echo "Anna Diameter Launcher (ADML) deployment"
125 echo "---------------------------------------"
126 [ "$1" = "--help" -o "$1" = "-h" ] && usage
127 echo " (--help or -h for more info)"
129 echo "Basic checkings ..."
130 # Launcher executable:
132 for EXEC in ${EXECS[@]}; do
133 echo -n "Looking executable at '$EXEC' ... "
134 [ -x $EXEC ] && { available=yes ; echo "available !" ; break ; }
137 [ -z "$available" ] && _exit "Anna Diameter Launcher (ADML) is not installed neither linked. See README.md (Install section)."
138 # Dictionary creation:
140 for STACKMGMT_EXEC in ${STACKMGMT_EXECS[@]}; do
141 echo -n "Looking stack management executable at '$STACKMGMT_EXEC' ... "
142 [ -x $STACKMGMT_EXEC ] && { available=yes ; echo "available !" ; break ; }
145 [ -z "$available" ] && _exit "Anna Diameter Stack Management Tool is not installed neither linked. See README.md (Install section)."
146 STACKMGMT_EXEC=`readlink -f $STACKMGMT_EXEC`
148 [ ! -d $SETUPS_DIR ] && _exit "Diameter stacks not found ($SETUPS_DIR)."
154 echo "Deploy one of these versions:"
156 echo " (a)dvanced version: includes burst management script and templates for different scenarios. Automatic configuration during start."
157 echo " (b)asic version: 4 types of launcher (client, server, balancer, dummy), lightly configured and managed through SIGURS2 method."
158 echo " (f)unction test client: special client with regexp scheduler script based on splitted traffic logs. Requires a server to perform the tests."
159 echo " (s)ystem test client: special client for stress testing. Requires a server/s to perform the tests."
161 echo "Input option [b]:"
163 [ "$option" = "" ] && option=b
170 echo "Advanced deployment"
171 DEPLOYMENTS_DIR=deployments/advanced
172 DPATH_dflt=$HOME/ADML/advanced
176 echo "Basic deployment"
177 DEPLOYMENTS_DIR=deployments/basic
178 DPATH_dflt=$HOME/ADML/basic
183 DEPLOYMENTS_DIR=deployments/ft-client
184 DPATH_dflt=$HOME/ADML/ft-client
189 DEPLOYMENTS_DIR=deployments/st-client
190 DPATH_dflt=$HOME/ADML/st-client
194 _exit "Invalid deployment type '$option' !!"
201 echo "Input deployment path [$DPATH_dflt]:"
203 [ "$DPATH" = "" ] && DPATH=$DPATH_dflt
208 [ -d $DPATH ] && _exit "The installation path '$DPATH' must not exists."
209 EXE=ADML-`basename $DPATH`
211 echo "Copying to '$DPATH' ..."
213 mkdir -p $DPATH/stacks
215 mkdir -p $DPATH/counters
216 mkdir -p $DPATH/test-reports
217 [ "$option" = "b" ] && mkdir -p $DPATH/services
218 if [ "$EXEC" = "$EXEC_installed" ]
220 ln -s $EXEC_installed $DPATH/ADML-launcher
222 cp $EXEC $DPATH/ADML-launcher
224 cp -rL $DEPLOYMENTS_DIR/* $DPATH
225 cp $SETUPS_DIR/*xml $DPATH/stacks
226 cp $SETUPS_DIR/*sh $DPATH/stacks
227 cp $SETUPS_DIR/readme.txt $DPATH/stacks
228 mkdir $DPATH/stacks/other_examples
229 cp $STACK_EXAMPLES/* $DPATH/stacks/other_examples
230 cp $MSGDTD $DPATH/DTDs
231 cp $DCTDTD $DPATH/DTDs
232 cp $SRVDTD $DPATH/DTDs
233 [ "$option" = "b" ] && cp $SERVICES/* $DPATH/services
237 createRunScript $option
238 createDictionaryPaths
243 echo "Go to '$DPATH' and see README file"