Support for Multiple Peer deployments. Support for coexisting several ADMLS instances...
authorEduardo Ramos Testillano <eduardo.ramos.testillano@ericsson.com>
Fri, 29 Sep 2017 16:55:13 +0000 (18:55 +0200)
committerEduardo Ramos Testillano <eduardo.ramos.testillano@ericsson.com>
Fri, 29 Sep 2017 16:55:13 +0000 (18:55 +0200)
dynamic/launcher/gx/00001/services/cerGx.msk [new file with mode: 0644]
dynamic/launcher/gx/00001/services/cerGx.xml [deleted file]
example/diameter/launcher/deployments/st-client/README
example/diameter/launcher/deployments/st-client/configure.sh
example/diameter/launcher/deployments/st-client/run_all.sh
example/diameter/launcher/deployments/st-client/services_example/cerGx.msk [new file with mode: 0644]
example/diameter/launcher/deployments/st-client/services_example/cerGx.xml [deleted file]
example/diameter/launcher/deployments/st-client/services_example/cerRx.msk [new file with mode: 0644]
example/diameter/launcher/deployments/st-client/services_example/cerRx.xml [deleted file]
example/diameter/launcher/deployments/st-client/services_example/services.msk

diff --git a/dynamic/launcher/gx/00001/services/cerGx.msk b/dynamic/launcher/gx/00001/services/cerGx.msk
new file mode 100644 (file)
index 0000000..2206ab1
--- /dev/null
@@ -0,0 +1,18 @@
+<message version="1" name="CER" application-id="0" hop-by-hop-id="1" end-to-end-id="120858368">
+   <avp name="Origin-Host" data="ggsnNodeHostname__PEER_SEQ__.nodeHostRealm.com"/>
+   <avp name="Origin-Realm" data="nodeHostRealm.com"/>
+<!--
+   <avp name="Origin-Host" data="esmdx0900__PEER_SEQ__.gxrel10plusrealm.com"/>
+   <avp name="Origin-Realm" data="gxrel10plusrealm.com"/>
+-->
+   <avp name="Host-IP-Address" data="1|10.1.27.231"/>
+   <avp name="Vendor-Id" data="0"/>
+   <avp name="Product-Name" data="SAPC"/>
+   <avp name="Supported-Vendor-Id" data="10415"/>
+   <avp name="Supported-Vendor-Id" data="193"/>
+   <avp name="Firmware-Revision" data="1"/>
+   <avp name="Vendor-Specific-Application-Id">
+      <avp name="Vendor-Id" data="10415"/>
+      <avp name="Auth-Application-Id" data="16777238"/>
+   </avp>
+</message>
diff --git a/dynamic/launcher/gx/00001/services/cerGx.xml b/dynamic/launcher/gx/00001/services/cerGx.xml
deleted file mode 100644 (file)
index 308154a..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<message version="1" name="CER" application-id="0" hop-by-hop-id="1" end-to-end-id="120858368">
-   <avp name="Origin-Host" data="ggsnNodeHostname.nodeHostRealm.com"/>
-   <avp name="Origin-Realm" data="nodeHostRealm.com"/>
-<!--
-   <avp name="Origin-Host" data="esmdx0900.gxrel10plusrealm.com"/>
-   <avp name="Origin-Realm" data="gxrel10plusrealm.com"/>
--->
-   <avp name="Host-IP-Address" data="1|10.1.27.231"/>
-   <avp name="Vendor-Id" data="0"/>
-   <avp name="Product-Name" data="SAPC"/>
-   <avp name="Supported-Vendor-Id" data="10415"/>
-   <avp name="Supported-Vendor-Id" data="193"/>
-   <avp name="Firmware-Revision" data="1"/>
-   <avp name="Vendor-Specific-Application-Id">
-      <avp name="Vendor-Id" data="10415"/>
-      <avp name="Auth-Application-Id" data="16777238"/>
-   </avp>
-</message>
index d6f4f5b..fd3860a 100644 (file)
@@ -13,7 +13,9 @@ not, dynamic programming will fail because the appropiate service is
 not configured before starting ADML instances.
 
 Execute './configure.sh' and follow the intructions to clone the ADML
 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
 --------------------
 
 STARTING THE PROCESS
 --------------------
@@ -24,6 +26,8 @@ the operation provided through every cloned instance. For example, if
 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 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
 -----------------
 
 TESTING PROCEDURE
 -----------------
