6 SETUPS_DIR=../../../source/diameter/stack/setups
7 MSGDTD=../../../include/anna/diameter/codec/message.dtd
8 DCTDTD=../../../include/anna/diameter/stack/dictionary.dtd
9 SERVICES=./resources/services_examples
10 STACK_EXAMPLES=./resources/stack_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 )
22 DYNLIB_installed=/usr/local/lib/libanna_dynamicLauncherProcedure.so
23 DYNLIBS=( $DYNLIB_installed ../../../dynamic/launcher/default/release/libanna_dynamicLauncherProcedure.so ../../../dynamic/launcher/default/debug/libanna_dynamicLauncherProcedure.so )
36 echo "Usage: $0 [deployment_type: a|b|f|s] [deployment_path]"
38 echo " deployment_type:"
41 echo " f=function test client"
42 echo " s=system test client"
43 echo " deployment_path:"
44 echo " non-existent path directory."
47 echo " $0 b $HOME/ADML-basicServer"
48 echo " $0 b $HOME/ADML-MMSbalancer"
49 echo " $0 f $HOME/ADML-tester"
50 echo " $0 s $HOME/ADML-stress-client"
57 # Basic launcher 'run.sh' will be created at deployment configuration:
58 [ "$1" = "b" ] && return
61 [ "$1" = "a" ] && other="--httpServer \`grep -v ^# .httpServer\`"
62 [ "$1" = "f" ] && ln -s ADML-launcher $EXE
63 [ "$1" = "s" ] && { other="--disableLogs"; ln -s ADML-launcher $EXE ; }
65 echo "Creating 'run.sh' script ..."
71 STARTED=\`pgrep \$EXE$ 2>/dev/null\`
72 [ \$? -eq 0 ] && { echo "Already started!"; echo "\$STARTED" ; exit 1 ; }
75 rm -f counters/* test-reports/*
77 export LD_LIBRARY_PATH=\$PWD
78 ./\$EXE --services services.xml --cntDir counters --tmDir test-reports $other &
90 echo "---------------------------------------"
91 echo "Anna Diameter Launcher (ADML) deployment"
92 echo "---------------------------------------"
93 [ "$1" = "--help" -o "$1" = "-h" ] && usage
94 echo " (--help or -h for more info)"
96 echo "Basic checkings ..."
98 # Launcher executable:
100 for EXEC in ${EXECS[@]}; do
101 echo -n "Looking executable at '$EXEC' ... "
102 [ -x $EXEC ] && { available=yes ; echo "available !" ; break ; }
105 [ -z "$available" ] && _exit "Anna Diameter Launcher (ADML) is not installed neither linked. See README.md (Install section)."
107 # Dictionary creation:
109 for STACKMGMT_EXEC in ${STACKMGMT_EXECS[@]}; do
110 echo -n "Looking stack management executable at '$STACKMGMT_EXEC' ... "
111 [ -x $STACKMGMT_EXEC ] && { available=yes ; echo "available !" ; break ; }
114 [ -z "$available" ] && _exit "Anna Diameter Stack Management Tool is not installed neither linked. See README.md (Install section)."
115 STACKMGMT_EXEC=`readlink -f $STACKMGMT_EXEC`
119 for DYNLIB in ${DYNLIBS[@]}; do
120 echo -n "Looking dynamic library at '$DYNLIB' ... "
121 [ -x $DYNLIB ] && { available=yes ; echo "available !" ; break ; }
124 [ -z "$available" ] && _exit "Anna Diameter Launcher Dynamic Procedure Library (ADML) is not installed neither linked. See README.md (Install section)."
126 [ ! -d $SETUPS_DIR ] && _exit "Diameter stacks not found ($SETUPS_DIR)."
132 echo "Deploy one of these versions:"
134 echo " (a)dvanced version: includes burst management script and templates for different scenarios. Automatic configuration during start."
135 echo " (b)asic version: 4 types of launcher (client, server, balancer, dummy), lightly configured and managed through SIGURS2 method."
136 echo " (f)unction test client: special client with regexp scheduler script based on splitted traffic logs. Requires a server to perform the tests."
137 echo " (s)ystem test client: special client for stress testing. Requires a server/s to perform the tests."
139 echo "Input option [b]:"
141 [ "$option" = "" ] && option=b
148 echo "Advanced deployment"
149 DEPLOYMENTS_DIR=deployments/advanced
150 DPATH_dflt=$HOME/ADML-advanced
154 echo "Basic deployment"
155 DEPLOYMENTS_DIR=deployments/basic
156 DPATH_dflt=$HOME/ADML-basic
161 DEPLOYMENTS_DIR=deployments/ft-client
162 DPATH_dflt=$HOME/ADML-ft-client
167 DEPLOYMENTS_DIR=deployments/st-client
168 DPATH_dflt=$HOME/ADML-st-client
172 _exit "Invalid deployment type '$option' !!"
179 echo "Input deployment path [$DPATH_dflt]:"
181 [ "$DPATH" = "" ] && DPATH=$DPATH_dflt
186 [ -d $DPATH ] && _exit "The installation path '$DPATH' must not exists."
187 EXE=`basename $DPATH`
189 echo "Copying to '$DPATH' ..."
191 mkdir -p $DPATH/stacks
193 mkdir -p $DPATH/counters
194 mkdir -p $DPATH/test-reports
197 [ "$option" = "b" ] && mkdir -p $DPATH/services
200 if [ "$EXEC" = "$EXEC_installed" ]
202 ln -s $EXEC_installed $DPATH/ADML-launcher
204 cp $EXEC $DPATH/ADML-launcher
207 # Stack management tool:
208 if [ "$STACKMGMT_EXEC" = "$STACKMGMT_EXEC_installed" ]
210 ln -s $STACKMGMT_EXEC_installed $DPATH/stacks/stack-mgmt
212 # Copy binary just in case:
213 [ ! -f $DPATH/stacks/stack-mgmt ] && cp $STACKMGMT_EXEC $DPATH/stacks/stack-mgmt
215 cp -rL $DEPLOYMENTS_DIR/* $DPATH
216 cp $SETUPS_DIR/*xml $DPATH/stacks
217 cp $SETUPS_DIR/*sh $DPATH/stacks
218 cp $SETUPS_DIR/readme.txt $DPATH/stacks
219 mkdir $DPATH/stacks/other_examples
220 cp $STACK_EXAMPLES/* $DPATH/stacks/other_examples
221 cp $MSGDTD $DPATH/DTDs
222 cp $DCTDTD $DPATH/DTDs
223 cp $SRVDTD $DPATH/DTDs
224 [ "$option" = "b" ] && cp $SERVICES/* $DPATH/services
228 createRunScript $option
229 stacks/makeAutonomous.sh commands_qosControl.xml stacks/stack-mgmt >/dev/null
230 ln -s stacks/autonomous.commands_qosControl.xml dictionary.xml
235 echo "Go to '$DPATH' and see README file"