Service Virtualization

 View Only
  • 1.  How to pass jenkins variables using build.xml to LISA test

    Posted Feb 09, 2016 05:29 PM

    How to pass jenkins variables using build.xml to LISA test? I am using ant build and build.xml to trigger tests from jenkins, I need to pass the jenkins variables to lisa test as properties so that I can use it during run time.



  • 2.  Re: How to pass jenkins variables using build.xml to LISA test

    Broadcom Employee
    Posted Feb 14, 2016 11:47 PM

    Hi,

     

      To pass a variable to LISA test as a property, follow below approach

     

    Use "jvmarg" tag inside junitlisa tag. so that, value assigned to jvmarg will be considered as a jvm property and you can directly use it as LISA property.

     

    Ex:

     

    <junitlisa toDir="${testReportDir}"

    outputtoformatters="false"

    test="Tests/DevTest_config_info.tst"

    stagingDoc="StagingDocs/1User0Think_RunContinuously.stg"

    user="admin"

    password="admin">

    <jvmarg value="-DmyProperty=MyProperty"/>

    </junitlisa>

     

    In Testcase "DevTest_config_info.tst", to use this property, print it as {{myProperty}}



  • 3.  Re: How to pass jenkins variables using build.xml to LISA test

    Posted Feb 15, 2016 05:34 PM

    Thanks Srikanth. I have already tried the above option but not getting the value inside lisa test.

     

    I am using v8.4. Do you know in which version you have tested this feature?



  • 4.  Re: How to pass jenkins variables using build.xml to LISA test

    Broadcom Employee
    Posted Feb 16, 2016 07:37 PM

    Hi Pallab,

     

       I have tested on Devtest 8.4 and Devtest 9.0 and its working. I have tried below options.

     

    1)  Started only Registry in my local and executed ant command and my testcase picked the jvmarg property and I am able to use it.

    2)  Started all Devtest components (Registry/Coordinator/Simulator) and executed ant command. In this case, i did not see jvmarg value in my test case. To resolve this, I have changed Simulator name in staging doc to "local" (instead of auto) and re-ran the testcase. Then, I could see the jvmarg value in my test execution.

     

       Let me know if you have any questions.

     

    Thanks

    Srikanth