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