#@TestStep stop the server #@TestStep check status using status command #@TestStep start the server #@TestStep check status using status command #@TestStep do a SNMP get request to check that the #@TestResult Success if output of status is correct. <
testcase name="getTestCaseName <
call function="'testCase_Preamble'"/>
'status: stop DS running on port %s' \
% (DIRECTORY_INSTANCE_PORT)
<
call function="'StopDsWithScript'">
'location' : STAF_REMOTE_HOSTNAME ,
'dsHost' : DIRECTORY_INSTANCE_HOST ,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
'status: status when the server is stopped'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'searchString'">
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
'returnString' : returnString ,
'status: start DS to run on port %s' \
% (DIRECTORY_INSTANCE_PORT)
<
call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
<!--- Check that DS started --> <
call function="'isAlive'">
'noOfMilliSeconds' : 2000
'status: status when the server is started'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'searchString'">
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
'returnString' : returnString ,
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : community ,
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker SNMP Connection Handler status #@TestName status: check status when the connection #@TestPurpose Check status when the SNMP connection handler #@TestStep disable the SNMP connection handler #@TestStep check status using status command #@TestStep enable the SNMP connection handler #@TestStep check status using status command #@TestResult Success if output of status is correct. <
testcase name="getTestCaseName <
call function="'testCase_Preamble'"/>
'status: disable the SNMP Connection Handler'
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set enabled:false'
'status: status when the SNMP connection handler is disabled'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'searchString'">
'expectedString' : '0.0.0.0:%s : SNMP : Disabled' \
'returnString' : returnString ,
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : community ,
'snmpStatus' : 'reqTimeout'
'status: enable the SNMP Connection Handler'
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set enabled:true'
'status: status when the SNMP connection handler is enabled'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'searchString'">
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
'returnString' : returnString ,
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : community ,
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker SNMP Connection Handler status #@TestName status: check error message and status when the opendmk-jarfile property is set to a #@TestPurpose Check error message and status when the opendmk-jarfile property is set to a #@TestStep set opendmk-jarfile property to a wrong value #@TestStep restart the server #@TestStep check that an error message is displayed at #@TestStep check status using status command #@TestStep restore value for opendmk-jarfile property #@TestStep disable the SNMP connection handler #@TestStep enable the SNMP connection handler #@TestResult Success if an error message is displayed and if the output of status is correct. <
testcase name="getTestCaseName ('status: status with a wrong opendmk-jarfile value')">
<
call function="'testCase_Preamble'"/>
'status: set opendmk-jarfile property to a wrong value'
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set opendmk-jarfile:wrong_file'
'status: restart DS running on port %s' \
% (DIRECTORY_INSTANCE_PORT)
<
call function="'StopDsWithScript'">
'location' : STAF_REMOTE_HOSTNAME ,
'dsHost' : DIRECTORY_INSTANCE_HOST ,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
<
call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
<!--- Check that DS started --> <
call function="'isAlive'">
'noOfMilliSeconds' : 2000
% (DIRECTORY_INSTANCE_DIR, OPENDSNAME)
if is_windows_platform(DIRECTORY_INSTANCE_HOST):
msg1 = 'The specified OpenDMK jar file'
msg2 = '\'%s\' could not be found.' % opendmkJarFile
msg3 = 'Verify that the value set in the opendmk-jarfile'
msg4 = 'configuration parameter of the SNMP connection handler'
msg5 = 'is the valid path to the
jdmkrt.jar file and that the'
msg6 = 'file is accessible'
msg = '%s %s %s %s %s %s' % (msg1, msg2, msg3, msg4, msg5, msg6)
'location' : STAF_REMOTE_HOSTNAME ,
'filename' : serverLogFile ,
'status: status when the server is started'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'searchString'">
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
'returnString' : returnString ,
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : community ,
'snmpStatus' : 'reqTimeout'
'status: restore value for opendmk-jarfile property'
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set opendmk-jarfile:%s' \
% SNMP_PROPERTIES['opendmk-jarfile']
'status: restart the SNMP Connection Handler'
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker SNMP Connection Handler status #@TestName status: check error message and status when the security-agent-file property is set to a #@TestPurpose Check error message and status when the security-agent-file property is set to a #@TestStep set security-agent-file property to a wrong #@TestStep restart the server #@TestStep check that an error message is displayed at #@TestStep check status using status command #@TestStep restore value for security-agent-file property #@TestStep disable the SNMP connection handler #@TestStep enable the SNMP connection handler #@TestResult Success if an error message is displayed and if the output of status is correct. <
testcase name="getTestCaseName ('status: status with a wrong security-agent-file value')">
<
call function="'testCase_Preamble'"/>
'status: set the security-agent-file to a wrong value'
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set security-agent-file:wrong_file'
'status: restart DS running on port %s' \
% (DIRECTORY_INSTANCE_PORT)
<
call function="'StopDsWithScript'">
'location' : STAF_REMOTE_HOSTNAME ,
'dsHost' : DIRECTORY_INSTANCE_HOST ,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
<
call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
<!--- Check that DS started --> <
call function="'isAlive'">
'noOfMilliSeconds' : 2000
msg1 = 'Cannot initialize the SNMP Connection Handler.'
msg2 = 'Please check the configuration attributes'
msg = '%s %s' % (msg1, msg2)
'location' : STAF_REMOTE_HOSTNAME ,
'filename' : serverLogFile ,
msg1 = 'You do not have the appropriated OpenDMK jar files to'
msg2 = 'enable the SNMP Connection Handler. Please go under'
msg4 = 'ds-cfg-opendmk-jarfile configuration parameter to set'
msg5 = 'the full path of the required
jdmkrt.jar file.'
msg6 = 'The SNMP connection Handler didn\'t started'
msg = '%s %s %s %s %s %s' % (msg1, msg2, msg3, msg4, msg5, msg6)
'location' : STAF_REMOTE_HOSTNAME ,
'filename' : serverLogFile ,
'status: status when the server is started'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'searchString'">
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
'returnString' : returnString ,
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : community ,
'snmpStatus' : 'reqTimeout'
'status: restore value for security-agent-file property'
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set security-agent-file:%s' \
% SNMP_PROPERTIES['security-agent-file']
'status: restart the SNMP Connection Handler'
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker SNMP Connection Handler status #@TestName status: check error message and status when the listen-port property is set to a wrong #@TestPurpose Check error message and status when the listen-port property is set to a wrong #@TestStep set listen-port property to a wrong value #@TestStep restart the server #@TestStep check that an error message is displayed at #@TestStep check status using status command #@TestStep restore value for listen-port property #@TestStep disable the SNMP connection handler #@TestStep enable the SNMP connection handler #@TestResult Success if an error message is displayed and if the output of status is correct. <
testcase name="getTestCaseName ('status: status with a wrong listen-port value')">
<
call function="'testCase_Preamble'"/>
<!-- This testcase is not relevant on Windows --> if is_windows_platform(STAF_REMOTE_HOSTNAME):
'status: set the listen-port to a wrong value'
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set listen-port:%s' \
% DEFAULT_PROPERTIES['listen-port']
'status: restart DS running on port %s' \
% (DIRECTORY_INSTANCE_PORT)
<
call function="'StopDsWithScript'">
'location' : STAF_REMOTE_HOSTNAME ,
'dsHost' : DIRECTORY_INSTANCE_HOST ,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
<
call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
<!--- Check that DS started --> <
call function="'isAlive'">
'noOfMilliSeconds' : 2000
msg1 = 'Cannot initialize the SNMP Connection Handler.'
msg2 = 'Please check the configuration attributes'
msg = '%s %s' % (msg1, msg2)
'location' : STAF_REMOTE_HOSTNAME ,
'filename' : serverLogFile ,
'status: status when the server is started'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'searchString'">
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
% DEFAULT_PROPERTIES['listen-port'] ,
'returnString' : returnString ,
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : community ,
'snmpStatus' : 'reqTimeout'
'status: restore value for listen-port property'
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set listen-port:%s' \
% SNMP_PROPERTIES['listen-port']
'status: restart the SNMP Connection Handler'
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
message>'This testcase is not relevant on Windows'</
message>
<
tcstatus result="'pass'"/>
<
call function="'testCase_Postamble'"/>
<
call function="'testSuite_Postamble'"/>