message(STATUS "Processing dynamic library at: dynamic/launcher/${rel}")
file(GLOB_RECURSE SRCS dynamic/launcher/${rel}/*.cpp)
add_library(launcher_procedure_${libpath}_shared SHARED ${SRCS})
- set(target_dirname build/${CMAKE_BUILD_TYPE}/lib/dynamic_launcher/${libpath})
+
+ set(target_dirname build/${CMAKE_BUILD_TYPE}/lib/dynamic/launcher/${rel})
+
set(target_basename launcher_procedure_${libpath}_shared)
set_target_properties(${target_basename} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${target_dirname})
#file(RENAME ${target_dirname}/lib${target_basename}.so ${target_dirname}/libprocedure.so)
# Install
+SET(MY_OWN_INSTALL_PREFIX "/opt/anna" CACHE PATH "Prefix prepended to install directories")
+SET(CMAKE_INSTALL_PREFIX "${MY_OWN_INSTALL_PREFIX}" CACHE INTERNAL "Prefix prepended to install directories" FORCE)
+
message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
# Binaries:
file(GLOB_RECURSE BINARIES ${CMAKE_CURRENT_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/bin/*)
install(PROGRAMS ${BINARIES} DESTINATION bin)
# Headers:
-install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/anna/ DESTINATION include)
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/anna DESTINATION include)
# Libraries:
file(GLOB_RECURSE LIBRARIES ${CMAKE_CURRENT_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/lib/*)
install(FILES ${LIBRARIES} DESTINATION lib)
To install headers, libraries, and examples, execute:
- > make install
+ > sudo make install
Optionally you could specify another prefix for installation:
- > cmake -DCMAKE_INSTALL_PREFIX=$HOME/anna_deploy .
+ > cmake -DCMAKE_INSTALL_PREFIX=$HOME/anna-deploy
+ > make install
## Uninstall
echo "Basic checkings ..."
# Get variant and main executables:
-[ -f $SCR_DIR/release/example_diameter_launcher ] && VARIANT=release
-[ -f $SCR_DIR/debug/example_diameter_launcher ] && VARIANT=debug
-[ -z "$VARIANT" ] && _exit "Cannot locate neither 'release' nor 'debug' variant !"
+[ -d $PROJECT_ROOT/build/Release ] && VARIANT=Release
+[ -d $PROJECT_ROOT/build/Debug ] && VARIANT=Debug
+[ -z "$VARIANT" ] && _exit "Cannot locate neither 'Release' nor 'Debug' variant !"
echo "Variant: $VARIANT"
-ADML_EXEC=$SCR_DIR/$VARIANT/example_diameter_launcher
-STACKMGMT_EXEC=$(readlink -f $SCR_DIR/../stackManagement/$VARIANT/example_diameter_stackManagement)
+BIN_DIR=$PROJECT_ROOT/build/$VARIANT/bin
+LIB_DIR=$PROJECT_ROOT/build/$VARIANT/lib
+
+# Main executables:
+ADML_EXEC=$BIN_DIR/diameter_launcher
+STACKMGMT_EXEC=$BIN_DIR/diameter_stackManagement
[ ! -d $SETUPS_DIR ] && _exit "Diameter stacks not found ($SETUPS_DIR)."
mkdir -p $DPATH/test-reports
# Dynamic libs:
-mkdir -p $DPATH/dynlibs
-DYNLIBS=( $(find $PROJECT_ROOT -name "*.so" | grep -w $VARIANT) )
+cp -r $LIB_DIR/dynamic/launcher $DPATH/dynlibs
+
+# Get stuff from leaf directories:
+cd $LIB_DIR/dynamic/launcher
+leafs=( $(find . -type d -links 2) )
+cd - >/dev/null
-for dynlib in ${DYNLIBS[@]}
+cd $PROJECT_ROOT/dynamic/launcher
+for dir in ${leafs[@]}
do
- dynlib_bn=$(basename $dynlib)
- if [ "$dynlib_bn" != "libanna_dynamicLauncherProcedure.so" ]
- then
- cp $dynlib $DPATH/dynlibs
- else
- ########## ADML Dynamic libs system ##########
- # Create structure from $PROJECT_ROOT/dynamic/launcher
- suffix_path=$(echo $dynlib | awk -F"$PROJECT_ROOT/dynamic/launcher/" '{ print $2 }')
- target=$(dirname $DPATH/dynlibs/$(dirname $suffix_path))
- mkdir -p $target
- cp $dynlib $target
-
- # Additional resources
- dynlib_dn=$(dirname $dynlib)
- dynlib_dn_dn=$(dirname $dynlib_dn)
- cp $dynlib_dn_dn/*.xml $target 2>/dev/null
- cp $dynlib_dn_dn/dynamic.suffix $target 2>/dev/null
- cp -r $dynlib_dn_dn/services $target 2>/dev/null
- fi
+ cp $dir/*.xml $DPATH/dynlibs/$dir 2>/dev/null
+ cp $dir/dynamic.suffix $DPATH/dynlibs/$dir 2>/dev/null
+ cp -r $dir/services $DPATH/dynlibs/$dir 2>/dev/null
done
+cd - >/dev/null
# ADML dynamic libs selection script:
cp $SCR_DIR/resources/scripts/select_dynlib.sh $DPATH/dynlibs/select.sh
# Default dynamic library:
cd $DPATH/dynlibs
-ln -s default/libanna_dynamicLauncherProcedure.so
+ln -s default/liblauncher_procedure_default_shared.so
cd - >/dev/null
# Basic setup:
ADML_INSTANCES=`cat .st_conf_adml_instances 2>/dev/null`
RESULT_CODE=0
+echo -n "Checking instances ... "
ADML_INSTANCES_ALIVE=$(pgrep ADML- | wc -l)
echo -n "$ADML_INSTANCES_ALIVE instances alive"
if [ $ADML_INSTANCES_ALIVE -ne $ADML_INSTANCES ]
echo
fi
+echo -n "Checking connections ... "
ADML_CONNECTIONS_ALIVE=$(netstat -a | grep :diameter | grep ESTABLISHED | wc -l)
ADML_TOTAL_CONNECTIONS=$((ADML_CONNECTIONS*ADML_INSTANCES))
echo -n "$ADML_CONNECTIONS_ALIVE connections established"
then
cycles=$((repeats+1))
echo "You will need $cycles cycles to cover $minutes minutes."
- echo "Input the desired number of cyles [$cycles]: "
+ echo "Input the desired number of cycles [$cycles]: "
echo " (providing 1, you will cover $time_covered seconds)"
echo
read wanted_cycles
echo
cd `dirname $0`
./checkStatus.sh
-[ $? -eq 1 ] && _exit "Fix status to continue ..."
+[ $? -eq 1 ] && _exit "Fix status (instances) to continue ..."
# We launch in background !
#./operation.sh --ping >/dev/null
echo "Programming has finished !"
echo
- echo "Configuring repeat cycles ..."
- ./operation.sh "test|repeats|$REPEATS"
-
if [ -n "$specific" ]
then
echo "A new file '$TESTCASE_DIR/specific.all' has been created."
# dynamic programming #################################################################
else
- TESTCASE_DIR=$(readlink -f dynlibs/libanna_dynamicLauncherProcedure.so | xargs dirname)
+ TESTCASE_DIR=$(readlink -f dynlibs/liblauncher_procedure_default_shared.so | xargs dirname)
DYNAMIC_SUFFIX_FILE=$TESTCASE_DIR/dynamic.suffix
[ ! -f $DYNAMIC_SUFFIX_FILE ] && _exit "Missing '$DYNAMIC_SUFFIX_FILE' file.\nUse 'dynlibs/select.sh' to change the dynamic procedure and restart the ADML instances."
echo
echo
+echo "Configuring repeat cycles ..."
+./operation.sh "test|repeats|$REPEATS" >/dev/null
+echo
+echo "Done !"
+echo
+
start_testing=
if [ "$AUTOSTART" = "-s" ]
then
do
cd `dirname $run`
instance_name=$(basename $PWD)
- pkill $instance_name
+ pkill -9 $instance_name
[ $? -eq 0 ] && echo -n "Re-"
echo "Starting $instance_name ..."
./run.sh > /dev/null &
./checkStatus.sh
cat << EOF
- $(pgrep ADML- | wc -l) instances alive !
- $(netstat -a | grep :diameter | grep ESTABLISHED | wc -l) connections established !
+
+
To stop the processes, you could execute: pgrep ADML-[0-9] | xargs kill
Anyway, executing './run.sh' again you will restart the ADML instances.
#!/bin/bash
-dynamicProcedureLibName=libanna_dynamicLauncherProcedure.so
+dynamicProcedureLibName=liblauncher_procedure_default_shared.so
echo
echo "------------------------------------------------"
echo "Dynamic library selection for launcher procedure"
echo
echo "Available options:"
tmpfile=$(mktemp)
- find . -name "$dynamicProcedureLibName" > $tmpfile
+ find . -name "liblauncher_procedure_*_shared.so" > $tmpfile
echo
for line in $(cat $tmpfile); do echo " $line" ; done
dflt=$(grep "^./default/" $tmpfile)
[ ! -f $option ] && { echo -e "\nInvalid file !\n" ; exit 1 ; }
option_bn=$(basename $option)
-[ "$option_bn" != "$dynamicProcedureLibName" ] && { echo -e "\nInvalid file (must be a dynamic procedure library) !\n" ; exit 1 ; }
ln -sf $option $dynamicProcedureLibName
+[ $? -ne 0 ] && { rm -f $dynamicProcedureLibName ; echo -e "\nInvalid file (must be a dynamic procedure library) !\n" ; exit 1 ; }
echo
echo "Library enabled"
echo