Service Virtualization

  • 1.  Execution Mode: STAND_IN always routing to Live Invocation

    Posted Aug 09, 2018 10:12 AM

    Hi Team,

     

    I'm trying to use 'Stand In' in ITR, so set the lisa.vse.execution.mode to STAND_IN in project.config.

    However when I run the test, the request always been routed to Live Invocation even there's an exact request sent to vsi. 

     

    P.S. I have given return false in META Match Script to not pick the Meta Response.

     

     

     

    Thanks,

    John



  • 2.  Re: Execution Mode: STAND_IN always routing to Live Invocation

    Posted Aug 09, 2018 10:51 AM

    Hello John,

     

    Do you know if an exact match is happening?

    In Stand In execution mode, the request will be forwarded to the live in case there is an unknown response.

    I am wondering if a no match is happening and then routing the request to live invocation.

     

    If you set your VSM to EFFICIENT and send the same request, do you get an exact match?

     

    Hope it helps.

    Heloisa



  • 3.  Re: Execution Mode: STAND_IN always routing to Live Invocation

    Posted Aug 09, 2018 11:46 AM

    Hello Heloisa,

     

    I could see the below behaviors...

     

     

    1) STAND_IN [giving 'return false;' in Meta Match script]

     

    2) EFFICIENT [giving 'return false;' in Meta Match script]

    However when I turn it to 'EFFICIENT' I'm getting 404 Not Found - The DevTest VSE service could not match your request to a recorded request.  Consider expanding your service image.

     

    3) EFFICIENT [leaving Meta Match script <blank>]

    If I remove 'return false' from Meta Match Script then I'm getting response from META.

     

     

     

    Expected is: Meta not to be Picked when there's no EXACT match and has to be routed to Live Invocation.

     

    Thanks,

    John



  • 4.  Re: Execution Mode: STAND_IN always routing to Live Invocation

    Posted Aug 09, 2018 02:35 PM

    I believe you have confirmed exactly what Heloisa pointed out. When you're in STAND_IN mode, it will forward the request to the live service when a match cannot be found in the VSI.

     

    In your scenarios:

     

    1. STAND_IN: You have META response match script return false. If there's no exact match then a "no match found" response is triggered and in turn triggers the Live Invocation step.

     

    2. EFFICIENT: You have META response match script return false. If there's no exact match then a "no match found" response is triggered and returned.

     

    3. EFFICIENT: Your META response have no match script. If there's no exact match but the match tolerance matches META (either by Operation or Signature), then the META response will be returned.

     

    What you're seeing is the expected behavior. Can you explain how you want the virtual service to behave under the above conditions?



  • 5.  Re: Execution Mode: STAND_IN always routing to Live Invocation

    Posted Aug 09, 2018 03:23 PM

    Hi William, Thanks for explaining.

    Issue is, when there's an EXACT match, it's still routing to Live invocation instead of sending the matched response during the below set up. The return false is applicable only for META right?

     

    1. STAND_IN: You have META response match script return false. If there's no exact match then a "no match found" response is triggered and in turn triggers the Live Invocation step.

     

     



  • 6.  Re: Execution Mode: STAND_IN always routing to Live Invocation

    Posted Aug 09, 2018 05:39 PM

    That's correct, when you put your "return false;" statement in the match script for the META response, it will only be applicable to the META response and not its exact match responses.

     

    The behavior you're describing is not the expected behavior and something seems wrong. Do you have a screenshot example that illustrates the behavior you're seeing for the scenario where you have STAND_IN with an exact match that triggers live invocation? (FYI, none of the scenarios/screenshots you've posted earlier illustrates that behavior)



  • 7.  Re: Execution Mode: STAND_IN always routing to Live Invocation
    Best Answer

    Broadcom Employee
    Posted Oct 03, 2018 03:24 PM

    Hi John, 

    I have found a solution for your issue.

    First, why "return false;" mentioned above is failing.

    When the VSE is looking for a match, it first matches on the Meta transaction; then looks for an exact match.

    This explains why adding "return false;" to the Meta match script always went to the live service. Even with an exact match transaction. The initial match on Meta always fails, so the search for an exact match never happens.

     

    Solution:

    1. In the vsm, add a Scripted Assertion to the VS Image Response Selection step, as the last assertion.
    2. Configure this assertion to call the Live Invocation step when returning true.

    3. Add this script to the Scripted Assertion:
    import com.itko.lisa.vse.ExecutionMode;

    if (testExec.getStateObject("lisa.vse.execution.mode").equals(ExecutionMode.STAND_IN)) {
         if (testExec.getStateObject("lisa.vse.matched.transaction") instanceof com.itko.lisa.vse.stateful.model.TransactionNode) {
              return true;
         }
    }
    return false;

     

    Description of code: 

    The first if statement detects if the VS is in Stand In mode.

    The inner if statement detect if the match is Meta or Exact.

    So, if Stand In mode and Meta match the script will return true and re-route to the Live Invocation step