10139N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
10139N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
10139N/A<!--
12219N/A ! CDDL HEADER START
10139N/A !
10139N/A ! The contents of this file are subject to the terms of the
10139N/A ! Common Development and Distribution License, Version 1.0 only
17185N/A ! (the "License"). You may not use this file except in compliance
10139N/A ! with the License.
17176N/A !
17176N/A ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
17176N/A ! or http://forgerock.org/license/CDDLv1.0.html.
10139N/A ! See the License for the specific language governing permissions
10139N/A ! and limitations under the License.
15291N/A !
10139N/A ! When distributing Covered Code, include this CDDL HEADER in each
10615N/A ! file and include the License file at legal-notices/CDDLv1_0.txt.
17866N/A ! If applicable, add the following below this CDDL HEADER, with the
18442N/A ! fields enclosed by brackets "[]" replaced with your own identifying
10139N/A ! information:
10139N/A ! Portions Copyright [yyyy] [name of copyright owner]
10139N/A !
10139N/A ! CDDL HEADER END
17866N/A !
10794N/A ! Copyright 2008 Sun Microsystems, Inc.
10139N/A ! Portions Copyright 2013 ForgeRock AS
10794N/A ! -->
12773N/A<stax>
12773N/A
12773N/A <defaultcall function="ports"/>
10794N/A
10139N/A <function name="ports">
10640N/A
17989N/A <sequence>
18099N/A
16105N/A <!--- Test Suite information
18099N/A #@TestSuiteName Setup-Uninstall ports Tests
10861N/A #@TestSuitePurpose Test all port relative setup and uninstall
18099N/A options (port conflict, access right on port,
18466N/A ...)
18466N/A #@TestSuiteGroup ports
13379N/A #@TestSuiteID ports Tests
18099N/A #@TestGroup Setup-Uninstall
15219N/A #@TestScript ports.xml
18099N/A #@TestHTMLLink http://opends.dev.java.net/
16472N/A -->
18099N/A
16472N/A <script>
18099N/A if not CurrentTestPath.has_key('group'):
16690N/A CurrentTestPath['group'] = 'setup'
18099N/A CurrentTestPath['suite'] = 'ports'
10139N/A </script>
10139N/A
10139N/A <call function="'testSuite_Preamble'"/>
10139N/A
10139N/A <call function="'getFreePort'">
10139N/A {
10139N/A 'host' : STAF_REMOTE_HOSTNAME,
10139N/A 'port' : 2000,
10139N/A }
10139N/A </call>
10139N/A <script>PORTS_I1_PORT = STAXResult</script>
10139N/A
10139N/A <call function="'getFreePort'">
10139N/A {
10139N/A 'host' : STAF_REMOTE_HOSTNAME,
10139N/A 'port' : 4000,
10139N/A }
10139N/A </call>
10139N/A <script>PORTS_I1_ADMIN_PORT = STAXResult</script>
10139N/A
10139N/A <call function="'getFreePort'">
10139N/A {
10139N/A 'host' : STAF_REMOTE_HOSTNAME,
10139N/A 'port' : 3000,
10139N/A }
10139N/A </call>
10139N/A <script>PORTS_I2_PORT = STAXResult</script>
10139N/A
17891N/A <message>
17891N/A 'Got 3 free ports: %s, %s and %s' \
10139N/A % (PORTS_I1_PORT, PORTS_I1_ADMIN_PORT, PORTS_I2_PORT)
10139N/A </message>
10139N/A
10139N/A <!--- Test Case information
10139N/A #@TestMarker Setup-Uninstall ports Tests
10139N/A #@TestName Setup-Uninstall: Ports:
10139N/A bind-port
17891N/A #@TestID bind-port
17891N/A #@TestPurpose Setup a first instance to bind a port
10139N/A #@TestPreamble
10139N/A #@TestStep Setup a first instance to bind a port
10139N/A #@TestPostamble
10139N/A #@TestResult PASS if all steps ran without errors
10139N/A -->
10139N/A <testcase name="getTestCaseName('bind-port')">
10139N/A <sequence>
10139N/A
10139N/A <call function="'testCase_Preamble'"/>
10139N/A <message>'Ports: Setup a first instance to bind a port'</message>
10139N/A
10139N/A <script>
10139N/A PORTS_I1_BASE = '%s/port_i1' % (OUT_GROUP)
10139N/A PORTS_I1_ROOT = '%s/%s' % (PORTS_I1_BASE, OPENDSNAME)
10139N/A </script>
10139N/A
10139N/A <message>'Prepare Open DS ZIP (in %s)' % PORTS_I1_ROOT</message>
10139N/A
10139N/A <call function="'runSTAFCommand'">
10139N/A { 'name' : 'Create directory to contain I1',
10139N/A 'location' : STAF_REMOTE_HOSTNAME,
10139N/A 'service' : 'FS',
10139N/A 'request' : 'CREATE',
10139N/A 'arguments' : 'DIRECTORY %s FAILIFEXISTS' % PORTS_I1_BASE
10139N/A }
10139N/A </call>
10139N/A
10139N/A <call function="'checktestRC'">
10139N/A { 'returncode' : RC,
10139N/A 'expected' : 0,
10139N/A 'result' : 'FAIL to create directory',
10139N/A }
10794N/A </call>
12754N/A
10139N/A <call function="'runSTAFCommand'">
10139N/A { 'name' : 'Extract OpenDS ZIP file',
10139N/A 'location' : STAF_REMOTE_HOSTNAME,
11087N/A 'service' : 'ZIP',
18099N/A 'request' : 'UNZIP',
18099N/A 'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
18099N/A % (DIRECTORY_INSTANCE_DIR, ZIPNAME, PORTS_I1_BASE)
18466N/A }
16769N/A </call>
13306N/A
17866N/A <call function="'checktestRC'">
18099N/A { 'returncode' : RC,
18099N/A 'expected' : 0,
16998N/A 'result' : 'FAIL to unzip OpenDS ZIP file',
10139N/A }
10139N/A </call>
10139N/A
17891N/A <script>
17891N/A c = '%s/setup%s' % (PORTS_I1_ROOT, fileExt)
17891N/A p = []
10139N/A p.append('--cli --no-prompt --rootUserPassword kangourou %s' \
10139N/A % licenseOption)
10139N/A p.append('--ldapPort %s' % PORTS_I1_PORT)
10139N/A p.append('--adminConnectorPort %s' % PORTS_I1_ADMIN_PORT)
10139N/A p = ' '.join(p)
17891N/A </script>
10139N/A
17891N/A <message>'%s %s' % (c, p)</message>
17891N/A <call function="'runCommand'">
17891N/A { 'location' : STAF_REMOTE_HOSTNAME,
17891N/A 'name' : 'Setup a first instance to bind a port',
17891N/A 'command' : c,
10139N/A 'arguments' : p,
17891N/A 'path' : PORTS_I1_ROOT,
11344N/A 'expectedRC': 0,
11344N/A 'outputFile': '%s/ports-install-i1.txt' % OUT_GROUP,
11344N/A }
11344N/A </call>
11344N/A
10139N/A <call function="'testCase_Postamble'"/>
11994N/A </sequence>
11994N/A </testcase>
12773N/A
12773N/A <!--- Test Case information
12773N/A #@TestMarker Setup-Uninstall ports Tests
12773N/A #@TestName Setup-Uninstall: Ports:
12773N/A ldap-port-conflict
17081N/A #@TestID ldap-port-conflict
10139N/A #@TestPurpose Setup OpenDS, specifying a used LDAP port
10139N/A #@TestPreamble
10139N/A #@TestStep Setup OpenDS, specifying a used LDAP port
10139N/A Check for error
10139N/A #@TestPostamble
10139N/A #@TestResult PASS if all steps ran without errors
10139N/A -->
10139N/A <testcase name="getTestCaseName('ldap-port-conflict')">
10139N/A <sequence>
10139N/A
10139N/A <call function="'testCase_Preamble'"/>
10139N/A <message>'Ports: LDAP port conflict'</message>
10139N/A
10139N/A <script>
11826N/A c = '%s/%s/setup%s' % (ODS_UNZIPPED, OPENDSNAME, fileExt)
11344N/A p = []
16786N/A p.append('--cli --no-prompt --rootUserPassword kangourou')
17866N/A p.append('--ldapPort %s %s' % (PORTS_I1_PORT, licenseOption))
17866N/A p = ' '.join(p)
10139N/A </script>
17891N/A
10139N/A <message>'%s %s' % (c, p)</message>
10139N/A <call function="'runCommand'">
10139N/A { 'location' : STAF_REMOTE_HOSTNAME,
10139N/A 'name' : 'Launch setup command with LDAP port conflict',
10139N/A 'command' : c,
10139N/A 'arguments' : p,
10139N/A 'path' : ODS_UNZIPPED,
10139N/A 'expectedRC': 2,
10139N/A 'outputFile': '%s/ports-setup-ldap-conflict.txt' % OUT_GROUP,
10139N/A }
10139N/A </call>
10139N/A
10139N/A <call function="'testCase_Postamble'"/>
10139N/A </sequence>
10139N/A </testcase>
10139N/A
10139N/A
10139N/A <!--- Test Case information
10139N/A #@TestMarker Setup-Uninstall ports Tests
10139N/A #@TestName Setup-Uninstall: Ports:
10139N/A ldaps-port-conflict
10139N/A #@TestID ldaps-port-conflict
10139N/A #@TestPurpose Setup OpenDS, specifying a used LDAPS port
10139N/A #@TestPreamble
10139N/A #@TestStep Setup OpenDS, specifying a used LDAPS port
10139N/A Check for error
10139N/A #@TestPostamble
10139N/A #@TestResult PASS if all steps ran without errors
10139N/A -->
10139N/A <testcase name="getTestCaseName('ldaps-port-conflict')">
10139N/A <sequence>
10139N/A
10139N/A <call function="'testCase_Preamble'"/>
10139N/A <message>'Ports: LDAPS port conflict'</message>
10139N/A
10139N/A <!-- Remove and recreate the unzipped instance -->
10139N/A <call function="'runSTAFCommand'">
12402N/A { 'name' : 'Delete directory containing unzipped OpenDS',
10139N/A 'location' : STAF_REMOTE_HOSTNAME,
10139N/A 'service' : 'FS',
10139N/A 'request' : 'DELETE',
10139N/A 'arguments' : 'ENTRY %s RECURSE CONFIRM' % ODS_UNZIPPED
10139N/A }
10139N/A </call>
10139N/A <call function="'checktestRC'">
10139N/A { 'returncode' : RC,
10139N/A 'expected' : 0,
10139N/A 'result' : 'FAIL to remove files for this group at cleanup',
10139N/A }
10139N/A </call>
10139N/A <call function="'runSTAFCommand'">
10139N/A { 'name' : 'Create directory to contain unzipped OpenDS',
10139N/A 'location' : STAF_REMOTE_HOSTNAME,
10139N/A 'service' : 'FS',
10139N/A 'request' : 'CREATE',
10139N/A 'arguments' : 'DIRECTORY %s FAILIFEXISTS' % ODS_UNZIPPED
10139N/A }
10139N/A </call>
10139N/A <call function="'runSTAFCommand'">
10139N/A { 'name' : 'Extract OpenDS ZIP file',
10139N/A 'location' : STAF_REMOTE_HOSTNAME,
10139N/A 'service' : 'ZIP',
10139N/A 'request' : 'UNZIP',
10139N/A 'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
10139N/A % (DIRECTORY_INSTANCE_DIR, ZIPNAME, ODS_UNZIPPED)
18466N/A }
18466N/A </call>
18442N/A <call function="'checktestRC'">
18442N/A { 'returncode' : RC,
18397N/A 'expected' : 0,
18397N/A 'result' : 'FAIL to unzip OpenDS ZIP file',
18325N/A }
18325N/A </call>
18325N/A
18278N/A <script>
18278N/A c = '%s/%s/setup%s' % (ODS_UNZIPPED, OPENDSNAME, fileExt)
18259N/A p = []
18259N/A p.append('--cli --no-prompt --rootUserPassword kangourou')
18207N/A p.append('--ldapPort %s' % PORTS_I2_PORT)
18207N/A p.append('--ldapsPort %s' % PORTS_I1_PORT)
18207N/A p.append('--generateSelfSignedCertificate %s' % licenseOption)
18207N/A p = ' '.join(p)
18099N/A </script>
18099N/A
18091N/A <message>'%s %s' % (c, p)</message>
18093N/A <call function="'runCommand'">
18093N/A { 'location' : STAF_REMOTE_HOSTNAME,
18091N/A 'name' : 'Launch setup command with LDAPS port conflict',
18091N/A 'command' : c,
17985N/A 'arguments' : p,
17989N/A 'path' : ODS_UNZIPPED,
17989N/A 'expectedRC': 2,
17985N/A 'outputFile': '%s/ports-setup-ldaps-conflict.txt' % OUT_GROUP,
17975N/A }
17975N/A </call>
17897N/A
17897N/A <call function="'testCase_Postamble'"/>
17891N/A </sequence>
17891N/A </testcase>
17891N/A
17891N/A <!--- Test Case information
17866N/A #@TestMarker Setup-Uninstall ports Tests
17866N/A #@TestName Setup-Uninstall: Ports:
17866N/A jmx-port-conflict
17866N/A #@TestID jmx-port-conflict
17866N/A #@TestPurpose Setup OpenDS, specifying a used JMX port
17554N/A #@TestPreamble
17554N/A #@TestStep Setup OpenDS, specifying a used JMX port
17481N/A Check for error
17481N/A #@TestPostamble
17358N/A #@TestResult PASS if all steps ran without errors
17358N/A -->
17259N/A <testcase name="getTestCaseName('jmx-port-conflict')">
17259N/A <sequence>
17081N/A
17081N/A <call function="'testCase_Preamble'"/>
16998N/A <message>'Ports: JMX port conflict'</message>
16998N/A
16976N/A <!-- Remove and recreate the unzipped instance -->
16976N/A <call function="'runSTAFCommand'">
16977N/A { 'name' : 'Delete directory containing unzipped OpenDS',
16918N/A 'location' : STAF_REMOTE_HOSTNAME,
16918N/A 'service' : 'FS',
16786N/A 'request' : 'DELETE',
16786N/A 'arguments' : 'ENTRY %s RECURSE CONFIRM' % ODS_UNZIPPED
16769N/A }
16769N/A </call>
16771N/A <call function="'checktestRC'">
16771N/A { 'returncode' : RC,
16690N/A 'expected' : 0,
16690N/A 'result' : 'FAIL to remove files for this group at cleanup',
16684N/A }
16684N/A </call>
16684N/A <call function="'runSTAFCommand'">
16676N/A { 'name' : 'Create directory to contain unzipped OpenDS',
16676N/A 'location' : STAF_REMOTE_HOSTNAME,
16685N/A 'service' : 'FS',
16640N/A 'request' : 'CREATE',
16640N/A 'arguments' : 'DIRECTORY %s FAILIFEXISTS' % ODS_UNZIPPED
16640N/A }
16640N/A </call>
16614N/A <call function="'runSTAFCommand'">
16614N/A { 'name' : 'Extract OpenDS ZIP file',
16614N/A 'location' : STAF_REMOTE_HOSTNAME,
16614N/A 'service' : 'ZIP',
16560N/A 'request' : 'UNZIP',
16560N/A 'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
16560N/A % (DIRECTORY_INSTANCE_DIR, ZIPNAME, ODS_UNZIPPED)
16560N/A }
16560N/A </call>
16505N/A <call function="'checktestRC'">
16505N/A { 'returncode' : RC,
16486N/A 'expected' : 0,
16486N/A 'result' : 'FAIL to unzip OpenDS ZIP file',
16442N/A }
16442N/A </call>
16442N/A
16442N/A <script>
16436N/A c = '%s/%s/setup%s' % (ODS_UNZIPPED, OPENDSNAME, fileExt)
16436N/A p = []
16436N/A p.append('--cli --no-prompt --rootUserPassword kangourou')
16436N/A p.append('--ldapPort %s' % PORTS_I2_PORT)
16382N/A p.append('--jmxPort %s %s' % (PORTS_I1_PORT, licenseOption))
16382N/A p = ' '.join(p)
16356N/A </script>
16356N/A
16347N/A <message>'%s %s' % (c, p)</message>
16347N/A <call function="'runCommand'">
16347N/A { 'location' : STAF_REMOTE_HOSTNAME,
16155N/A 'name' : 'Launch setup command with JMX port conflict',
16155N/A 'command' : c,
16026N/A 'arguments' : p,
16026N/A 'path' : ODS_UNZIPPED,
15858N/A 'expectedRC': 2,
15858N/A 'outputFile': '%s/ports-setup-jmx-conflict.txt' % OUT_GROUP,
15759N/A }
15759N/A </call>
15700N/A
15700N/A <call function="'testCase_Postamble'"/>
15693N/A </sequence>
15693N/A </testcase>
15624N/A
15624N/A <!--- Test Case information
15528N/A #@TestMarker Setup-Uninstall ports Tests
15528N/A #@TestName Setup-Uninstall: Ports:
15528N/A ldap-port-conflict-nocheck
15528N/A #@TestID ldap-port-conflict-nocheck
15528N/A #@TestPurpose Setup OpenDS, disabling the LDAP port check
15472N/A #@TestPreamble
15474N/A #@TestStep Unzip OpenDS ZIP distribution
15474N/A Setup OpenDS with 'skipPortCheck' and 'doNotStart'
15472N/A options
15472N/A Uninstall OpenDS
15449N/A #@TestPostamble
15449N/A #@TestResult PASS if all steps ran without errors
15448N/A -->
15448N/A <testcase name="getTestCaseName('ldap-port-conflict-nocheck')">
15301N/A <sequence>
15301N/A
15291N/A <script>
15291N/A PORTS_I2_BASE = '%s/ports_i2' % (OUT_GROUP)
15275N/A PORTS_I2_ROOT = '%s/%s' % (PORTS_I2_BASE, OPENDSNAME)
15275N/A </script>
15219N/A
15219N/A
14503N/A <call function="'testCase_Preamble'"/>
14503N/A <message>'Ports: '</message>
14464N/A
14464N/A <!-- 1. Setup options: baseDN baseDN sampleData -->
14420N/A <message>'Prepare Open DS ZIP (in %s)' % PORTS_I2_ROOT</message>
14420N/A
14420N/A <call function="'runSTAFCommand'">
14185N/A { 'name' : 'Create directory to contain I2',
14185N/A 'location' : STAF_REMOTE_HOSTNAME,
14123N/A 'service' : 'FS',
14123N/A 'request' : 'CREATE',
13925N/A 'arguments' : 'DIRECTORY %s FAILIFEXISTS' % PORTS_I2_BASE
13925N/A }
13932N/A </call>
13754N/A
13754N/A <call function="'checktestRC'">
13754N/A { 'returncode' : RC,
13644N/A 'expected' : 0,
13644N/A 'result' : 'FAIL to create directory',
13644N/A }
13416N/A </call>
13416N/A
13416N/A <call function="'runSTAFCommand'">
13379N/A { 'name' : 'Extract OpenDS ZIP file',
13313N/A 'location' : STAF_REMOTE_HOSTNAME,
13313N/A 'service' : 'ZIP',
13300N/A 'request' : 'UNZIP',
13300N/A 'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
13300N/A % (DIRECTORY_INSTANCE_DIR, ZIPNAME, PORTS_I2_BASE)
13103N/A }
13103N/A </call>
12988N/A
12988N/A <call function="'checktestRC'">
12972N/A { 'returncode' : RC,
12972N/A 'expected' : 0,
12571N/A 'result' : 'FAIL to unzip OpenDS ZIP file',
12571N/A }
12488N/A </call>
12571N/A
12466N/A <script>
12466N/A c = '%s/setup%s' % (PORTS_I2_ROOT, fileExt)
12413N/A p = []
12413N/A p.append('--cli --no-prompt --ldapPort %s' % PORTS_I1_PORT)
12413N/A p.append('--rootUserPassword "kangourou" %s' % licenseOption)
12402N/A p.append('--skipPortCheck --doNotStart --noPropertiesFile')
12402N/A p = ' '.join(p)
12402N/A </script>
12402N/A
12402N/A <message>'%s %s' % (c, p)</message>
12387N/A <call function="'runCommand'">
12387N/A { 'location' : STAF_REMOTE_HOSTNAME,
12370N/A 'name' : 'Setup command for I2 (port conflict but nocheck)',
12370N/A 'command' : c,
12308N/A 'arguments' : p,
12308N/A 'path' : PORTS_I2_ROOT,
12308N/A 'expectedRC': 0,
12288N/A 'outputFile': '%s/ports-setup-confl-nocheck-i2.txt' % OUT_GROUP,
12288N/A }
12219N/A </call>
12219N/A
12071N/A <script>
12071N/A c = '%s/%s/start-ds%s' % (PORTS_I2_ROOT, fileFolder, fileExt)
11922N/A p = []
11922N/A p = ' '.join(p)
11828N/A </script>
11828N/A
11826N/A <message>'%s %s' % (c, p)</message>
11826N/A <call function="'runCommand'">
11819N/A { 'location' : STAF_REMOTE_HOSTNAME,
11819N/A 'name' : 'start DS (will raise port conflict)',
11416N/A 'command' : c,
11416N/A 'arguments' : p,
11344N/A 'path' : PORTS_I2_ROOT,
11344N/A 'expectedRC': 1,
11253N/A 'outputFile': '%s/ports-start-conflict-i2.txt' % OUT_GROUP,
11253N/A }
11183N/A </call>
11183N/A
11172N/A <script>
11172N/A c = '%s/uninstall%s' % (PORTS_I2_ROOT, fileExt)
11120N/A p = []
11120N/A p.append('--cli --no-prompt')
11087N/A p.append('--quiet --forceOnError --remove-all')
11087N/A p.append('--referencedHostName %s' % STAF_REMOTE_HOSTNAME)
11067N/A p = ' '.join(p)
11067N/A </script>
10986N/A
10986N/A <message>'%s %s' % (c, p)</message>
10980N/A <call function="'runCommand'">
10980N/A { 'location' : STAF_REMOTE_HOSTNAME,
10917N/A 'name' : 'Uninstall I2',
10917N/A 'command' : c,
10903N/A 'arguments' : p,
10903N/A 'path' : PORTS_I2_ROOT,
10891N/A 'expectedRC': 0,
10891N/A 'outputFile': '%s/ports-uninstall-conflict-i2.txt' % OUT_GROUP,
10861N/A }
10861N/A </call>
10861N/A <call function="'testCase_Postamble'"/>
10820N/A
10820N/A
10794N/A </sequence>
10794N/A </testcase>
10742N/A
10742N/A
10742N/A <!--- Test Case information
10704N/A #@TestMarker Setup-Uninstall ports Tests
10704N/A #@TestName Setup-Uninstall: Ports:
10640N/A ldap-port-unauthorized
10640N/A #@TestID ldap-port-unauthorized
10640N/A #@TestPurpose Setup OpenDS, specifying a forbidden LDAP port
10613N/A #@TestPreamble
10615N/A #@TestStep Setup OpenDS with forbidden port number
10535N/A Check for error
10535N/A #@TestPostamble
10476N/A #@TestResult PASS if all steps ran without errors
10476N/A -->
10476N/A <testcase name="getTestCaseName('ldap-port-unauthorized')">
10436N/A <sequence>
10438N/A
10438N/A <call function="'testCase_Preamble'"/>
10438N/A <message>'Ports: Unauthorized LDAP port'</message>
10436N/A
10436N/A <!-- Remove and recreate the unzipped instance -->
10418N/A <call function="'runSTAFCommand'">
10418N/A { 'name' : 'Delete directory containing unzipped OpenDS',
10418N/A 'location' : STAF_REMOTE_HOSTNAME,
10418N/A 'service' : 'FS',
10418N/A 'request' : 'DELETE',
10418N/A 'arguments' : 'ENTRY %s RECURSE CONFIRM' % ODS_UNZIPPED
10339N/A }
10339N/A </call>
10283N/A <call function="'checktestRC'">
10284N/A { 'returncode' : RC,
10169N/A 'expected' : 0,
10169N/A 'result' : 'FAIL to remove files for this group at cleanup',
10139N/A }
10139N/A </call>
10139N/A <call function="'runSTAFCommand'">
10139N/A { 'name' : 'Create directory to contain unzipped OpenDS',
10139N/A 'location' : STAF_REMOTE_HOSTNAME,
10139N/A 'service' : 'FS',
10139N/A 'request' : 'CREATE',
10139N/A 'arguments' : 'DIRECTORY %s FAILIFEXISTS' % ODS_UNZIPPED
10139N/A }
10139N/A </call>
10139N/A <call function="'runSTAFCommand'">
10139N/A { 'name' : 'Extract OpenDS ZIP file',
10139N/A 'location' : STAF_REMOTE_HOSTNAME,
10139N/A 'service' : 'ZIP',
10139N/A 'request' : 'UNZIP',
10139N/A 'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
10139N/A % (DIRECTORY_INSTANCE_DIR, ZIPNAME, ODS_UNZIPPED)
10139N/A }
10139N/A </call>
10139N/A <call function="'checktestRC'">
10139N/A { 'returncode' : RC,
10139N/A 'expected' : 0,
10139N/A 'result' : 'FAIL to unzip OpenDS ZIP file',
10139N/A }
10139N/A </call>
10139N/A
10139N/A <!-- This testcase is not relevant on Windows or as root user -->
10139N/A <script>
10139N/A from java.lang import System
10139N/A if is_windows_platform(STAF_REMOTE_HOSTNAME) or get_system_uid() == "root":
10139N/A skip=1
10139N/A else:
10139N/A skip=0
10139N/A </script>
10139N/A
10139N/A <if expr="skip == 0">
10139N/A <sequence>
10139N/A <script>
10139N/A c = '%s/%s/setup%s' % (ODS_UNZIPPED, OPENDSNAME, fileExt)
10139N/A p = []
10139N/A p.append('--cli --no-prompt --rootUserPassword kangourou')
10139N/A p.append('--ldapPort 1 %s' % licenseOption)
10139N/A p = ' '.join(p)
10139N/A </script>
10139N/A
10139N/A <message>'%s %s' % (c, p)</message>
10535N/A <call function="'runCommand'">
10139N/A { 'location' : STAF_REMOTE_HOSTNAME,
10139N/A 'name' : 'Launch setup command with unauthorized LDAP port',
10139N/A 'command' : c,
10139N/A 'arguments' : p,
10139N/A 'path' : ODS_UNZIPPED,
10139N/A 'expectedRC': 2,
10139N/A 'outputFile': '%s/ports-unauthorized-ldap.txt' % OUT_GROUP,
10139N/A }
10139N/A </call>
10139N/A </sequence>
10139N/A <else>
10139N/A <sequence>
10139N/A <message>'This testcase is not relevant on Windows or as root user'</message>
10139N/A <tcstatus result="'pass'"/>
10139N/A </sequence>
10139N/A </else>
10139N/A </if>
10139N/A
10139N/A <call function="'testCase_Postamble'"/>
10139N/A </sequence>
10139N/A </testcase>
10139N/A
10139N/A <!--- Test Case information
10139N/A #@TestMarker Setup-Uninstall ports Tests
10139N/A #@TestName Setup-Uninstall: Ports:
10139N/A uninstall
10139N/A #@TestID uninstall
10139N/A #@TestPurpose Uninstall the first instance
10139N/A #@TestPreamble
10139N/A #@TestStep Uninstall the first instance
10139N/A #@TestPostamble
10139N/A #@TestResult PASS if all steps ran without errors
10139N/A -->
10139N/A <testcase name="getTestCaseName('uninstall')">
10139N/A <sequence>
10139N/A
10139N/A <call function="'testCase_Preamble'"/>
10139N/A <message>'Ports: Uninstall the first instance'</message>
10139N/A
10139N/A <script>
10139N/A PORTS_I1_BASE = '%s/port_i1' % (OUT_GROUP)
10139N/A PORTS_I1_ROOT = '%s/%s' % (PORTS_I1_BASE, OPENDSNAME)
10139N/A </script>
10139N/A
10139N/A <script>
10139N/A c = '%s/uninstall%s' % (PORTS_I1_ROOT, fileExt)
10139N/A p = []
10139N/A p.append('--cli --no-prompt')
10139N/A p.append('--quiet --forceOnError --remove-all')
10139N/A p.append('--referencedHostName %s' % STAF_REMOTE_HOSTNAME)
10139N/A p = ' '.join(p)
10139N/A </script>
10139N/A
10139N/A <message>'%s %s' % (c, p)</message>
10139N/A <call function="'runCommand'">
10139N/A { 'location' : STAF_REMOTE_HOSTNAME,
10139N/A 'name' : 'Uninstall I1',
10139N/A 'command' : c,
10139N/A 'arguments' : p,
10139N/A 'path' : PORTS_I1_ROOT,
10139N/A 'expectedRC': 0,
10139N/A 'outputFile': '%s/ports-uninstall-i1.txt' % OUT_GROUP,
10139N/A }
10139N/A </call>
10139N/A
10139N/A <call function="'testCase_Postamble'"/>
10139N/A </sequence>
10139N/A </testcase>
10139N/A
10139N/A <call function="'testSuite_Postamble'"/>
10139N/A
10139N/A </sequence>
10139N/A
10139N/A </function>
10139N/A
10139N/A</stax>
10139N/A