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 )
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" ] && other="--httpServer \`grep -v ^# .httpServer\`"
58 [ "$1" = "f" ] && ln -s ADML-launcher $EXE
59 [ "$1" = "s" ] && { 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 &
85 echo "---------------------------------------"
86 echo "Anna Diameter Launcher (ADML) deployment"
87 echo "---------------------------------------"
88 [ "$1" = "--help" -o "$1" = "-h" ] && usage
89 echo " (--help or -h for more info)"
91 echo "Basic checkings ..."
92 # Launcher executable:
94 for EXEC in ${EXECS[@]}; do
95 echo -n "Looking executable at '$EXEC' ... "
96 [ -x $EXEC ] && { available=yes ; echo "available !" ; break ; }
99 [ -z "$available" ] && _exit "Anna Diameter Launcher (ADML) is not installed neither linked. See README.md (Install section)."
100 # Dictionary creation:
102 for STACKMGMT_EXEC in ${STACKMGMT_EXECS[@]}; do
103 echo -n "Looking stack management executable at '$STACKMGMT_EXEC' ... "
104 [ -x $STACKMGMT_EXEC ] && { available=yes ; echo "available !" ; break ; }
107 [ -z "$available" ] && _exit "Anna Diameter Stack Management Tool is not installed neither linked. See README.md (Install section)."
108 STACKMGMT_EXEC=`readlink -f $STACKMGMT_EXEC`
110 [ ! -d $SETUPS_DIR ] && _exit "Diameter stacks not found ($SETUPS_DIR)."
116 echo "Deploy one of these versions:"
118 echo " (a)dvanced version: includes burst management script and templates for different scenarios. Automatic configuration during start."
119 echo " (b)asic version: 4 types of launcher (client, server, balancer, dummy), lightly configured and managed through SIGURS2 method."
120 echo " (f)unction test client: special client with regexp scheduler script based on splitted traffic logs. Requires a server to perform the tests."
121 echo " (s)ystem test client: special client for stress testing. Requires a server/s to perform the tests."
123 echo "Input option [b]:"
125 [ "$option" = "" ] && option=b
132 echo "Advanced deployment"
133 DEPLOYMENTS_DIR=deployments/advanced
134 DPATH_dflt=$HOME/ADML-advanced
138 echo "Basic deployment"
139 DEPLOYMENTS_DIR=deployments/basic
140 DPATH_dflt=$HOME/ADML-basic
145 DEPLOYMENTS_DIR=deployments/ft-client
146 DPATH_dflt=$HOME/ADML-ft-client
151 DEPLOYMENTS_DIR=deployments/st-client
152 DPATH_dflt=$HOME/ADML-st-client
156 _exit "Invalid deployment type '$option' !!"
163 echo "Input deployment path [$DPATH_dflt]:"
165 [ "$DPATH" = "" ] && DPATH=$DPATH_dflt
170 [ -d $DPATH ] && _exit "The installation path '$DPATH' must not exists."
171 EXE=`basename $DPATH`
173 echo "Copying to '$DPATH' ..."
175 mkdir -p $DPATH/stacks
177 mkdir -p $DPATH/counters
178 mkdir -p $DPATH/test-reports
179 [ "$option" = "b" ] && mkdir -p $DPATH/services
182 if [ "$EXEC" = "$EXEC_installed" ]
184 ln -s $EXEC_installed $DPATH/ADML-launcher
186 cp $EXEC $DPATH/ADML-launcher
189 # Stack management tool:
190 if [ "$STACKMGMT_EXEC" = "$STACKMGMT_EXEC_installed" ]
192 ln -s $STACKMGMT_EXEC_installed $DPATH/stacks/stack-mgmt
194 # Copy binary just in case:
195 [ ! -f $DPATH/stacks/stack-mgmt ] && cp $STACKMGMT_EXEC $DPATH/stacks/stack-mgmt
197 cp -rL $DEPLOYMENTS_DIR/* $DPATH
198 cp $SETUPS_DIR/*xml $DPATH/stacks
199 cp $SETUPS_DIR/*sh $DPATH/stacks
200 cp $SETUPS_DIR/readme.txt $DPATH/stacks
201 mkdir $DPATH/stacks/other_examples
202 cp $STACK_EXAMPLES/* $DPATH/stacks/other_examples
203 cp $MSGDTD $DPATH/DTDs
204 cp $DCTDTD $DPATH/DTDs
205 cp $SRVDTD $DPATH/DTDs
206 [ "$option" = "b" ] && cp $SERVICES/* $DPATH/services
210 createRunScript $option
211 stacks/makeAutonomous.sh commands_qosControl.xml stacks/stack-mgmt >/dev/null
212 ln -s stacks/autonomous.commands_qosControl.xml dictionary.xml
217 echo "Go to '$DPATH' and see README file"