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 SRVDTD=$SERVICES/services.dtd
13 # Executables in priority order:
14 EXEC_installed=/opt/bin/anna/example_diameter_launcher
15 EXECS=( $EXEC_installed ./release/example_diameter_launcher ./debug/example_diameter_launcher )
18 STACKMGMT_EXEC_installed=/opt/bin/anna/example_diameter_stackManagement
19 STACKMGMT_EXECS=( $STACKMGMT_EXEC_installed ../stackManagement/release/example_diameter_stackManagement ../stackManagement/debug/example_diameter_stackManagement )
32 echo "Usage: $0 [deployment_type: a|b|f|s] [deployment_path]"
34 echo " deployment_type:"
37 echo " f=function test client"
38 echo " s=system test client"
39 echo " deployment_path:"
40 echo " non-existent path directory."
43 echo " $0 b $HOME/ADML/basicServer"
44 echo " $0 b $HOME/ADML/MMSbalancer"
45 echo " $0 f $HOME/ADML/tester"
46 echo " $0 s $HOME/ADML/stress-client"
53 # Basic launcher 'run.sh' will be created at deployment configuration:
54 [ "$1" = "b" ] && return
57 [ "$1" = "a" ] && { exe=ADML-launcher ; other="--httpServer \`grep -v ^# .httpServer\`"; }
58 [ "$1" = "f" ] && { exe=ADML-ftclient ; ln -s ADML-launcher $exe ; }
59 [ "$1" = "s" ] && { exe=ADML-stclient ; other="--disableLogs"; ln -s ADML-launcher $exe ; }
61 echo "Creating 'run.sh' script ..."
67 STARTED=\`pgrep \$EXE 2>/dev/null\`
68 [ \$? -eq 0 ] && { echo "Already started!"; echo "\$STARTED" ; exit 1 ; }
71 rm -f counters/* test-reports/*
73 ./\$EXE --services services.xml --cntDir counters --tmDir test-reports $other &
80 createDictionaryPaths () {
81 echo "Creating dictionaries ..."
83 for i in stacks/*commands*xml
85 stacks/dependence.sh $i >/dev/null
87 if test "$stack" != "$BASE_PROT"
89 > .dictionary-${stack}
90 for j in `cat ${i}.dep`
92 echo -n "${j} " >> .dictionary-${stack}
94 echo "stacks/$BASE_PROT stacks/${stack}" >> .dictionary-${stack}
98 # Create autonomous dictionaries:
99 mkdir stacks/autonomous
100 for i in `ls .dictionary-*`
102 name=$(echo $i | cut -d\- -f2)
103 $STACKMGMT_EXEC `cat $i` >/dev/null
104 mv result.xml stacks/autonomous/$name
110 rm -f example_diameter_stackManagement.trace*
113 ln -s stacks/autonomous/commands_qosControl.xml dictionary.xml
121 echo "---------------------------------------"
122 echo "Anna Diameter Launcher (ADML) deployment"
123 echo "---------------------------------------"
124 [ "$1" = "--help" -o "$1" = "-h" ] && usage
125 echo " (--help or -h for more info)"
127 echo "Basic checkings ..."
128 # Launcher executable:
130 for EXEC in ${EXECS[@]}; do
131 echo -n "Looking executable at '$EXEC' ... "
132 [ -x $EXEC ] && { available=yes ; echo "available !" ; break ; }
135 [ -z "$available" ] && _exit "Anna Diameter Launcher (ADML) is not installed neither linked. See README.md (Install section)."
136 # Dictionary creation:
138 for STACKMGMT_EXEC in ${STACKMGMT_EXECS[@]}; do
139 echo -n "Looking stack management executable at '$STACKMGMT_EXEC' ... "
140 [ -x $STACKMGMT_EXEC ] && { available=yes ; echo "available !" ; break ; }
143 [ -z "$available" ] && _exit "Anna Diameter Stack Management Tool is not installed neither linked. See README.md (Install section)."
144 STACKMGMT_EXEC=`readlink -f $STACKMGMT_EXEC`
146 [ ! -d $SETUPS_DIR ] && _exit "Diameter stacks not found ($SETUPS_DIR)."
152 echo "Deploy one of these versions:"
154 echo " (a)dvanced version: includes burst management script and templates for different scenarios. Automatic configuration during start."
155 echo " (b)asic version: 4 types of launcher (client, server, balancer, dummy), lightly configured and managed through SIGURS2 method."
156 echo " (f)unction test client: special client with regexp scheduler script based on splitted traffic logs. Requires a server to perform the tests."
157 echo " (s)ystem test client: special client for stress testing. Requires a server to perform the tests."
159 echo "Input option [b]:"
161 [ "$option" = "" ] && option=b
168 echo "Advanced deployment"
169 DEPLOYMENTS_DIR=deployments/advanced
170 DPATH_dflt=$HOME/ADML/advanced
174 echo "Basic deployment"
175 DEPLOYMENTS_DIR=deployments/basic
176 DPATH_dflt=$HOME/ADML/basic
181 DEPLOYMENTS_DIR=deployments/ft-client
182 DPATH_dflt=$HOME/ADML/ft-client
187 DEPLOYMENTS_DIR=deployments/st-client
188 DPATH_dflt=$HOME/ADML/st-client
192 _exit "Invalid deployment type '$option' !!"
199 echo "Input deployment path [$DPATH_dflt]:"
201 [ "$DPATH" = "" ] && DPATH=$DPATH_dflt
206 [ -d $DPATH ] && _exit "The installation path '$DPATH' must not exists."
208 echo "Copying to '$DPATH' ..."
210 mkdir -p $DPATH/stacks
212 mkdir -p $DPATH/counters
213 mkdir -p $DPATH/test-reports
214 [ "$option" = "b" ] && mkdir -p $DPATH/services
215 if [ "$EXEC" = "$EXEC_installed" ]
217 ln -s $EXEC_installed $DPATH/ADML-launcher
219 cp $EXEC $DPATH/ADML-launcher
221 cp -rL $DEPLOYMENTS_DIR/* $DPATH
222 cp $SETUPS_DIR/*xml $DPATH/stacks
223 cp $SETUPS_DIR/*sh $DPATH/stacks
224 cp $SETUPS_DIR/readme.txt $DPATH/stacks
225 cp $MSGDTD $DPATH/DTDs
226 cp $DCTDTD $DPATH/DTDs
227 cp $SRVDTD $DPATH/DTDs
228 [ "$option" = "b" ] && cp $SERVICES/* $DPATH/services
232 createRunScript $option
233 createDictionaryPaths
238 echo "Go to '$DPATH' and see README file"