@@ -37,6 +41,9 @@ desired rate selected on configuration stage.
 Don't forget to populate whatever data you need on the tested system,
 because this work is not done here.
 
 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.
 OPERATION
 ---------
 Management interface for lite version is based on SIGUSR2 signal caugh.
@@ -44,3 +51,6 @@ Use './operation.sh' script within a specific instance directory to send
 any operation to the process. Ask for help with that script to see all
 the operations supported.
 
 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.
+
index 4b231ee..ac5432f 100755 (executable)
@@ -3,6 +3,7 @@
 #############
 # VARIABLES #
 #############
 #############
 # 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
 MAXIMUM_ADML_ASYNC_RATE=50
 MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE=10
 ADML_INSTANCES__ST_CONF_FILE=.st_conf_adml_instances
@@ -18,7 +19,20 @@ N_TESTCASES_PROGRAM_LAYOUT__ST_CONF_FILE=.st_conf_n_testcases_program_layout
 #############
 _exit () {
   echo -e "\n$1\n"
 #############
 _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
 }
 
 # ceil of division $1/$2
@@ -95,40 +109,15 @@ calculate_deployment_layout() {
 # EXECUTION #
 #############
 
 # EXECUTION #
 #############
 
-cd `dirname $0`
+trap sig_handler INT QUIT TERM
+
+cd $CWD
 
 echo
 echo "====================================="
 echo "ADML SYSTEM TEST CONFIGURATION WIZARD"
 echo "====================================="
 echo
 
 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."
 
 
 [ ! -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."
 
@@ -196,7 +185,7 @@ read minutes
 while [ -z "$minutes" ]; do read minutes; done
 seconds=$((minutes*60))
 repeats=0
 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))
 if [ $repeats -gt 0 ]
 then
   cycles=$((repeats+1))
@@ -212,6 +201,15 @@ then
 else
   echo 0 > $CYCLE_REPEATS__ST_CONF_FILE
 fi
 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
 echo
 echo "System test configuration completed."
 echo
@@ -220,9 +218,11 @@ read dummy
 
 # Update services.xml regarding the number of client connections:
 cd services 
 
 # 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
 
 # Create instances and layout:
 0>$N_TESTCASES_PROGRAM_LAYOUT__ST_CONF_FILE
@@ -234,9 +234,18 @@ do
   fin=$((offset + first_value + testcase_per_adml_instance - 1))
   echo "$instance $ini $fin" >> $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 ..."
   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
   mkdir counters
   mkdir test-reports
   ln -s ../../dynlibs
@@ -246,13 +255,61 @@ do
   cp ../../.run-one.sh run.sh
   sed -i 's/^EXE=.*/EXE=ADML-'$instance'/' run.sh
   ln -s ../../ADML ADML-$instance
   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 - >/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
 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 "To configure another layout you should execute this script again."
 echo
-echo "Done!"
+_exit "Done!" 0
 
 
index 8287beb..58a68bf 100755 (executable)
@@ -1,18 +1,18 @@
 #!/bin/bash
 #!/bin/bash
-
-# Core generation:
-ulimit -c unlimited
+target=$1
+[ -z "$target" ] && target=ADMLS
 
 cd `dirname $0`
 
 cd `dirname $0`
-if [ ! -d "ADMLS" ]
+if [ ! -d $target ]
 then
   echo
 then
   echo
-  echo "Run './configure.sh' first !"
+  echo "Directory '$target' missing. Run './configure.sh' first !"
+  echo "(remember that you could provide another target as argument)"
   echo
   exit 1
 fi
 
   echo
   exit 1
 fi
 
-for run in `ls ADMLS/*/run.sh`
+for run in `ls $target/*/run.sh`
 do
   cd `dirname $run`
   instance_name=$(basename $PWD)
 do
   cd `dirname $run`
   instance_name=$(basename $PWD)
