Fix random tests failed in logging and tasks testsuites + add knownIssue tag in snmp testsuite
| | |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <call function="'Sleep'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME, |
| | | 'sleepForMilliSeconds' : 5000 } |
| | | </call> |
| | | |
| | | <call function="'listFolder'"> |
| | | { 'location' : DIRECTORY_INSTANCE_HOST, |
| | | 'foldername' : '%s/%s/logs' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME), |
| | |
| | | <!--- Test Case information |
| | | #@TestMarker SNMP MIB values |
| | | #@TestName snmp_mibvalues: TODO |
| | | #@TestIssue none |
| | | #@TestIssue 3862 |
| | | #@TestPurpose TODO. |
| | | #@TestPreamble none |
| | | #@TestStep TODO. |
| | |
| | | 'snmpHost' : DIRECTORY_INSTANCE_HOST , |
| | | 'snmpPort' : SNMP_PORT , |
| | | 'snmpCommunity' : community , |
| | | 'index' : indexLDAP |
| | | 'index' : indexLDAP , |
| | | 'knownIssue' : '3862' |
| | | } |
| | | </call> |
| | | |
| | |
| | | <!--- Test Case information |
| | | #@TestMarker SNMP MIB values |
| | | #@TestName snmp_mibvalues: TODO |
| | | #@TestIssue none |
| | | #@TestIssue 3862 |
| | | #@TestPurpose TODO. |
| | | #@TestPreamble none |
| | | #@TestStep TODO. |
| | |
| | | 'snmpHost' : DIRECTORY_INSTANCE_HOST , |
| | | 'snmpPort' : SNMP_PORT , |
| | | 'snmpCommunity' : community , |
| | | 'index' : indexLDAP |
| | | 'index' : indexLDAP , |
| | | 'knownIssue' : '3862' |
| | | } |
| | | </call> |
| | | |
| | |
| | | <!--- Test Case information |
| | | #@TestMarker SNMP MIB values |
| | | #@TestName snmp_mibvalues: TODO |
| | | #@TestIssue none |
| | | #@TestIssue 3862 |
| | | #@TestPurpose TODO. |
| | | #@TestPreamble none |
| | | #@TestStep TODO. |
| | |
| | | 'snmpHost' : DIRECTORY_INSTANCE_HOST , |
| | | 'snmpPort' : SNMP_PORT , |
| | | 'snmpCommunity' : community , |
| | | 'index' : indexLDAP |
| | | 'index' : indexLDAP , |
| | | 'knownIssue' : '3862' |
| | | } |
| | | </call> |
| | | |
| | |
| | | <!--- Test Case information |
| | | #@TestMarker SNMP MIB values |
| | | #@TestName snmp_mibvalues: TODO |
| | | #@TestIssue none |
| | | #@TestIssue 3862 |
| | | #@TestPurpose TODO. |
| | | #@TestPreamble none |
| | | #@TestStep TODO. |
| | |
| | | 'snmpHost' : DIRECTORY_INSTANCE_HOST , |
| | | 'snmpPort' : SNMP_PORT , |
| | | 'snmpCommunity' : community , |
| | | 'index' : indexLDAP |
| | | 'index' : indexLDAP , |
| | | 'knownIssue' : '3862' |
| | | } |
| | | </call> |
| | | |
| | |
| | | <!--- Test Case information |
| | | #@TestMarker SNMP MIB values |
| | | #@TestName snmp_mibvalues: TODO |
| | | #@TestIssue none |
| | | #@TestIssue 3862 |
| | | #@TestPurpose TODO. |
| | | #@TestPreamble none |
| | | #@TestStep TODO. |
| | |
| | | 'snmpHost' : DIRECTORY_INSTANCE_HOST , |
| | | 'snmpPort' : SNMP_PORT , |
| | | 'snmpCommunity' : community , |
| | | 'index' : indexLDAP |
| | | 'index' : indexLDAP , |
| | | 'knownIssue' : '3862' |
| | | } |
| | | </call> |
| | | |
| | |
| | | <!--- Test Case information |
| | | #@TestMarker SNMP MIB values |
| | | #@TestName snmp_mibvalues: TODO |
| | | #@TestIssue none |
| | | #@TestIssue 3862 |
| | | #@TestPurpose TODO. |
| | | #@TestPreamble none |
| | | #@TestStep TODO. |
| | |
| | | 'snmpHost' : DIRECTORY_INSTANCE_HOST , |
| | | 'snmpPort' : SNMP_PORT , |
| | | 'snmpCommunity' : community , |
| | | 'index' : indexLDAP |
| | | 'index' : indexLDAP , |
| | | 'knownIssue' : '3862' |
| | | } |
| | | </call> |
| | | |
| | |
| | | #@TestMarker SNMP Connection Handler status |
| | | #@TestName status: check status when the server is |
| | | stopped/started |
| | | #@TestIssue none |
| | | #@TestIssue 3865 |
| | | #@TestPurpose Check status when the server is |
| | | stopped/started. |
| | | #@TestPreamble none |
| | |
| | | returnString = STAXResult[0][1] |
| | | </script> |
| | | |
| | | <call function="'checktestString'"> |
| | | <call function="'searchString'"> |
| | | { |
| | | 'returnString' : returnString , |
| | | 'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \ |
| | | % SNMP_PORT |
| | | % SNMP_PORT , |
| | | 'returnString' : returnString , |
| | | 'knownIssue' : '3865' , |
| | | 'expectedRC' : expectedRC |
| | | } |
| | | </call> |
| | | |
| | |
| | | returnString = STAXResult[0][1] |
| | | </script> |
| | | |
| | | <call function="'checktestString'"> |
| | | <call function="'searchString'"> |
| | | { |
| | | 'returnString' : returnString , |
| | | 'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \ |
| | | % SNMP_PORT |
| | | % SNMP_PORT , |
| | | 'returnString' : returnString , |
| | | 'knownIssue' : '3865' , |
| | | 'expectedRC' : expectedRC |
| | | } |
| | | </call> |
| | | |
| | |
| | | #@TestMarker SNMP Connection Handler status |
| | | #@TestName status: check status when the connection |
| | | handler is disabled/enabled |
| | | #@TestIssue none |
| | | #@TestIssue 3865 |
| | | #@TestPurpose Check status when the SNMP connection handler |
| | | is disabled/enabled. |
| | | #@TestPreamble none |
| | |
| | | returnString = STAXResult[0][1] |
| | | </script> |
| | | |
| | | <call function="'checktestString'"> |
| | | <call function="'searchString'"> |
| | | { |
| | | 'returnString' : returnString , |
| | | 'expectedString' : '0.0.0.0:%s : SNMP : Disabled' \ |
| | | % SNMP_PORT |
| | | % SNMP_PORT , |
| | | 'returnString' : returnString , |
| | | 'knownIssue' : '3865' , |
| | | 'expectedRC' : expectedRC |
| | | } |
| | | </call> |
| | | |
| | |
| | | returnString = STAXResult[0][1] |
| | | </script> |
| | | |
| | | <call function="'checktestString'"> |
| | | <call function="'searchString'"> |
| | | { |
| | | 'returnString' : returnString , |
| | | 'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \ |
| | | % SNMP_PORT |
| | | % SNMP_PORT , |
| | | 'returnString' : returnString , |
| | | 'knownIssue' : '3865' , |
| | | 'expectedRC' : expectedRC |
| | | } |
| | | </call> |
| | | |
| | |
| | | #@TestName status: check error message and status when |
| | | the opendmk-jarfile property is set to a |
| | | wrong value |
| | | #@TestIssue none |
| | | #@TestIssue 3865 |
| | | #@TestPurpose Check error message and status when |
| | | the opendmk-jarfile property is set to a |
| | | wrong value. |
| | |
| | | returnString = STAXResult[0][1] |
| | | </script> |
| | | |
| | | <call function="'checktestString'"> |
| | | <call function="'searchString'"> |
| | | { |
| | | 'returnString' : returnString , |
| | | 'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \ |
| | | % SNMP_PORT |
| | | % SNMP_PORT , |
| | | 'returnString' : returnString , |
| | | 'knownIssue' : '3865' , |
| | | 'expectedRC' : expectedRC |
| | | } |
| | | </call> |
| | | |
| | |
| | | #@TestName status: check error message and status when |
| | | the security-agent-file property is set to a |
| | | wrong value |
| | | #@TestIssue none |
| | | #@TestIssue 3865 |
| | | #@TestPurpose Check error message and status when |
| | | the security-agent-file property is set to a |
| | | wrong value. |
| | |
| | | returnString = STAXResult[0][1] |
| | | </script> |
| | | |
| | | <call function="'checktestString'"> |
| | | <call function="'searchString'"> |
| | | { |
| | | 'returnString' : returnString , |
| | | 'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \ |
| | | % SNMP_PORT |
| | | % SNMP_PORT , |
| | | 'returnString' : returnString , |
| | | 'knownIssue' : '3865' , |
| | | 'expectedRC' : expectedRC |
| | | } |
| | | </call> |
| | | |
| | |
| | | #@TestName status: check error message and status when |
| | | the listen-port property is set to a wrong |
| | | value |
| | | #@TestIssue none |
| | | #@TestIssue 3865 |
| | | #@TestPurpose Check error message and status when |
| | | the listen-port property is set to a wrong |
| | | value. |
| | |
| | | returnString = STAXResult[0][1] |
| | | </script> |
| | | |
| | | <call function="'checktestString'"> |
| | | <call function="'searchString'"> |
| | | { |
| | | 'returnString' : returnString , |
| | | 'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \ |
| | | % DEFAULT_PROPERTIES['listen-port'] |
| | | % DEFAULT_PROPERTIES['listen-port'] , |
| | | 'returnString' : returnString , |
| | | 'knownIssue' : '3865' , |
| | | 'expectedRC' : expectedRC |
| | | } |
| | | </call> |
| | | |
| | |
| | | 'backEnd' : DIRECTORY_INSTANCE_BE} |
| | | </call> |
| | | |
| | | <!-- manage-tasks --> |
| | | <call function="'manage-tasks'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST, |
| | | 'dsInstanceDn' : DIRECTORY_INSTANCE_DN, |
| | | 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD, |
| | | 'dsQuiet' : ' ' |
| | | } |
| | | </call> |
| | | |
| | | <script> |
| | | returnString = STAXResult[0][1] |
| | | </script> |
| | | |
| | | <call function="'searchStringForSubstring'"> |
| | | { 'returnString' : returnString, |
| | | 'testString' : 'Backup', |
| | | 'expectedResult' : '1' } |
| | | </call> |
| | | |
| | | |
| | | <script>checkRC=9999</script> |
| | | <loop from="1" to="10" var="loop" while="checkRC != 0"> |
| | | <sequence> |
| | | <message>'LOOP %s' % loop</message> |
| | | <!-- manage-tasks --> |
| | | <call function="'manage-tasks'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST, |
| | | 'dsInstanceDn' : DIRECTORY_INSTANCE_DN, |
| | | 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD, |
| | | 'dsQuiet' : ' ' |
| | | } |
| | | </call> |
| | | |
| | | <script> |
| | | returnString = STAXResult[0][1] |
| | | currentDate=strftime("%Y%m%d",localtime()) |
| | | </script> |
| | | |
| | | <call function="'searchString'"> |
| | | { 'expectedString' : '%s.* Backup Completed successfully' \ |
| | | % currentDate, |
| | | 'returnString' : returnString , |
| | | 'expectedRC' : 'noCheck' } |
| | | </call> |
| | | |
| | | <script> |
| | | checkRC = STAXResult[0] |
| | | </script> |
| | | |
| | | </sequence> |
| | | </loop> |
| | | |
| | | <message>'--- Check log files backup_asynchronous ---'</message> |
| | | <call function="'listFolder'"> |
| | | { 'location' : '%s' % (STAF_REMOTE_HOSTNAME), |
| | |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="knownIssue" type="optional" default="None"> |
| | | <function-arg-description> |
| | | Known issue. Corresponds to an issue number. |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | <function-arg-def name="expectedRC" type="optional" default="0"> |
| | | <function-arg-description> |
| | | Expected return code value. Default value is 0 |
| | |
| | | 'result: %s' % result |
| | | </message> |
| | | |
| | | <call function="'checktestStringNotPresent'"> |
| | | <call function="'searchString'"> |
| | | { |
| | | 'returnString' : result , |
| | | 'testString' : 'ERROR' |
| | | 'expectedString' : 'ERROR' , |
| | | 'returnString' : result , |
| | | 'knownIssue' : knownIssue , |
| | | 'expectedRC' : 1 |
| | | } |
| | | </call> |
| | | |
| | |
| | | <tcstatus result="'fail'"/> |
| | | </sequence> |
| | | </function> |
| | | |
| | | <!-- checktestString --> |
| | | |
| | | <!-- Search string --> |
| | | <function name="searchString" scope="local"> |
| | | <function-prolog> |
| | | This function search for a string in the retrun string of a testcase |
| | | Return 0 if the string is found, 1 otherwise |
| | | </function-prolog> |
| | | |
| | | <function-map-args> |
| | | <function-arg-def name="expectedString" type="required"> |
| | | <function-arg-description> |
| | | the substring expected from the command |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="returnString" type="required"> |
| | | <function-arg-description> |
| | | the return string received from command |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="knownIssue" type="optional" default="None"> |
| | | <function-arg-description> |
| | | Known issue. Corresponds to an issue number. |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="expectedRC" type="optional" default="0"> |
| | | <function-arg-description> |
| | | Expected return code value. Default value is 0. |
| | | Wildcard 'noCheck' to not check the RC |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | |
| | | <sequence> |
| | | <script> |
| | | searchre = re.compile('%s' % expectedString) |
| | | myRC = 0 |
| | | myReason = 'None' |
| | | </script> |
| | | |
| | | <!-- Check that returnString is really a string --> |
| | | <if expr='returnString.__class__ is not org.python.core.PyString'> |
| | | <sequence> |
| | | <message log="1" level="'Error'"> |
| | | 'ERROR : Invalid returnString type (%s), requires org.python.core.PyString.' \ |
| | | % returnString.__class__ |
| | | </message> |
| | | <script> |
| | | myRC = 1 |
| | | myReason = 'Python error' |
| | | </script> |
| | | |
| | | <return>[myRC, myReason]</return> |
| | | </sequence> |
| | | </if> |
| | | |
| | | <!-- Search for the expectedString --> |
| | | <if expr='re.search(searchre, returnString) != None'> |
| | | <sequence> |
| | | <message log="1"> |
| | | 'SUCCESS : Found substring, %s, in the return string' \ |
| | | % (expectedString) |
| | | </message> |
| | | <script> |
| | | myRC = 0 |
| | | myReason = 'String found' |
| | | </script> |
| | | </sequence> |
| | | <else> |
| | | <sequence> |
| | | <message log="1" level="'Error'"> |
| | | 'ERROR : Did not find substring, %s, in the return string, %s' \ |
| | | % (expectedString, returnString) |
| | | </message> |
| | | <script> |
| | | myRC = 1 |
| | | myReason = 'String not found' |
| | | </script> |
| | | </sequence> |
| | | </else> |
| | | </if> |
| | | |
| | | <!-- Manage expectedRC and knownIssue --> |
| | | <if expr="expectedRC != 'noCheck'"> |
| | | <if expr="myRC == expectedRC"> |
| | | <tcstatus result="'pass'"/> |
| | | <else> |
| | | <if expr="knownIssue == None"> |
| | | <tcstatus result="'fail'"/> |
| | | <else> |
| | | <call function="'setKnownIssue'"> |
| | | { 'issueId' : knownIssue } |
| | | </call> |
| | | </else> |
| | | </if> |
| | | </else> |
| | | </if> |
| | | </if> |
| | | |
| | | <return>[myRC, myReason]</return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | <!-- DEPRECATED, use searchString function --> |
| | | <function name="checktestString"> |
| | | <function-prolog> |
| | | This function checks the return string against an expected return substring for a testcase |
| | |
| | | </sequence> |
| | | </function> |
| | | |
| | | <!-- DEPRECATED, use searchString function --> |
| | | <function name="checktestStringNotPresent"> |
| | | <function-prolog> |
| | | This function checks the return string against an expected return substring that should not be present for a testcase |
| | |
| | | </sequence> |
| | | </function> |
| | | |
| | | <!-- DEPRECATED, use searchString function --> |
| | | <function name="searchStringForSubstring"> |
| | | <function-prolog> |
| | | This function simply searches a string for a substring |
| | |
| | | WC_PORT = '9000' |
| | | WC_SSL_PORT = '9001' |
| | | WC_HOST = 'localhost' |
| | | DSML_WARNAME = 'opends-DSML.war' |
| | | DSML_WARNAME = '%s-DSML.war' % OPENDSNAME |
| | | DSML_WARPATH = '%s/build/package/%s' % (OPENDSDIR, DSML_WARNAME) |
| | | SNMP_OPENDS_JARFILE = '%s/lib/extensions/snmp-mib2605.jar' % OPENDSNAME |
| | | SNMP_OPENDMK_LIBDIR = '/path/to/opendmk/lib' |