Fixes & improvements
[anna.git] / example / diameter / launcher / deployments / st-client / configure.sh
index 728440d..2563d3f 100755 (executable)
@@ -102,8 +102,8 @@ echo "====================================="
 echo "ADML SYSTEM TEST CONFIGURATION WIZARD"
 echo "====================================="
 echo
-[ -d ADMLS ] && _exit "ADMLS directory still exists. Please remove it to continue (perhaps you have to 'pkill ADML' before) !"
-[ ! -d realms ] && _exit "Missing realms configuration (expecting '$PWD/realms' directory) !"
+[ -d ADMLS ] && _exit "ADMLS directory still exists. Please remove it to continue (you may have to 'pkill ADML' before) !"
+[ ! -d services ] && _exit "Missing services configuration (expecting '$PWD/services' directory) !"
 
 calculate_deployment_layout
 
@@ -126,11 +126,16 @@ maximum_rate=$((G_ADML_INSTANCES*G_ADML_CONNECTIONS*MAXIMUM_ADML_ASYNC_RATE))
 echo " - Maximum rate: $maximum_rate test cases per second"
 echo " - Desired rate: $desired_rate test cases per second"
 echo
-echo "Usually, you will program a test case per subscriber. Input the number of test cases to program:"
+echo "Usually, you will program a test case per subscriber."
+echo "Input the number of test cases to program:"
 read N_TESTCASES
 while [ -z "$N_TESTCASES" ]; do read N_TESTCASES; done
 echo $N_TESTCASES > $N_TESTCASES__ST_CONF_FILE
 testcase_per_adml_instance=$N_TESTCASES
+echo "Input the first test id to program [1]:"
+read first_value
+[ "$first_value" = "" ] && first_value=1
+[ $first_value -lt 1 ] && first_value=1
 echo
 time_covered_1=$(ceil $N_TESTCASES $desired_rate)
 time_covered=$(ceil $N_TESTCASES $((desired_rate*G_ADML_INSTANCES)))
@@ -146,8 +151,8 @@ fi
 for instance in `seq 1 $G_ADML_INSTANCES`
 do
   offset=$((testcase_per_adml_instance * (instance-1)))
-  ini=$((offset + 1))
-  fin=$((offset + testcase_per_adml_instance))
+  ini=$((offset + first_value))
+  fin=$((offset + first_value + testcase_per_adml_instance - 1))
   echo "$instance $ini $fin" >> $N_TESTCASES_PROGRAM_LAYOUT__ST_CONF_FILE
 done
 
@@ -174,7 +179,7 @@ echo "Ready to clone/start the ADML instances: press ENTER to continue, CTRL+C t
 read dummy
 
 # Update services.xml regarding the number of client connections:
-cd realms
+cd services 
 cp services.msk services.xml
 sed -i 's/__CLIENT_CONNECTIONS__/'$G_ADML_CONNECTIONS'/g' services.xml
 cd - >/dev/null
@@ -185,13 +190,15 @@ do
   echo "Creating ADML instance $instance ..."
   mkdir -p ADMLS/ADML-$instance
   cd ADMLS/ADML-$instance
+  mkdir counters
+  mkdir test-reports
   # Create resources:
   ln -s ../../.operation-one.sh operation.sh
   ln -s ../../pre-start.sh
   cp ../../.run-one.sh run.sh
   sed -i 's/^EXE=.*/EXE=ADML-'$instance'/' run.sh
   ln -s ../../ADML-launcher ADML-$instance
-  for xml in `ls ../../realms/*xml`; do ln -s $xml; done
+  for xml in `ls ../../services/*xml`; do ln -s $xml; done
   cd - >/dev/null
 done