diff --git a/example/diameter/launcher/deployments/st-client/services_example/cerGx.msk b/example/diameter/launcher/deployments/st-client/services_example/cerGx.msk
new file mode 100644 (file)
index 0000000..67ad15e
--- /dev/null
@@ -0,0 +1,10 @@
+<message version="1" name="CER" application-id="0" hop-by-hop-id="722470" end-to-end-id="539510">
+   <avp name="Origin-Host" data="ggsnNodeHostname__PEER_SEQ__.nodeHostRealm.com"/>
+   <avp name="Origin-Realm" data="nodeHostRealm.com"/>
+   <avp name="Auth-Application-Id" data="16777238"/>
+   <avp name="Origin-State-Id" data="1"/>
+   <avp name="Host-IP-Address" data="1|192.168.14.42"/>
+   <avp name="Vendor-Id" data="193"/>
+   <avp name="Product-Name" data="ggsnNode"/>
+   <avp name="Firmware-Revision" data="1"/>
+</message>
diff --git a/example/diameter/launcher/deployments/st-client/services_example/cerGx.xml b/example/diameter/launcher/deployments/st-client/services_example/cerGx.xml
deleted file mode 100644 (file)
index 0132179..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<message version="1" name="CER" application-id="0" hop-by-hop-id="722470" end-to-end-id="539510">
-   <avp name="Origin-Host" data="ggsnNodeHostname.nodeHostRealm.com"/>
-   <avp name="Origin-Realm" data="nodeHostRealm.com"/>
-   <avp name="Auth-Application-Id" data="16777238"/>
-   <avp name="Origin-State-Id" data="1"/>
-   <avp name="Host-IP-Address" data="1|192.168.14.42"/>
-   <avp name="Vendor-Id" data="193"/>
-   <avp name="Product-Name" data="ggsnNode"/>
-   <avp name="Firmware-Revision" data="1"/>
-</message>
diff --git a/example/diameter/launcher/deployments/st-client/services_example/cerRx.msk b/example/diameter/launcher/deployments/st-client/services_example/cerRx.msk
new file mode 100644 (file)
index 0000000..0c270c0
--- /dev/null
@@ -0,0 +1,10 @@
+<message version="1" name="CER" application-id="0" hop-by-hop-id="956775" end-to-end-id="968247">
+   <avp name="Origin-Host" data="afNodeHostname__PEER_SEQ__.nodeHostRealm.com"/>
+   <avp name="Origin-Realm" data="nodeHostRealm.com"/>
+   <avp name="Auth-Application-Id" data="16777236"/>
+   <avp name="Origin-State-Id" data="1"/>
+   <avp name="Host-IP-Address" data="1|192.168.14.42"/>
+   <avp name="Vendor-Id" data="193"/>
+   <avp name="Product-Name" data="afNode"/>
+   <avp name="Firmware-Revision" data="1"/>
+</message>
diff --git a/example/diameter/launcher/deployments/st-client/services_example/cerRx.xml b/example/diameter/launcher/deployments/st-client/services_example/cerRx.xml
deleted file mode 100644 (file)
index bb1e0df..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<message version="1" name="CER" application-id="0" hop-by-hop-id="956775" end-to-end-id="968247">
-   <avp name="Origin-Host" data="afNodeHostname.nodeHostRealm.com"/>
-   <avp name="Origin-Realm" data="nodeHostRealm.com"/>
-   <avp name="Auth-Application-Id" data="16777236"/>
-   <avp name="Origin-State-Id" data="1"/>
-   <avp name="Host-IP-Address" data="1|192.168.14.42"/>
-   <avp name="Vendor-Id" data="193"/>
-   <avp name="Product-Name" data="afNode"/>
-   <avp name="Firmware-Revision" data="1"/>
-</message>
index 56ae019..cc98824 100644 (file)
@@ -5,7 +5,7 @@
   <stack id="0" dictionary="dictionaryBase.xml"/>
 
   <!-- Nodes -->
   <stack id="0" dictionary="dictionaryBase.xml"/>
 
   <!-- Nodes -->
-  <node originHost="afNodeHostname.nodeHostRealm.com" applicationId="16777236" entity="localhost:3868" cer="cerRx.xml" entityServerSessions="__CLIENT_CONNECTIONS__"/>
-  <node originHost="ggsnNodeHostname.nodeHostRealm.com" applicationId="16777238" entity="localhost:3869" cer="cerGx.xml" entityServerSessions="__CLIENT_CONNECTIONS__"/>
+  <node originHost="afNodeHostname__PEER_SEQ__.nodeHostRealm.com" applicationId="16777236" entity="localhost:3868" cer="cerRx.xml" entityServerSessions="__CLIENT_CONNECTIONS__"/>
+  <node originHost="ggsnNodeHostname__PEER_SEQ__.nodeHostRealm.com" applicationId="16777238" entity="localhost:3869" cer="cerGx.xml" entityServerSessions="__CLIENT_CONNECTIONS__"/>
 </services>
 
 </services>