From: <sri...@us...> - 2009-04-15 12:10:13
|
Revision: 579 http://sipp.svn.sourceforge.net/sipp/?rev=579&view=rev Author: srivanuj Date: 2009-04-15 12:10:03 +0000 (Wed, 15 Apr 2009) Log Message: ----------- add the attribute check_it_inverse to the ereg action, provided by Mikael Rudholm Modified Paths: -------------- sipp/trunk/actions.cpp sipp/trunk/actions.hpp sipp/trunk/call.cpp sipp/trunk/call.hpp sipp/trunk/scenario.cpp sipp/trunk/sipp.cpp sipp/trunk/stat.cpp sipp/trunk/stat.hpp Modified: sipp/trunk/actions.cpp =================================================================== --- sipp/trunk/actions.cpp 2009-03-30 08:51:27 UTC (rev 578) +++ sipp/trunk/actions.cpp 2009-04-15 12:10:03 UTC (rev 579) @@ -91,19 +91,21 @@ { if (M_action == E_AT_ASSIGN_FROM_REGEXP) { if(M_lookingPlace == E_LP_MSG) { - printf("Type[%d] - regexp[%s] where[%s] - checkIt[%d] - $%s", + printf("Type[%d] - regexp[%s] where[%s] - checkIt[%d] - checkItInverse[%d] - $%s", M_action, M_regularExpression, "Full Msg", M_checkIt, + M_checkItInverse, display_scenario->allocVars->getName(M_varId)); } else { - printf("Type[%d] - regexp[%s] where[%s-%s] - checkIt[%d] - $%s", + printf("Type[%d] - regexp[%s] where[%s-%s] - checkIt[%d] - checkItInverse[%d] - $%s", M_action, M_regularExpression, "Header", M_lookingChar, - M_checkIt, display_scenario->allocVars->getName(M_varId)); + M_checkIt, + M_checkItInverse, display_scenario->allocVars->getName(M_varId)); } } else if (M_action == E_AT_EXECUTE_CMD) { printf("Type[%d] - command[%-32.32s]", M_action, M_message_str[0]); @@ -159,6 +161,7 @@ CAction::T_Comparator CAction::getComparator () { return(M_comp); } bool CAction::getCheckIt() { return(M_checkIt); } +bool CAction::getCheckItInverse() { return(M_checkItInverse); } bool CAction::getCaseIndep() { return(M_caseIndep); } bool CAction::getHeadersOnly() { return(M_headersOnly); } int CAction::getOccurence() { return(M_occurence); } @@ -180,6 +183,8 @@ { M_lookingPlace = P_value; } void CAction::setCheckIt (bool P_value) { M_checkIt = P_value; } +void CAction::setCheckItInverse (bool P_value) +{ M_checkItInverse = P_value; } void CAction::setVarId (int P_value) { M_varId = P_value; } void CAction::setVarInId (int P_value) @@ -409,6 +414,7 @@ setLookingChar ( P_action.getLookingChar() ); setCheckIt ( P_action.getCheckIt() ); + setCheckItInverse ( P_action.getCheckItInverse() ); setCaseIndep ( P_action.getCaseIndep() ); setOccurence ( P_action.getOccurence() ); setHeadersOnly ( P_action.getHeadersOnly() ); @@ -434,6 +440,7 @@ M_subVarId = NULL; M_checkIt = false; + M_checkItInverse = false; M_lookingPlace = E_LP_MSG; M_lookingChar = NULL; M_caseIndep = false; Modified: sipp/trunk/actions.hpp =================================================================== --- sipp/trunk/actions.hpp 2009-03-30 08:51:27 UTC (rev 578) +++ sipp/trunk/actions.hpp 2009-04-15 12:10:03 UTC (rev 579) @@ -115,6 +115,7 @@ T_LookingPlace getLookingPlace(); T_Comparator getComparator(); bool getCheckIt(); + bool getCheckItInverse(); bool getCaseIndep(); bool getHeadersOnly(); int getVarId(); @@ -133,6 +134,7 @@ void setLookingPlace (T_LookingPlace P_value); void setComparator (T_Comparator P_value); void setCheckIt (bool P_value); + void setCheckItInverse (bool P_value); void setVarId (int P_value); void setVarInId (int P_value); void setVarIn2Id (int P_value); @@ -171,6 +173,7 @@ T_LookingPlace M_lookingPlace; T_Comparator M_comp; bool M_checkIt; + bool M_checkItInverse; bool M_caseIndep; bool M_headersOnly; int M_varId; Modified: sipp/trunk/call.cpp =================================================================== --- sipp/trunk/call.cpp 2009-03-30 08:51:27 UTC (rev 578) +++ sipp/trunk/call.cpp 2009-04-15 12:10:03 UTC (rev 579) @@ -1296,6 +1296,14 @@ new deadcall(id, reason_str); } break; + case call::E_AR_REGEXP_SHOULDNT_MATCH: + computeStat(CStat::E_CALL_FAILED); + computeStat(CStat::E_FAILED_REGEXP_SHOULDNT_MATCH); + if (deadcall_wait && !initCall) { + sprintf(reason_str, "regexp matched, but shouldn't at index %d", msg_index); + new deadcall(id, reason_str); + } + break; case call::E_AR_HDR_NOT_FOUND: computeStat(CStat::E_CALL_FAILED); computeStat(CStat::E_FAILED_REGEXP_HDR_NOT_FOUND); @@ -3423,6 +3431,13 @@ WARNING("Failed regexp match: looking in '%s', with regexp '%s'", haystack, currentAction->getRegularExpression()); return(call::E_AR_REGEXP_DOESNT_MATCH); + } else if ( ((M_callVariableTable->getVar(currentAction->getVarId())->isSet())) && + (currentAction->getCheckItInverse() == true) ) + { + // The inverse of the above + WARNING("Regexp matched but should not: looking in '%s', with regexp '%s'", + haystack, currentAction->getRegularExpression()); + return(call::E_AR_REGEXP_SHOULDNT_MATCH); } } else if (currentAction->getActionType() == CAction::E_AT_ASSIGN_FROM_VALUE) { double operand = get_rhs(currentAction); Modified: sipp/trunk/call.hpp =================================================================== --- sipp/trunk/call.hpp 2009-03-30 08:51:27 UTC (rev 578) +++ sipp/trunk/call.hpp 2009-04-15 12:10:03 UTC (rev 579) @@ -216,6 +216,7 @@ { E_AR_NO_ERROR = 0, E_AR_REGEXP_DOESNT_MATCH, + E_AR_REGEXP_SHOULDNT_MATCH, E_AR_STOP_CALL, E_AR_CONNECT_FAILED, E_AR_HDR_NOT_FOUND Modified: sipp/trunk/scenario.cpp =================================================================== --- sipp/trunk/scenario.cpp 2009-03-30 08:51:27 UTC (rev 578) +++ sipp/trunk/scenario.cpp 2009-04-15 12:10:03 UTC (rev 579) @@ -1391,7 +1391,14 @@ tmpAction->setLookingChar(NULL); } // end if-else search_in + if (xp_get_value("check_it")) { tmpAction->setCheckIt(xp_get_bool("check_it", "ereg", false)); + if (xp_get_value("check_it_inverse")) { + ERROR("Can not have both check_it and check_it_inverse for ereg!"); + } + } else { + tmpAction->setCheckItInverse(xp_get_bool("check_it_inverse", "ereg", false)); + } if (!(ptr = xp_get_value((char *) "assign_to"))) { ERROR("assign_to value is missing"); Modified: sipp/trunk/sipp.cpp =================================================================== --- sipp/trunk/sipp.cpp 2009-03-30 08:51:27 UTC (rev 578) +++ sipp/trunk/sipp.cpp 2009-04-15 12:10:03 UTC (rev 579) @@ -3708,6 +3708,12 @@ " during the call but the counter is increased only by\n" " one).\n" "\n" +" - FailedRegexpShouldntMatch:\n" +" Number of failed calls because of regexp that shouldn't\n" +" match (there might be several regexp that shouldn't match\n" +" during the call but the counter is increased only by\n" +" one).\n" +"\n" " - FailedRegexpHdrNotFound:\n" " Number of failed calls because of regexp with hdr \n" " option but no matching header found.\n" Modified: sipp/trunk/stat.cpp =================================================================== --- sipp/trunk/stat.cpp 2009-03-30 08:51:27 UTC (rev 578) +++ sipp/trunk/stat.cpp 2009-04-15 12:10:03 UTC (rev 579) @@ -670,6 +670,12 @@ M_counters [CPT_PL_FailedCallRegexpDoesntMatch]++; break; + case E_FAILED_REGEXP_SHOULDNT_MATCH : + M_counters [CPT_C_FailedCallRegexpShouldntMatch]++; + M_counters [CPT_PD_FailedCallRegexpShouldntMatch]++; + M_counters [CPT_PL_FailedCallRegexpShouldntMatch]++; + break; + case E_FAILED_REGEXP_HDR_NOT_FOUND : M_counters [CPT_C_FailedCallRegexpHdrNotFound]++; M_counters [CPT_PD_FailedCallRegexpHdrNotFound]++; @@ -1497,6 +1503,8 @@ << "FailedCmdNotSent(C)" << stat_delimiter << "FailedRegexpDoesntMatch(P)" << stat_delimiter << "FailedRegexpDoesntMatch(C)" << stat_delimiter + << "FailedRegexpShouldntMatch(P)" << stat_delimiter + << "FailedRegexpShouldntMatch(C)" << stat_delimiter << "FailedRegexpHdrNotFound(P)" << stat_delimiter << "FailedRegexpHdrNotFound(C)" << stat_delimiter << "FailedOutboundCongestion(P)" << stat_delimiter @@ -1600,6 +1608,8 @@ << M_counters[CPT_C_FailedCallCmdNotSent] << stat_delimiter << M_counters[CPT_PL_FailedCallRegexpDoesntMatch] << stat_delimiter << M_counters[CPT_C_FailedCallRegexpDoesntMatch] << stat_delimiter + << M_counters[CPT_PL_FailedCallRegexpShouldntMatch] << stat_delimiter + << M_counters[CPT_C_FailedCallRegexpShouldntMatch] << stat_delimiter << M_counters[CPT_PL_FailedCallRegexpHdrNotFound] << stat_delimiter << M_counters[CPT_C_FailedCallRegexpHdrNotFound] << stat_delimiter << M_counters[CPT_PL_FailedOutboundCongestion] << stat_delimiter Modified: sipp/trunk/stat.hpp =================================================================== --- sipp/trunk/stat.hpp 2009-03-30 08:51:27 UTC (rev 578) +++ sipp/trunk/stat.hpp 2009-04-15 12:10:03 UTC (rev 579) @@ -104,6 +104,7 @@ E_FAILED_CALL_REJECTED, E_FAILED_CMD_NOT_SENT, E_FAILED_REGEXP_DOESNT_MATCH, + E_FAILED_REGEXP_SHOULDNT_MATCH, E_FAILED_REGEXP_HDR_NOT_FOUND, E_FAILED_OUTBOUND_CONGESTION, E_FAILED_TIMEOUT_ON_RECV, @@ -143,6 +144,7 @@ CPT_C_FailedCallCallRejected, CPT_C_FailedCallCmdNotSent, CPT_C_FailedCallRegexpDoesntMatch, + CPT_C_FailedCallRegexpShouldntMatch, CPT_C_FailedCallRegexpHdrNotFound, CPT_C_FailedOutboundCongestion, CPT_C_FailedTimeoutOnRecv, @@ -182,6 +184,7 @@ CPT_PD_FailedCallCallRejected, CPT_PD_FailedCallCmdNotSent, CPT_PD_FailedCallRegexpDoesntMatch, + CPT_PD_FailedCallRegexpShouldntMatch, CPT_PD_FailedCallRegexpHdrNotFound, CPT_PD_FailedOutboundCongestion, CPT_PD_FailedTimeoutOnRecv, @@ -222,6 +225,7 @@ CPT_PL_FailedCallCallRejected, CPT_PL_FailedCallCmdNotSent, CPT_PL_FailedCallRegexpDoesntMatch, + CPT_PL_FailedCallRegexpShouldntMatch, CPT_PL_FailedCallRegexpHdrNotFound, CPT_PL_FailedOutboundCongestion, CPT_PL_FailedTimeoutOnRecv, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |