not configured before starting ADML instances.
Execute './configure.sh' and follow the intructions to clone the ADML
-instance into the needed amount for system testing.
+instance into the needed amount for system testing. Every time you run
+this, a new 'ADMLS#<description>' directory is created and symlinked
+to 'ADMLS'.
STARTING THE PROCESS
--------------------
you provide 'test|ttps|5', the speed of 5 test cases per second will
be set on every ADML instance. Imagine you have N instances, and then
you actually are establishing a total 5*N speed rate over the servers.
+You could run another 'ADMLS#<description>' directory just providing
+it as argument.
TESTING PROCEDURE
-----------------
Don't forget to populate whatever data you need on the tested system,
because this work is not done here.
+Program script acts over ADMLS symlink. You must update it if want to
+program another ADMLS instances directory.
+
OPERATION
---------
Management interface for lite version is based on SIGUSR2 signal caugh.
any operation to the process. Ask for help with that script to see all
the operations supported.
+Operation script acts over ADMLS symlink. You must update it if want to
+operate another ADMLS instances directory.
+
#############
# VARIABLES #
#############
+CWD=$(dirname $0)
MAXIMUM_ADML_ASYNC_RATE=50
MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE=10
ADML_INSTANCES__ST_CONF_FILE=.st_conf_adml_instances
#############
_exit () {
echo -e "\n$1\n"
- exit 1
+
+ # Cleanup:
+ cd $CWD
+ rm -rf ADMLS.tmp
+ cd services
+ rm -f cer*.xml services.xml *.msk2
+
+ rc=1
+ [ -n "$2" ] && rc=$2
+ exit $rc
+}
+
+sig_handler () {
+ _exit "Script interrupted. Cleanup & exit ..."
}
# ceil of division $1/$2
# EXECUTION #
#############
-cd `dirname $0`
+trap sig_handler INT QUIT TERM
+
+cd $CWD
echo
echo "====================================="
echo "ADML SYSTEM TEST CONFIGURATION WIZARD"
echo "====================================="
echo
-if [ -d ADMLS ]
-then
- echo
- echo "Detected configured layout (*):"
- echo
- ADML_INSTANCES=`cat $ADML_INSTANCES__ST_CONF_FILE 2>/dev/null`
- ADML_CONNECTIONS=`cat $ADML_CONNECTIONS__ST_CONF_FILE 2>/dev/null`
- RATE_PER_INSTANCE=`cat $ADML_RATE_PER_INSTANCE__ST_CONF_FILE 2>/dev/null`
- DESIRED_RATE=`cat $ADML_DESIRED_RATE__ST_CONF_FILE 2>/dev/null`
- REPEATS=`cat $CYCLE_REPEATS__ST_CONF_FILE 2>/dev/null`
- N_TESTCASES=`cat $N_TESTCASES__ST_CONF_FILE 2>/dev/null`
-
- [ -n "$ADML_INSTANCES" ] && echo " $ADML_INSTANCES ADML instances."
- [ -n "$ADML_CONNECTIONS" ] && echo " $ADML_CONNECTIONS connections per ADML instance."
- [ -n "$RATE_PER_INSTANCE" ] && echo " Rate of $RATE_PER_INSTANCE TCs/second and instance."
- [ -n "$DESIRED_RATE" ] && echo " Desired rate was: $DESIRED_RATE TCs/second and instance."
- [ -n "$REPEATS" ] && echo " Number of cycles: $((REPEATS + 1))."
- [ -n "$N_TESTCASES" ] && echo " $N_TESTCASES test cases programmed."
- echo
- operation_result=$(echo "scale=3 ; (1 + $REPEATS) * $N_TESTCASES / $ADML_INSTANCES / $RATE_PER_INSTANCE" | bc)
- echo " Time covered: $((REPEATS + 1)) cycles x ($N_TESTCASES/(${ADML_INSTANCES}x${RATE_PER_INSTANCE})) = $operation_result seconds"
- echo
-
- echo " (*) As ADMLS directory still exists you should move/remove it to continue."
- echo " You may have to 'pkill ADML' before (resources busy)."
- _exit
-fi
[ ! -d services ] && _exit "Missing services configuration (expecting '$PWD/services' directory).\nTake a look to 'services_example' and './dynlibs' scenaries stuff to complete your services.\n\nFor example:\n ln -s services_example services\n cp dynlibs/gx/00001/services/* services\n Edit CER files and 'services.msk' there, to fit your needs."
while [ -z "$minutes" ]; do read minutes; done
seconds=$((minutes*60))
repeats=0
-[ $seconds -gt $time_covered ] && { repeats=$(ceil $seconds $time_covered) ; repeats=$((repeats-1)) ; }
+[ $seconds -gt $time_covered -a $time_covered -gt 0 ] && { repeats=$(ceil $seconds $time_covered) ; repeats=$((repeats-1)) ; }
if [ $repeats -gt 0 ]
then
cycles=$((repeats+1))
else
echo 0 > $CYCLE_REPEATS__ST_CONF_FILE
fi
+
+# Single vs multiple peer:
+echo
+echo "Select [s]ingle peer or (m)ultiple peer [s]:"
+read opt
+peer_seq=
+[ -z "$opt" ] && opt=s
+[ "$opt" = "m" ] && { peer_seq=1 ; echo "Origin-Host will be sequenced for each ADML instance." ; }
+
echo
echo "System test configuration completed."
echo
# Update services.xml regarding the number of client connections:
cd services
-cp services.msk services.xml
-sed -i 's/__CLIENT_CONNECTIONS__/'$G_ADML_CONNECTIONS'/g' services.xml
-cd - >/dev/null
+cp services.msk services.msk2
+for cer in $(ls cer*.msk 2>/dev/null); do cp $cer ${cer}2; done
+cd ..
+
+sed -i 's/__CLIENT_CONNECTIONS__/'$G_ADML_CONNECTIONS'/g' services/services.msk2
# Create instances and layout:
0>$N_TESTCASES_PROGRAM_LAYOUT__ST_CONF_FILE
fin=$((offset + first_value + testcase_per_adml_instance - 1))
echo "$instance $ini $fin" >> $N_TESTCASES_PROGRAM_LAYOUT__ST_CONF_FILE
+ # Case of multiple peer:
+ sed 's/__PEER_SEQ__/'$peer_seq'/g' services/services.msk2 > services/services.xml
+ for cer in $(ls services/cer*.msk2 2>/dev/null)
+ do
+ cer_xml="${cer%.*}.xml"
+ sed 's/__PEER_SEQ__/'$peer_seq'/g' $cer > $cer_xml
+ done
+ [ -n "$peer_seq" ] && peer_seq=$((peer_seq+1))
+
echo "Creating ADML instance $instance ..."
- mkdir -p ADMLS/ADML-$instance
- cd ADMLS/ADML-$instance
+ mkdir -p ADMLS.tmp/ADML-$instance
+ cd ADMLS.tmp/ADML-$instance
mkdir counters
mkdir test-reports
ln -s ../../dynlibs
cp ../../.run-one.sh run.sh
sed -i 's/^EXE=.*/EXE=ADML-'$instance'/' run.sh
ln -s ../../ADML ADML-$instance
- for xml in `ls ../../services/*xml`; do ln -s $xml; done
+ for xml in `ls ../../services/*xml`; do cp $xml .; done
cd - >/dev/null
done
+cd $CWD
+
+# Default ADMLS name:
+echo
+echo "Configured layout:"
+echo
+ADML_INSTANCES=`cat $ADML_INSTANCES__ST_CONF_FILE 2>/dev/null`
+ADML_CONNECTIONS=`cat $ADML_CONNECTIONS__ST_CONF_FILE 2>/dev/null`
+RATE_PER_INSTANCE=`cat $ADML_RATE_PER_INSTANCE__ST_CONF_FILE 2>/dev/null`
+DESIRED_RATE=`cat $ADML_DESIRED_RATE__ST_CONF_FILE 2>/dev/null`
+REPEATS=`cat $CYCLE_REPEATS__ST_CONF_FILE 2>/dev/null`
+N_TESTCASES=`cat $N_TESTCASES__ST_CONF_FILE 2>/dev/null`
+
+[ -n "$ADML_INSTANCES" ] && echo " $ADML_INSTANCES ADML instances."
+[ -n "$ADML_CONNECTIONS" ] && echo " $ADML_CONNECTIONS connections per ADML instance."
+[ -n "$RATE_PER_INSTANCE" ] && echo " Rate of $RATE_PER_INSTANCE TCs/second and instance."
+[ -n "$DESIRED_RATE" ] && echo " Desired rate was: $DESIRED_RATE TCs/second and instance."
+[ -n "$REPEATS" ] && echo " Number of cycles: $((REPEATS + 1))."
+[ -n "$N_TESTCASES" ] && echo " $N_TESTCASES test cases programmed."
+echo
+operation_result=$(echo "scale=3 ; (1 + $REPEATS) * $N_TESTCASES / $ADML_INSTANCES / $RATE_PER_INSTANCE" | bc)
+echo " Time covered: $((REPEATS + 1)) cycles x ($N_TESTCASES/(${ADML_INSTANCES}x${RATE_PER_INSTANCE})) = $operation_result seconds"
+echo
+ADMLS__dflt="ADMLS#${ADML_INSTANCES}instances.${ADML_CONNECTIONS}connectionsPerInstance"
+if [ -n "$peer_seq" ]
+then
+ ADMLS__dflt="${ADMLS__dflt}.MultiplePeer"
+else
+ ADMLS__dflt="${ADMLS__dflt}.SinglePeer"
+fi
+
+echo
+echo "Input a name for the ADMLS instances directory [$ADMLS__dflt]:"
+read ADMLS_NAME
+[ "$ADMLS_NAME" = "" ] && ADMLS_NAME=$ADMLS__dflt
+while [ -e "$ADMLS_NAME" ]
+do
+ ADMLS_NAME=
+ echo "Some file/directory already exists with that name ! Please, input another one:"
+ while [ -z "$ADMLS_NAME" ]; do read ADMLS_NAME; done
+done
+
+mv ADMLS.tmp $ADMLS_NAME
+rm -rf ADMLS
+ln -s $ADMLS_NAME ADMLS
+
echo
echo "Now you can run all the instances deployed: ./run.sh"
+echo "You could provide optional target: 'run.sh <another ADMLS directory>'."
+echo
echo "To configure another layout you should execute this script again."
echo
-echo "Done!"
+_exit "Done!" 0