2528N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
2528N/A ! The contents of this file are subject to the terms of the 2528N/A ! Common Development and Distribution License, Version 1.0 only 2528N/A ! (the "License"). You may not use this file except in compliance 2528N/A ! You can obtain a copy of the license at 2528N/A ! See the License for the specific language governing permissions 2528N/A ! and limitations under the License. 2528N/A ! When distributing Covered Code, exclude this CDDL HEADER in each 2528N/A ! file and exclude the License file at 2528N/A ! add the following below this CDDL HEADER, with the fields enclosed 2528N/A ! by brackets "[]" replaced with your own identifying information: 2528N/A ! Portions Copyright [yyyy] [name of copyright owner] 2528N/A ! Copyright 2008 Sun Microsystems, Inc. 2528N/A ! Portions Copyright 2013 ForgeRock AS 2528N/A <
defaultcall function="ports"/>
2528N/A <!--- Test Suite information 2528N/A #@TestSuiteName Setup-Uninstall ports Tests 2528N/A #@TestSuitePurpose Test all port relative setup and uninstall 2528N/A options (port conflict, access right on port, #@TestSuiteID ports Tests #@TestGroup Setup-Uninstall CurrentTestPath['group'] = 'setup'
CurrentTestPath['suite'] = 'ports'
<
call function="'testSuite_Preamble'"/>
<
call function="'getFreePort'">
'host' : STAF_REMOTE_HOSTNAME,
<
script>PORTS_I1_PORT = STAXResult</
script>
<
call function="'getFreePort'">
'host' : STAF_REMOTE_HOSTNAME,
<
script>PORTS_I1_ADMIN_PORT = STAXResult</
script>
<
call function="'getFreePort'">
'host' : STAF_REMOTE_HOSTNAME,
<
script>PORTS_I2_PORT = STAXResult</
script>
'Got 3 free ports: %s, %s and %s' \
% (PORTS_I1_PORT, PORTS_I1_ADMIN_PORT, PORTS_I2_PORT)
<!--- Test Case information #@TestMarker Setup-Uninstall ports Tests #@TestName Setup-Uninstall: Ports: #@TestPurpose Setup a first instance to bind a port #@TestStep Setup a first instance to bind a port #@TestResult PASS if all steps ran without errors <
testcase name="getTestCaseName('bind-port')">
<
call function="'testCase_Preamble'"/>
<
message>'Ports: Setup a first instance to bind a port'</
message>
PORTS_I1_BASE = '%
s/
port_i1' % (OUT_GROUP)
PORTS_I1_ROOT = '%s/%s' % (PORTS_I1_BASE, OPENDSNAME)
<
message>'Prepare Open DS ZIP (in %s)' % PORTS_I1_ROOT</
message>
<
call function="'runSTAFCommand'">
{ 'name' : 'Create directory to contain I1',
'location' : STAF_REMOTE_HOSTNAME,
'arguments' : 'DIRECTORY %s FAILIFEXISTS' % PORTS_I1_BASE
<
call function="'checktestRC'">
'result' : 'FAIL to create directory',
<
call function="'runSTAFCommand'">
{ 'name' : 'Extract OpenDS ZIP file',
'location' : STAF_REMOTE_HOSTNAME,
'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
% (DIRECTORY_INSTANCE_DIR, ZIPNAME, PORTS_I1_BASE)
<
call function="'checktestRC'">
'result' : 'FAIL to unzip OpenDS ZIP file',
c = '%
s/
setup%s' % (PORTS_I1_ROOT, fileExt)
p.append('--cli --no-prompt --rootUserPassword kangourou %s' \
p.append('--ldapPort %s' % PORTS_I1_PORT)
p.append('--adminConnectorPort %s' % PORTS_I1_ADMIN_PORT)
<
message>'%s %s' % (c, p)</
message>
<
call function="'runCommand'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'name' : 'Setup a first instance to bind a port',
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker Setup-Uninstall ports Tests #@TestName Setup-Uninstall: Ports: #@TestID ldap-port-conflict #@TestPurpose Setup OpenDS, specifying a used LDAP port #@TestStep Setup OpenDS, specifying a used LDAP port #@TestResult PASS if all steps ran without errors <
testcase name="getTestCaseName('ldap-port-conflict')">
<
call function="'testCase_Preamble'"/>
<
message>'Ports: LDAP port conflict'</
message>
c = '%s/%
s/
setup%s' % (ODS_UNZIPPED, OPENDSNAME, fileExt)
p.append('--cli --no-prompt --rootUserPassword kangourou')
p.append('--ldapPort %s %s' % (PORTS_I1_PORT, licenseOption))
<
message>'%s %s' % (c, p)</
message>
<
call function="'runCommand'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'name' : 'Launch setup command with LDAP port conflict',
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker Setup-Uninstall ports Tests #@TestName Setup-Uninstall: Ports: #@TestID ldaps-port-conflict #@TestPurpose Setup OpenDS, specifying a used LDAPS port #@TestStep Setup OpenDS, specifying a used LDAPS port #@TestResult PASS if all steps ran without errors <
testcase name="getTestCaseName('ldaps-port-conflict')">
<
call function="'testCase_Preamble'"/>
<
message>'Ports: LDAPS port conflict'</
message>
<!-- Remove and recreate the unzipped instance --> <
call function="'runSTAFCommand'">
{ 'name' : 'Delete directory containing unzipped OpenDS',
'location' : STAF_REMOTE_HOSTNAME,
'arguments' : 'ENTRY %s RECURSE CONFIRM' % ODS_UNZIPPED
<
call function="'checktestRC'">
'result' : 'FAIL to remove files for this group at cleanup',
<
call function="'runSTAFCommand'">
{ 'name' : 'Create directory to contain unzipped OpenDS',
'location' : STAF_REMOTE_HOSTNAME,
'arguments' : 'DIRECTORY %s FAILIFEXISTS' % ODS_UNZIPPED
<
call function="'runSTAFCommand'">
{ 'name' : 'Extract OpenDS ZIP file',
'location' : STAF_REMOTE_HOSTNAME,
'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
% (DIRECTORY_INSTANCE_DIR, ZIPNAME, ODS_UNZIPPED)
<
call function="'checktestRC'">
'result' : 'FAIL to unzip OpenDS ZIP file',
c = '%s/%
s/
setup%s' % (ODS_UNZIPPED, OPENDSNAME, fileExt)
p.append('--cli --no-prompt --rootUserPassword kangourou')
p.append('--ldapPort %s' % PORTS_I2_PORT)
p.append('--ldapsPort %s' % PORTS_I1_PORT)
p.append('--generateSelfSignedCertificate %s' % licenseOption)
<
message>'%s %s' % (c, p)</
message>
<
call function="'runCommand'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'name' : 'Launch setup command with LDAPS port conflict',
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker Setup-Uninstall ports Tests #@TestName Setup-Uninstall: Ports: #@TestID jmx-port-conflict #@TestPurpose Setup OpenDS, specifying a used JMX port #@TestStep Setup OpenDS, specifying a used JMX port #@TestResult PASS if all steps ran without errors <
testcase name="getTestCaseName('jmx-port-conflict')">
<
call function="'testCase_Preamble'"/>
<
message>'Ports: JMX port conflict'</
message>
<!-- Remove and recreate the unzipped instance --> <
call function="'runSTAFCommand'">
{ 'name' : 'Delete directory containing unzipped OpenDS',
'location' : STAF_REMOTE_HOSTNAME,
'arguments' : 'ENTRY %s RECURSE CONFIRM' % ODS_UNZIPPED
<
call function="'checktestRC'">
'result' : 'FAIL to remove files for this group at cleanup',
<
call function="'runSTAFCommand'">
{ 'name' : 'Create directory to contain unzipped OpenDS',
'location' : STAF_REMOTE_HOSTNAME,
'arguments' : 'DIRECTORY %s FAILIFEXISTS' % ODS_UNZIPPED
<
call function="'runSTAFCommand'">
{ 'name' : 'Extract OpenDS ZIP file',
'location' : STAF_REMOTE_HOSTNAME,
'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
% (DIRECTORY_INSTANCE_DIR, ZIPNAME, ODS_UNZIPPED)
<
call function="'checktestRC'">
'result' : 'FAIL to unzip OpenDS ZIP file',
c = '%s/%
s/
setup%s' % (ODS_UNZIPPED, OPENDSNAME, fileExt)
p.append('--cli --no-prompt --rootUserPassword kangourou')
p.append('--ldapPort %s' % PORTS_I2_PORT)
p.append('--jmxPort %s %s' % (PORTS_I1_PORT, licenseOption))
<
message>'%s %s' % (c, p)</
message>
<
call function="'runCommand'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'name' : 'Launch setup command with JMX port conflict',
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker Setup-Uninstall ports Tests #@TestName Setup-Uninstall: Ports: ldap-port-conflict-nocheck #@TestID ldap-port-conflict-nocheck #@TestPurpose Setup OpenDS, disabling the LDAP port check #@TestStep Unzip OpenDS ZIP distribution Setup OpenDS with 'skipPortCheck' and 'doNotStart' #@TestResult PASS if all steps ran without errors <
testcase name="getTestCaseName('ldap-port-conflict-nocheck')">
PORTS_I2_ROOT = '%s/%s' % (PORTS_I2_BASE, OPENDSNAME)
<
call function="'testCase_Preamble'"/>
<
message>'Ports: '</
message>
<!-- 1. Setup options: baseDN baseDN sampleData --> <
message>'Prepare Open DS ZIP (in %s)' % PORTS_I2_ROOT</
message>
<
call function="'runSTAFCommand'">
{ 'name' : 'Create directory to contain I2',
'location' : STAF_REMOTE_HOSTNAME,
'arguments' : 'DIRECTORY %s FAILIFEXISTS' % PORTS_I2_BASE
<
call function="'checktestRC'">
'result' : 'FAIL to create directory',
<
call function="'runSTAFCommand'">
{ 'name' : 'Extract OpenDS ZIP file',
'location' : STAF_REMOTE_HOSTNAME,
'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
% (DIRECTORY_INSTANCE_DIR, ZIPNAME, PORTS_I2_BASE)
<
call function="'checktestRC'">
'result' : 'FAIL to unzip OpenDS ZIP file',
c = '%
s/
setup%s' % (PORTS_I2_ROOT, fileExt)
p.append('--cli --no-prompt --ldapPort %s' % PORTS_I1_PORT)
p.append('--rootUserPassword "kangourou" %s' % licenseOption)
p.append('--skipPortCheck --doNotStart --noPropertiesFile')
<
message>'%s %s' % (c, p)</
message>
<
call function="'runCommand'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'name' : 'Setup command for I2 (port conflict but nocheck)',
c = '%s/%
s/
start-ds%s' % (PORTS_I2_ROOT, fileFolder, fileExt)
<
message>'%s %s' % (c, p)</
message>
<
call function="'runCommand'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'name' : 'start DS (will raise port conflict)',
p.append('--quiet --forceOnError --remove-all')
p.append('--referencedHostName %s' % STAF_REMOTE_HOSTNAME)
<
message>'%s %s' % (c, p)</
message>
<
call function="'runCommand'">
{ 'location' : STAF_REMOTE_HOSTNAME,
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker Setup-Uninstall ports Tests #@TestName Setup-Uninstall: Ports: #@TestID ldap-port-unauthorized #@TestPurpose Setup OpenDS, specifying a forbidden LDAP port #@TestStep Setup OpenDS with forbidden port number #@TestResult PASS if all steps ran without errors <
testcase name="getTestCaseName('ldap-port-unauthorized')">
<
call function="'testCase_Preamble'"/>
<
message>'Ports: Unauthorized LDAP port'</
message>
<!-- Remove and recreate the unzipped instance --> <
call function="'runSTAFCommand'">
{ 'name' : 'Delete directory containing unzipped OpenDS',
'location' : STAF_REMOTE_HOSTNAME,
'arguments' : 'ENTRY %s RECURSE CONFIRM' % ODS_UNZIPPED
<
call function="'checktestRC'">
'result' : 'FAIL to remove files for this group at cleanup',
<
call function="'runSTAFCommand'">
{ 'name' : 'Create directory to contain unzipped OpenDS',
'location' : STAF_REMOTE_HOSTNAME,
'arguments' : 'DIRECTORY %s FAILIFEXISTS' % ODS_UNZIPPED
<
call function="'runSTAFCommand'">
{ 'name' : 'Extract OpenDS ZIP file',
'location' : STAF_REMOTE_HOSTNAME,
'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
% (DIRECTORY_INSTANCE_DIR, ZIPNAME, ODS_UNZIPPED)
<
call function="'checktestRC'">
'result' : 'FAIL to unzip OpenDS ZIP file',
<!-- This testcase is not relevant on Windows or as root user --> if is_windows_platform(STAF_REMOTE_HOSTNAME) or get_system_uid() == "root":
c = '%s/%
s/
setup%s' % (ODS_UNZIPPED, OPENDSNAME, fileExt)
p.append('--cli --no-prompt --rootUserPassword kangourou')
p.append('--ldapPort 1 %s' % licenseOption)
<
message>'%s %s' % (c, p)</
message>
<
call function="'runCommand'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'name' : 'Launch setup command with unauthorized LDAP port',
<
message>'This testcase is not relevant on Windows or as root user'</
message>
<
tcstatus result="'pass'"/>
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker Setup-Uninstall ports Tests #@TestName Setup-Uninstall: Ports: #@TestPurpose Uninstall the first instance #@TestStep Uninstall the first instance #@TestResult PASS if all steps ran without errors <
testcase name="getTestCaseName('uninstall')">
<
call function="'testCase_Preamble'"/>
<
message>'Ports: Uninstall the first instance'</
message>
PORTS_I1_BASE = '%
s/
port_i1' % (OUT_GROUP)
PORTS_I1_ROOT = '%s/%s' % (PORTS_I1_BASE, OPENDSNAME)
p.append('--quiet --forceOnError --remove-all')
p.append('--referencedHostName %s' % STAF_REMOTE_HOSTNAME)
<
message>'%s %s' % (c, p)</
message>
<
call function="'runCommand'">
{ 'location' : STAF_REMOTE_HOSTNAME,
<
call function="'testCase_Postamble'"/>
<
call function="'testSuite_Postamble'"/>