#!/bin/bash
+# Result code: 1 (miss instances (and connections)), 2 (miss connections)
ADML_CONNECTIONS=`cat .st_conf_adml_connections 2>/dev/null`
ADML_INSTANCES=`cat .st_conf_adml_instances 2>/dev/null`
RESULT_CODE=0
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"
-if [ $ADML_CONNECTIONS_ALIVE -ne $ADML_TOTAL_CONNECTIONS ] && RESULT_CODE=1
+if [ $ADML_CONNECTIONS_ALIVE -ne $ADML_TOTAL_CONNECTIONS ]
then
echo " ! (expected $ADML_TOTAL_CONNECTIONS configured)"
- RESULT_CODE=1
+ [ $RESULT_CODE -ne 1 ] && RESULT_CODE=
else
echo
fi
do
instances=$(ceil $max_connections $conn)
echo -n -e "\t$instances"
- [ $conn -eq 2 ] && instances__dflt=$instances
+ [ $conn -eq 1 ] && instances__dflt=$instances
done
echo
echo -e "Connects per instance:\t10\t9\t8\t7\t6\t5\t4\t3\t2\t1"
then
rate_per_instance=$((desired_rate/$ADML_INSTANCES))
fi
-echo "This configures $rate_per_instance test cases per second and instance"
-echo " (there are $ADML_INSTANCES instances available)".
+CMD="./operation.sh \"test|ttps|$rate_per_instance\""
+
+echo
+echo "As we have $ADML_INSTANCES instances available, we shall launch $rate_per_instance test cases"
+echo " per second and instance ($CMD)."
echo
echo "Press ENTER to continue, CTRL-C to abort ..."
read dummy
-
-./operation.sh "test|ttps|$rate_per_instance"
+$CMD
DESIRED_RATE=`cat .st_conf_desired_rate 2>/dev/null`
REPEATS=`cat .st_conf_cycle_repeats 2>/dev/null`
PROGRAM_LAYOUT_FILE=.st_conf_n_testcases_program_layout
-[ -z "$ADML_CONCURRENT_PROVISION_JOBS" ] && ADML_CONCURRENT_PROVISION_JOBS=10
+[ -z "$ADML_CONCURRENT_PROVISION_JOBS" ] && ADML_CONCURRENT_PROVISION_JOBS=20
#############
# FUNCTIONS #
echo "Idle cpu now: $idle. Check the system CPU with top. If is not overcommited, consider"
echo " increase the environment variable 'ADML_CONCURRENT_PROVISION_JOBS' (now $ADML_CONCURRENT_PROVISION_JOBS)."
echo
+ echo "Press ENTER to continue ..."
+ read dummy
}
#############
echo
cd `dirname $0`
./checkStatus.sh
-[ $? -ne 0 ] && _exit "Fix status to continue ..."
+[ $? -eq 1 ] && _exit "Fix status to continue ..."
# We launch in background !
#./operation.sh --ping >/dev/null