Fixes
authorEduardo Ramos Testillano <eduardo.ramos.testillano@ericsson.com>
Mon, 19 Jun 2017 03:05:49 +0000 (05:05 +0200)
committerEduardo Ramos Testillano <eduardo.ramos.testillano@ericsson.com>
Mon, 19 Jun 2017 03:05:49 +0000 (05:05 +0200)
st client: kill -9 to save time (ensure Re-start in time)
st client: program repeats common to dynamic and normal tests
deploy.sh: fix script with new build tree

CMakeLists.txt
README.md
example/diameter/launcher/deploy.sh
example/diameter/launcher/deployments/st-client/checkStatus.sh
example/diameter/launcher/deployments/st-client/configure.sh
example/diameter/launcher/deployments/st-client/program.sh
example/diameter/launcher/deployments/st-client/run_all.sh
example/diameter/launcher/resources/scripts/select_dynlib.sh

index 1cd503d..ef993e9 100644 (file)
@@ -132,7 +132,9 @@ FOREACH(procedure ${DYNAMIC_PROCEDURES})
   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)
@@ -216,12 +218,15 @@ ENDFOREACH()
 
 
 # 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)
index 0ed188a..66bdb99 100644 (file)
--- a/README.md
+++ b/README.md
@@ -118,11 +118,12 @@ Execute 'make test'
 
 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
 
index cb7c169..766273a 100755 (executable)
@@ -86,12 +86,16 @@ echo
 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)."
 
@@ -163,38 +167,28 @@ mkdir -p $DPATH/counters
 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:
index 7e7f861..ec658cb 100755 (executable)
@@ -4,6 +4,7 @@ ADML_CONNECTIONS=`cat .st_conf_adml_connections 2>/dev/null`
 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 ]
@@ -14,6 +15,7 @@ else
   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"
index 17bff02..56adfcc 100755 (executable)
@@ -203,7 +203,7 @@ if [ $repeats -gt 0 ]
 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
index 5d1fa45..4d878c0 100755 (executable)
@@ -110,7 +110,7 @@ echo "Testcases programming ..."
 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
@@ -170,9 +170,6 @@ then
   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."
@@ -184,7 +181,7 @@ then
 
 # 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."
@@ -265,6 +262,12 @@ fi
 
 echo
 echo
+echo "Configuring repeat cycles ..."
+./operation.sh "test|repeats|$REPEATS" >/dev/null
+echo
+echo "Done !"
+echo
+  
 start_testing=
 if [ "$AUTOSTART" = "-s" ]
 then
index 489855c..3b32e68 100755 (executable)
@@ -12,7 +12,7 @@ for run in `ls ADMLS/*/run.sh`
 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 &
@@ -25,8 +25,8 @@ sleep 3
 ./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.
index 3a2a952..2eabcf5 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-dynamicProcedureLibName=libanna_dynamicLauncherProcedure.so
+dynamicProcedureLibName=liblauncher_procedure_default_shared.so
 echo
 echo "------------------------------------------------"
 echo "Dynamic library selection for launcher procedure"
@@ -13,7 +13,7 @@ then
   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)
@@ -26,8 +26,8 @@ fi
 
 [ ! -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