# Stack management
STACKMGMT_EXEC_installed=/opt/bin/anna/example_diameter_stackManagement
STACKMGMT_EXECS=( $STACKMGMT_EXEC_installed ../stackManagement/release/example_diameter_stackManagement ../stackManagement/debug/example_diameter_stackManagement )
-:1
#############
# FUNCTIONS #
fi
[ -d $DPATH ] && _exit "The installation path '$DPATH' must not exists."
-EXE=ADML-`basename $DPATH`
+EXE=`basename $DPATH`
echo "Copying to '$DPATH' ..."
mkdir -p $DPATH
case $type in
1)
- $DEPLOY_SCR b $DIR/client
- $DEPLOY_SCR b $DIR/server
+ $DEPLOY_SCR b $DIR/ADML-client
+ $DEPLOY_SCR b $DIR/ADML-server
echo "Configuring ..."
- cd $DIR/client
+ cd $DIR/ADML-client
echo c | ./configure.sh >/dev/null
cd - >/dev/null
- cd $DIR/server
+ cd $DIR/ADML-server
echo s | ./configure.sh >/dev/null
cd - >/dev/null
;;
2)
- $DEPLOY_SCR f $DIR/ft-client
- $DEPLOY_SCR b $DIR/server
+ $DEPLOY_SCR f $DIR/ADML-ft-client
+ $DEPLOY_SCR b $DIR/ADML-server
echo "Configuring ..."
- cd $DIR/server
+ cd $DIR/ADML-server
echo s | ./configure.sh >/dev/null
cd - >/dev/null
;;
3)
- $DEPLOY_SCR s $DIR/st-client
- $DEPLOY_SCR b $DIR/serverGx
- $DEPLOY_SCR b $DIR/serverRx
+ $DEPLOY_SCR s $DIR/ADML-st-client
+ $DEPLOY_SCR b $DIR/ADML-serverGx
+ $DEPLOY_SCR b $DIR/ADML-serverRx
echo "Configuring ..."
- cd $DIR/st-client
+ cd $DIR/ADML-st-client
+ ln -s realms_example realms
mv run.sh .run-one.sh
mv run_all.sh run.sh
mv operation.sh .operation-one.sh
mv operation_all.sh operation.sh
rm dictionary.xml
cd - >/dev/null
- cd $DIR/serverGx
+ cd $DIR/ADML-serverGx
echo s | ./configure.sh >/dev/null
sed -i 's/3868/3869/' services.xml
ln -sf stacks/other_examples/16777238.xml dictionary.xml
cd - >/dev/null
- cd $DIR/serverRx
+ cd $DIR/ADML-serverRx
echo s | ./configure.sh >/dev/null
ln -sf stacks/other_examples/16777236.xml dictionary.xml
cd - >/dev/null
result += "\n Test cases reports are not dumped on process context (too many information in general).";
result += "\n The report contains context information in every moment: this operation acts as a snapshot.";
result += "\n";
- result += "\n test|report[|[yes]|no] Every time a test case is finished, its xml representation will be dump on a file under";
+ result += "\n test|report|<Failed/Success>[|[yes]|no]";
+ result += "\n";
+ result += "\n Every time a test case is finished, its xml representation will be dump on a file under";
result += "\n the execution directory (or the one configured in process command-line 'tmDir') with";
- result += "\n the name 'cycle-<cycle id>.testcase-<test case id>.xml'. This option is disabled by";
- result += "\n default reducing IO. ADML process context won't show test manager whole information";
- result += "\n because it could be a huge amount of data to write. Anyway, you could use the 'look'";
- result += "\n operation to see the desired report(s).";
+ result += "\n the name 'cycle-<cycle id>.testcase-<test case id>.xml'. The third parameter represents";
+ result += "\n the test result condition to dump the information. By default, neither failed nor successful";
+ result += "\n test cases are written to avoid IO overload (in most of cases not all the tests are going to";
+ result += "\n fail and you could enable only such dumps, but you can enable both types if you want).";
+ result += "\n Better, you can use the 'look' operation to see the desired report(s) and its result state,";
+ result += "\n in case that you miss the xml files or you disabled all the dumps during testing.";
result += "\n";
result += "\n test|report-hex[|[yes]|no] Reports could include the diameter messages in hexadecimal format. Disabled by default.";
result += "\n";
result += "\n";
result += "\n test|summary Test manager general report (number of test cases, counts by state, global configuration,";
result += "\n forced in-progress limitation, reports visibility, etc.). Be careful when you have reports";
- result += "\n dumps enabled because all the programmed test cases will be dump and that could be heavy.";
+ result += "\n enabled because the programmed test cases dumps could be heavy (try to disable both failed";
+ result += "\n and successful dumps).";
result += "\n";
result += "\n";
result += "\nUSING OPERATIONS INTERFACE";
}
} else if((opType == "test")) {
- // test|<id>|<command>[|parameters] Add a new step to the test case ...
- // test|ttps|<amount> Starts/resume the provided number of time ticks per second (ttps). The ADML starts ...
- // test|next[|<sync-amount>] Forces the execution of the next test case(s) without waiting for test manager tick ...
- // test|ip-limit[|amount] In-progress limit of test cases. No new test cases will be launched over this value ...
- // test|repeats|<amount> Restarts the whole programmed test list when finished the amount number of times ...
- // test|report[|[yes]|no] Every time a test case is finished a report file in xml format will be created under ...
- // test|report-hex[|[yes]|no] Reports could include the diameter messages in hexadecimal format. Disabled by default.
- // test|goto|<id> Updates current test pointer position.
- // test|look[|id] Show programmed test case for id provided, current when missing ...
- // test|interact|amount|id Makes interactive a specific test case id. The amount is the margin of execution steps ...
- // test|reset|<soft/hard>[|id] Reset the test case for id provided, all the tests when missing ...
- // test|clear Clears all the programmed test cases.
- // test|summary Test manager general report (number of test cases, counts by state ...
+ // test|<id>|<command>[|parameters] Add a new step to the test case ...
+ // test|ttps|<amount> Starts/resume the provided number of time ticks per second (ttps). The ADML starts ...
+ // test|next[|<sync-amount>] Forces the execution of the next test case(s) without waiting for test manager tick ...
+ // test|ip-limit[|amount] In-progress limit of test cases. No new test cases will be launched over this value ...
+ // test|repeats|<amount> Restarts the whole programmed test list when finished the amount number of times ...
+ // test|report|<Failed/Success>[|[yes]|no] Every time a test case is finished a report file in xml format will be created under ...
+ // test|report-hex[|[yes]|no] Reports could include the diameter messages in hexadecimal format. Disabled by default.
+ // test|goto|<id> Updates current test pointer position.
+ // test|look[|id] Show programmed test case for id provided, current when missing ...
+ // test|interact|amount|id Makes interactive a specific test case id. The amount is the margin of execution steps ...
+ // test|reset|<soft/hard>[|id] Reset the test case for id provided, all the tests when missing ...
+ // test|clear Clears all the programmed test cases.
+ // test|summary Test manager general report (number of test cases, counts by state ...
if(param1 == "ttps") {
opt_response_content += anna::functions::asString("Pool repeats: %d%s (current cycle: %d)", repeats, nolimit.c_str(), testManager.getPoolCycle());
}
else if(param1 == "report") {
- if (numParams > 2)
+ if (numParams > 3)
throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
- if(param2 == "") param2 = "yes";
- testManager.setDumpReports((param2 == "yes"));
- opt_response_content += (testManager.getDumpReports() ? "report enabled" : "report disabled");
+ if(param2 != "Failed" && param2 != "Success")
+ throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+ if(param3 == "") param3 = "yes";
+ bool enable = (param3 == "yes");
+
+ if(param2 == "Success")
+ testManager.setDumpSuccessfulReports(enable);
+ else
+ testManager.setDumpFailedReports(enable);
+
+ opt_response_content += (enable ? "report enabled " : "report disabled ");
+ opt_response_content += "for ";
+ opt_response_content += param2;
+ opt_response_content += " tests";
}
else if(param1 == "report-hex") {
if (numParams > 2)
fi
# Run script:
-EXE_LINK=ADML-`basename $PWD`
+EXE_LINK=`basename $PWD`
ln -sf $EXE_BN $EXE_LINK
case $tol in
TESTING PROCEDURE
-----------------
-Firstly you shall program the test cases. For example:
+Firstly you shall program the test cases by mean script './program.sh'. For example:
./program.sh st_examples/DynamicQualification
Using option '-s', the testing will start after programming, with the desired rate
read max_server_accepted_connections
[ "$max_server_accepted_connections" = "" ] && max_server_accepted_connections=5000
- echo "Input the maximum test case rate per second:"
+ echo "Input the maximum desired test case rate per second:"
read desired_rate
while [ -z "$desired_rate" ]; do read desired_rate; done
G_ADML_CONNECTIONS=1
G_ADML_INSTANCES=1
return
- fi
- max_adml_instances=$((max_server_accepted_connections/MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE))
- if [ $max_connections -gt $max_server_accepted_connections ]
+ elif [ $max_connections -gt $max_server_accepted_connections ]
then
- echo
- echo "Maximum rate reached for $max_server_accepted_connections server connections:"
- G_ADML_CONNECTIONS=$MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE
- G_ADML_INSTANCES=$max_adml_instances
- return
+ _exit "Not enough server connections to fit the desired rate (requires $max_connections connections)."
fi
echo
echo "==========================================================================================================="
echo "Orientative table"
echo "-----------------------------------------------------------------------------------------------------------"
- echo -e "Connects per instance:\t1\t2\t3\t4\t5\t6\t7\t8\t9\t10"
echo -n "Number of instances: "
- for conn in `seq 1 $MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE`
+ for conn in `seq 1 $MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE | tac`
do
instances=$(ceil $max_connections $conn)
echo -n -e "\t$instances"
done
echo
+ echo -e "Connects per instance:\t10\t9\t8\t7\t6\t5\t4\t3\t2\t1"
echo "==========================================================================================================="
echo
- echo "Input selection (connections per instance 1..$MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE) [1]:"
- read G_ADML_CONNECTIONS
- [ -z "$G_ADML_CONNECTIONS" ] && G_ADML_CONNECTIONS=1
- [ $G_ADML_CONNECTIONS -lt 1 ] && G_ADML_CONNECTIONS=1
-# if [ $G_ADML_CONNECTIONS -gt 1 ]
-# then
-# echo "Remember to add 'diameterServerSessions="$G_ADML_CONNECTIONS"' on servers services.xml file (node tag)"
-# echo " in case that you are testing against ADML servers."
-# echo
-# echo "Press ENTER to continue, CTRL-C to abort ..."
-# read dummy
-# fi
+ #echo "Input selection (connections per instance 1..$MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE) [1]:"
+ instances__dflt=$(ceil $max_connections $MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE)
+ echo "Input the desired number of ADML instances [$instances__dflt]:"
+ read G_ADML_INSTANCES
+ [ -z "$G_ADML_INSTANCES" ] && G_ADML_INSTANCES=$instances__dflt
+ [ $G_ADML_INSTANCES -lt 1 ] && G_ADML_INSTANCES=1
+ G_ADML_CONNECTIONS=$(ceil $max_connections $G_ADML_INSTANCES)
if [ $G_ADML_CONNECTIONS -gt $MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE ]
then
- G_ADML_CONNECTIONS=$MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE
+ echo "Warning: the number of connections per ADML instance ($G_ADML_CONNECTIONS) is greater"
+ echo " than the maximum suggested: $MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE"
+ echo
+ echo "Press ENTER to continue, CTRL-C to abort ..."
+ read dummy
+ fi
+ client_connections=$((G_ADML_INSTANCES*G_ADML_CONNECTIONS))
+ if [ $client_connections -gt $max_server_accepted_connections ]
+ then
+ echo
+ echo "Insufficient server connections available ($max_server_accepted_connections) to accept"
+ echo " launcher client connections: $G_ADML_INSTANCES x $G_ADML_CONNECTIONS = $client_connections."
+ _exit "Configuration error"
fi
-
- G_ADML_INSTANCES=$(ceil $max_connections $G_ADML_CONNECTIONS)
}
#############
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). Try with 'realms-example' and see README inside it !"
+[ ! -d realms ] && _exit "Missing realms configuration (expecting '$PWD/realms' directory) !"
calculate_deployment_layout
echo " - $G_ADML_CONNECTIONS client connections per ADML instance"
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:"
read N_TESTCASES
echo $N_TESTCASES > $N_TESTCASES__ST_CONF_FILE
testcase_per_adml_instance=$N_TESTCASES
echo
-time_covered_1=$(ceil $N_TESTCASES $maximum_rate)
-time_covered=$(ceil $N_TESTCASES $((maximum_rate*G_ADML_INSTANCES)))
+time_covered_1=$(ceil $N_TESTCASES $desired_rate)
+time_covered=$(ceil $N_TESTCASES $((desired_rate*G_ADML_INSTANCES)))
echo "That amount covers $time_covered_1 seconds for one running ADML instance."
if [ $G_ADML_INSTANCES -gt 1 ]
then
for instance in `seq 1 $G_ADML_INSTANCES`
do
- echo "Creating ADMLS/$instance ..."
- mkdir -p ADMLS/$instance
- cd ADMLS/$instance
+ echo "Creating ADML instance $instance ..."
+ mkdir -p ADMLS/ADML-$instance
+ cd ADMLS/ADML-$instance
# Create resources:
ln -s ../../.operation-one.sh operation.sh
ln -s ../../pre-start.sh
echo " $0 st_examples/DynamicQualification"
echo
echo " -s: start testing just after programming, using desired rate: $DESIRED_RATE test cases per second."
- [ $ADML_INSTANCES -gt 1 ] && echo " In your case, with $ADML_INSTANCES, a rate of $RATE_PER_INSTANCE ttps will be send per instance"
+ [ $ADML_INSTANCES -gt 1 ] && echo " In your case, with $ADML_INSTANCES, a rate of $RATE_PER_INSTANCE ttps will be send per instance."
echo
_exit
}
TESTCASE_FILES=${#TESTCASE[@]}
[ $TESTCASE_FILES -ne 1 ] && _exit "One and only one 'testcase*msk' file must be present !!"
+#CLONE_GROUPS=1
+MAX_NUMBER_GROUPS=$(grep ^MAX_NUMBER_GROUPS= clone.sh | cut -d= -f2)
+ADML_INSTANCES=`cat .st_conf_adml_instances`
+CLONE_GROUPS=$((MAX_NUMBER_GROUPS/ADML_INSTANCES))
+
children_before=$(children)
while read -r line
do
instance=$(echo $line | awk '{ print $1 }')
ini_seq=$(echo $line | awk '{ print $2 }')
fin_seq=$(echo $line | awk '{ print $3 }')
- ADML_DIR=`readlink -f ADMLS/$instance`
- ./clone.sh $ADML_DIR $TESTCASE $ini_seq $fin_seq 1 &
+ ADML_DIR=`readlink -f ADMLS/ADML-$instance`
+ ./clone.sh $ADML_DIR $TESTCASE $ini_seq $fin_seq $CLONE_GROUPS &
done < $PROGRAM_LAYOUT_FILE
sleep 1
done
+echo
+echo "Programming has finished !"
+echo
+
echo "Configuring repeat cycles ..."
./operation.sh "test|repeats|$REPEATS"
commandLine.add("services", anna::CommandLine::Argument::Mandatory, "Services xml path file. Shall be validated against dtd schema written on warning traces: 'Services DTD schema'. Empty string or \"null\" name, to start without services (see help for management operation 'services').");
commandLine.add("trace", anna::CommandLine::Argument::Optional, "Trace level (emergency, alert, critical, error, warning, notice, information, debug, local0..local7)");
commandLine.add("cntDir", anna::CommandLine::Argument::Optional, "Counters directory. By default is the current execution directory. Warning: a counter file will be dump per record period; take care about the possible accumulation of files");
- commandLine.add("tmDir", anna::CommandLine::Argument::Optional, "Test manager directory. By default is the current execution directory. Warning: report files could be dump during system testing (see help for management operation 'test|report'); take care about the possible accumulation of files");
+ commandLine.add("tmDir", anna::CommandLine::Argument::Optional, "Test manager directory. By default is the current execution directory. Warning: report files could be dump during system testing (see help for management operation 'test|report|result'); take care about the possible accumulation of files");
commandLine.add("cntRecordPeriod", anna::CommandLine::Argument::Optional, "Counters record procedure period in milliseconds. If missing, default value of 300000 (5 minutes) will be assigned. Value of 0 disables the record procedure.");
commandLine.add("logStatisticSamples", anna::CommandLine::Argument::Optional, "Log statistics samples for the provided concept id list, over './sample.<concept id>.csv' files. For example: \"1,2\" will log concepts 1 and 2. Reserved word \"all\" activates all registered statistics concept identifiers. That ids are shown at context dump (see help to get it).");
commandLine.add("disableLogs", anna::CommandLine::Argument::Optional, "Overrides every realm configuration regarding traffic log in order to disable it and ease production or system test startup.", false);
rm $wkdir/testcase.txt.$sequence
# Population:
- if [ -n "$POPULATION_FILE" ]
+ if [ -n "$POPULATION" ]
then
parse_file $sequence $POPULATION_FILE $CLONE_WKDIR/${POPULATION}.$sequence
cat $CLONE_WKDIR/${POPULATION}.$sequence >> $POPULATION_ALL
GROUPS_SIZE=$((N_ITEMS/N_GROUPS))
if [ "$GROUPS_SIZE" -eq 0 ]
then
- echo "Assuming minimum allowed number of groups: $N_ITEMS"
+ echo "Assuming minimum allowed number of groups (one group per item): $N_ITEMS"
GROUPS_SIZE=1
N_GROUPS=$N_ITEMS
fi
if (isFinished()) {
- if (!testManager.getDumpReports()) return;
+ if ((getState() == State::Failed) && (!testManager.getDumpFailedReports())) return;
+ if ((getState() == State::Success) && (!testManager.getDumpSuccessfulReports())) return;
// report file name: cycle-<cycle id>.testcase-<test case id>.xml
// FORMAT: We tabulate the cycle and test case in order to ease ordering of files by mean ls:
anna::timex::TimeEventObserver("TestManager") {
a_timeController = NULL;
a_reportsDirectory = "./";
- a_dumpReports = false;
+ a_dumpSuccessfulReports = false;
+ a_dumpFailedReports = false;
a_dumpHexMessages = false;
a_synchronousAmount = 1;
a_poolRepeats = 0; // repeat disabled by default
result->createAttribute("InProgressLimit", "<no limit>");
else
result->createAttribute("InProgressLimit", a_inProgressLimit);
- result->createAttribute("DumpReports", (a_dumpReports ? "yes":"no"));
+ result->createAttribute("DumpSuccessfulReports", (a_dumpSuccessfulReports ? "yes":"no"));
+ result->createAttribute("DumpFailedReports", (a_dumpFailedReports ? "yes":"no"));
result->createAttribute("DumpHexMessages", (a_dumpHexMessages ? "yes":"no"));
result->createAttribute("ReportsDirectory", a_reportsDirectory);
if (a_clock) {
if (a_currentTestIt != a_testPool.end()) {
result->createAttribute("CurrentTestCaseId", (*a_currentTestIt).first);
}
- if (a_dumpReports && poolSize != 0) {
+ if (poolSize != 0) {
anna::xml::Node* testCases = result->createChild("TestCases");
for (test_pool_it it = a_testPool.begin(); it != a_testPool.end(); it++) {
+ if (((*it).second->getState() == TestCase::State::Success) && (!getDumpSuccessfulReports())) continue;
+ if (((*it).second->getState() == TestCase::State::Failed) && (!getDumpFailedReports())) continue;
(*it).second->asXML(testCases);
}
}
// reports
std::string a_reportsDirectory;
- bool a_dumpReports;
+ bool a_dumpSuccessfulReports, a_dumpFailedReports;
bool a_dumpHexMessages;
// Pool of test cases
void setDumpHex(bool dh) throw() { a_dumpHexMessages = dh; }
bool getDumpHex() const throw() { return a_dumpHexMessages; }
- void setDumpReports(bool dr) throw() { a_dumpReports = dr; }
- bool getDumpReports() const throw() { return a_dumpReports; }
+ void setDumpSuccessfulReports(bool dsr) throw() { a_dumpSuccessfulReports = dsr; }
+ void setDumpFailedReports(bool dfr) throw() { a_dumpFailedReports = dfr; }
+
+ bool getDumpSuccessfulReports() const throw() { return a_dumpSuccessfulReports; }
+ bool getDumpFailedReports() const throw() { return a_dumpFailedReports; }
// Helper to calculate time interval and synchronous amount of execution tests to guarantee the input rate (tests per second)
// through the time manager which has a minimum resolution of ADML minimum resolution. The first call to this method will