Ad Widget

Collapse

Soapui and zabbix. Missing SoapUI project file.. ErrorOfRunProject

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bazz
    Junior Member
    • Oct 2016
    • 2

    #1

    Soapui and zabbix. Missing SoapUI project file.. ErrorOfRunProject

    Hello.
    i use soapuipro 5.1.1. I create script for zabbix(external check) and run him. From command line he work fine. from zabbix i look this:
    Missing SoapUI project file.. ErrorOfRunProject
    if i change #!/bin/sh to #!/bin/bash
    i see this:
    /usr/lib/zabbix/externalscripts/ShinaTest.sh: line 47: $pathReportsDirectoryForHost/"$2RunLogs.txt": ambiguous redirect
    ErrorOfRunProjec
    t

    in zabbix i run this script that
    ShinaTest.sh["{HOSTNAME}"]

    my script

    #!/bin/sh
    pathSoapUIDirectory=/opt/SoapUI-Pro-5.1.1/bin/
    pathZabbixDirectory=/usr/lib/zabbix/externalscripts
    pathSoapUiProjectWithName=$pathZabbixDirectory/"Shina-soapui-project.xml"
    pathParentReportDir=/tmp/SoapReport
    pathReportsDirectory=$pathParentReportDir/"Shina-soapui-project"
    pathReportsDirectoryForHost=$pathReportsDirectory/"$1"
    if [ -d "$pathParentReportDir" ];
    then
    chmod 777 "$pathParentReportDir"
    else
    mkdir "$pathParentReportDir"
    chmod 777 "$pathParentReportDir"
    fi
    if [ -d "$pathReportsDirectory" ];
    then
    chmod 777 "$pathReportsDirectory"
    else
    mkdir "$pathReportsDirectory"
    chmod 777 "$pathReportsDirectory"
    fi
    if [ -d "$pathReportsDirectoryForHost" ];
    then
    chmod 777 "$pathReportsDirectoryForHost"
    else
    mkdir "$pathReportsDirectoryForHost"
    chmod 777 "$pathReportsDirectoryForHost"
    fi
    searchfile=$pathReportsDirectoryForHost/"alltests-fails.html"
    endPoint="http://10.180.121.58:82/WebStore1S/warehouse.svc"
    pathTestdataDirectory=$pathZabbixDirectory/"$6"
    workSpaceName="$7"
    testSuiteName="ShinaTestSuite"
    testCaseName="ShinaTestCase"
    commandString="$pathSoapUIDirectory/testrunner.sh -e $endPoint -s $testSuiteName"
    if [ -n "$testCaseName" ]
    then
    commandString=${commandString}" -c $testCaseName"
    fi
    commandString=${commandString}" -r -j -f $pathReportsDirectoryForHost"
    if [ -n "$pathTestdataDirectory" ]
    then
    commandString=${commandString}" -P pathTestData=$pathTestdataDirectory -P varSpace=$workSpaceName"
    fi
    commandString=${commandString}" -I $pathSoapUiProjectWithName"
    $commandString > $pathReportsDirectoryForHost/"$2RunLogs.txt"
    if [ $? -ne 0 ];
    then
    echo "ErrorOfRunProject"
    else
    if [ ! -f "$searchfile" ]
    then
    echo "FileNotFound"
    else
    if grep -w "Failure" "$searchfile" > /dev/null; then
    echo "TestFailure"
    else
    echo "OK"
    fi
    fi
    fi
Working...