Service Virtualization

  • 1.  Devtest Integration with Jenkins

    Posted Jun 27, 2018 12:00 AM

    Hi All,

     

    We are trying to integrate devtest with Jenkins for CI/CD. As per the available posts on community, came to know about LISA Invoke APIs as one of the ways. I have tried the same but getting below error while triggering a build in jenkins. LISA registry is on remote server. Do I need to configure DevTest machine as slave in jenkins to use LISA Invoke??

     

    Pipeline script:

     

    node ('LINUX_SLAVE'){

    sh('curl -F file=@/Projects/GIT/Project/Tests/XYZ.tst GET http://HOST:1505/lisa-invoke/runTest?testCasePath=Projects/GIT/Project/Tests/XYZ.tst&stagingDocPath=Projects/GIT/Project/Tests/StagingDocs/Run1User1Cycle.stg')
    }

     

    error in Jenkins:

     

    [DevTest_PipeLine] Running shell script + stagingDocPath=Projects/GIT/Project/Tests/StagingDocs/Run1User1Cycle.stg + curl -F file=@Projects/GIT/Project/Tests/XYZ.tst GET http://Host:1505/lisa-invoke/runTest?testCasePath=Projects/GIT/Project/Tests/XYZ.tst % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: GET [Pipeline] } //node [Pipeline] Allocate node : End [Pipeline] End of Pipeline Finished: SUCCESS

     

    Can someone please help to rectify this issue. 



  • 2.  Re: Devtest Integration with Jenkins

    Broadcom Employee
    Posted Jun 27, 2018 04:41 AM

    What version of DevTest are you running?



  • 3.  Re: Devtest Integration with Jenkins

    Posted Jun 27, 2018 07:02 AM

    We are using 9.5.1 DevTest



  • 4.  Re: Devtest Integration with Jenkins

    Posted Jun 27, 2018 10:46 AM

    Hello Sonakshi,

     

    Try to use -X GET instead of GET:

    curl -X GET http://HOST...

     

    or just:

    curl http://HOST...

     

    Hope it helps.

    Heloisa



  • 5.  Re: Devtest Integration with Jenkins

    Broadcom Employee
    Posted Jul 02, 2018 04:36 AM

    Hi,

     

    Did the answers from Heloisa answered your question? If it did please mark it as the right answer. When your question is not answered or you still have additional questions please let us know.


    Cheers,



  • 6.  Re: Devtest Integration with Jenkins
    Best Answer

    Posted Jul 02, 2018 08:44 AM

    To go a little deeper into the question,

    1) you do not need to configure DevTest as a slave within Jenkins.

    2) As others have pointed out, check your cURL command. Most GET calls can be accomplished without specifying -X GET as HTTP method as cURL assumes GET.

    3) Is there a particular reason the pipeline is attempting to attach a file? Normally, this would constitute a POST not GET.

    sh('curl -F file=@/Projects/GIT/Project/Tests/XYZ.tst GET http://HOST:1505/lisa-invoke/runTest?testCasePath=Projects/GIT/Project/Tests/XYZ.tst&stagingDocPath=Projects/GIT/Project/Tests/StagingDocs/Run1User1Cycle.stg')

    The pattern used by the lisa-invoke command is  (http://<yourSvr>:1505/lisa-invoke/  see: LISA Invoke - DevTest Solutions - 10.1 - CA Technologies Documentation):

    http://<DevTestServer>:1505/lisa-invoke/runTest?testCasePath=testCasePath&[stagingDocPath=stagingDocPath]&[configPath=configPath]&[async=true]&[coordName=csName]

    4) You did not specify the version of DevTest, however, in later versions, you will likely need to pass a userId and Password in the cURL command as well.  The pattern is:  -u <userName>:<pwd> or use the Jenkins Credential Store to set up and use a "withCredentials" mechanism.  Or you can store it as plain text and cURL will convert it to Basic Auth.

     

    Notes on attaching files:

    - cURL needs access to the location of the file attachment so it can be sent to DevTest as an attachment. So, the location of the attachment is in Jenkins' Workspace, not DevTest's file system. In some Jenkins setups, both slaves and masters can have their own independent workspaces. This can make accessing the Jenkins Workspace confusing. Make certain to understand your Jenkins installation to determine how and where files are stored and the proper technique for accessing the location of the file(s) when sending attachments. 

     

    For those interested, following is an example of a cURL using Jenkins withCredentials where the DevTest userId and password are stored in a Jenkins Credential store in a credential called devtest_user:

    withCredentials([usernamePassword(credentialsId: 'devtest_user', passwordVariable: 'DT_PWD', usernameVariable: 'DT_USER')]) {

    // use fully qualified paths to the assets, these could be parameterized if desired

    def rsp = sh returnStdout: true, \

              script: """curl -i -X GET -u ${DT_USER}:${DT_PWD} \"http://<DevTestServer>:1505/lisa-invoke/runTest?testCasePath=/path/to/test/XYZ.tst&stagingDocPath=/path/to/StagingDocs/Run1User1Cycle.stg&configPath=/path/to/Configs/Project.config\" """

    // logic to check rsp and do other work, if necessary

    }



  • 7.  Re: Devtest Integration with Jenkins

    Posted Jul 05, 2018 06:33 AM

    Hi Sona, Can you refer below link for Integrating DevTest Cases with Jenkins. I tried this in my project for CICD and it worked. 

     

    Jenkins and DevTest Integration using ANT  



  • 8.  Re: Devtest Integration with Jenkins

    Broadcom Employee
    Posted Aug 20, 2018 12:16 PM

    Sona0703 - We now have an official plugin for Jenkins that we released a couple of weeks back to the Jenkins.io marketplace. Can you see if that helps? 

     

    A couple of things -

    1. For App Test: to runs suites and tests thru the Plugin, you would need 10.3.

    2. There is a webcast scheduled for Aug 30. Check out this link - [COMMUNITY WEBCAST] CA Service Virtualization Jenkins Plugin - August 30, 2018 @ 11 a.m. ET