3612N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
3612N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
3612N/A<!--
3612N/A ! CDDL HEADER START
3612N/A !
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 ! with the License.
3612N/A !
3612N/A ! You can obtain a copy of the license at
3612N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
3612N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
3612N/A ! See the License for the specific language governing permissions
3612N/A ! and limitations under the License.
3612N/A !
3612N/A ! When distributing Covered Code, exclude this CDDL HEADER in each
3612N/A ! file and exclude the License file at
3612N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
3612N/A ! add the following below this CDDL HEADER, with the fields enclosed
3612N/A ! by brackets "[]" replaced with your own identifying information:
3612N/A ! Portions Copyright [yyyy] [name of copyright owner]
3612N/A !
3612N/A ! CDDL HEADER END
3612N/A !
3612N/A ! Copyright 2008 Sun Microsystems, Inc.
6035N/A ! Portions Copyright 2013 ForgeRock AS
3612N/A ! -->
3612N/A<stax>
3612N/A
3612N/A <defaultcall function="ports"/>
3612N/A
3612N/A <function name="ports">
3612N/A
3612N/A <sequence>
3612N/A
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 ...)
3612N/A #@TestSuiteGroup ports
3612N/A #@TestSuiteID ports Tests
3612N/A #@TestGroup Setup-Uninstall
3612N/A #@TestScript ports.xml
3612N/A #@TestHTMLLink http://opends.dev.java.net/
3612N/A -->
3612N/A
3612N/A <script>
3612N/A if not CurrentTestPath.has_key('group'):
3612N/A CurrentTestPath['group'] = 'setup'
3612N/A CurrentTestPath['suite'] = 'ports'
3612N/A </script>
3612N/A
3612N/A <call function="'testSuite_Preamble'"/>
3612N/A
3612N/A <call function="'getFreePort'">
3612N/A {
3612N/A 'host' : STAF_REMOTE_HOSTNAME,
3949N/A 'port' : 2000,
3612N/A }
3612N/A </call>
3949N/A <script>PORTS_I1_PORT = STAXResult</script>
3612N/A
3612N/A <call function="'getFreePort'">
3612N/A {
3612N/A 'host' : STAF_REMOTE_HOSTNAME,
3612N/A 'port' : 4000,
3612N/A }
3612N/A </call>
3949N/A <script>PORTS_I1_ADMIN_PORT = STAXResult</script>
3949N/A
3949N/A <call function="'getFreePort'">
3949N/A {
3949N/A 'host' : STAF_REMOTE_HOSTNAME,
3949N/A 'port' : 3000,
3949N/A }
3949N/A </call>
3949N/A <script>PORTS_I2_PORT = STAXResult</script>
3612N/A
3612N/A <message>
3949N/A 'Got 3 free ports: %s, %s and %s' \
3949N/A % (PORTS_I1_PORT, PORTS_I1_ADMIN_PORT, PORTS_I2_PORT)
3612N/A </message>
3612N/A
3949N/A <!--- Test Case information
3949N/A #@TestMarker Setup-Uninstall ports Tests
3949N/A #@TestName Setup-Uninstall: Ports:
3949N/A bind-port
3949N/A #@TestID bind-port
3949N/A #@TestPurpose Setup a first instance to bind a port
3949N/A #@TestPreamble
3949N/A #@TestStep Setup a first instance to bind a port
3949N/A #@TestPostamble
3949N/A #@TestResult PASS if all steps ran without errors
3949N/A -->
3949N/A <testcase name="getTestCaseName('bind-port')">
3949N/A <sequence>
3949N/A
3949N/A <call function="'testCase_Preamble'"/>
3949N/A <message>'Ports: Setup a first instance to bind a port'</message>
3949N/A
3949N/A <script>
3949N/A PORTS_I1_BASE = '%s/port_i1' % (OUT_GROUP)
3949N/A PORTS_I1_ROOT = '%s/%s' % (PORTS_I1_BASE, OPENDSNAME)
3949N/A </script>
3949N/A
3949N/A <message>'Prepare Open DS ZIP (in %s)' % PORTS_I1_ROOT</message>
3949N/A
3949N/A <call function="'runSTAFCommand'">
3949N/A { 'name' : 'Create directory to contain I1',
3949N/A 'location' : STAF_REMOTE_HOSTNAME,
3949N/A 'service' : 'FS',
3949N/A 'request' : 'CREATE',
3949N/A 'arguments' : 'DIRECTORY %s FAILIFEXISTS' % PORTS_I1_BASE
3949N/A }
3949N/A </call>
3949N/A
3949N/A <call function="'checktestRC'">
3949N/A { 'returncode' : RC,
3949N/A 'expected' : 0,
3949N/A 'result' : 'FAIL to create directory',
3949N/A }
3949N/A </call>
3949N/A
3949N/A <call function="'runSTAFCommand'">
3949N/A { 'name' : 'Extract OpenDS ZIP file',
3949N/A 'location' : STAF_REMOTE_HOSTNAME,
3949N/A 'service' : 'ZIP',
3949N/A 'request' : 'UNZIP',
3949N/A 'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
3949N/A % (DIRECTORY_INSTANCE_DIR, ZIPNAME, PORTS_I1_BASE)
3949N/A }
3949N/A </call>
3949N/A
3949N/A <call function="'checktestRC'">
3949N/A { 'returncode' : RC,
3949N/A 'expected' : 0,
3949N/A 'result' : 'FAIL to unzip OpenDS ZIP file',
3949N/A }
3949N/A </call>
3949N/A
3949N/A <script>
3949N/A c = '%s/setup%s' % (PORTS_I1_ROOT, fileExt)
3949N/A p = []
3949N/A p.append('--cli --no-prompt --rootUserPassword kangourou')
3949N/A p.append('--ldapPort %s' % PORTS_I1_PORT)
3949N/A p.append('--adminConnectorPort %s' % PORTS_I1_ADMIN_PORT)
3949N/A p = ' '.join(p)
3949N/A </script>
3612N/A
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 'command' : c,
3949N/A 'arguments' : p,
3949N/A 'path' : PORTS_I1_ROOT,
3949N/A 'expectedRC': 0,
3949N/A 'outputFile': '%s/ports-install-i1.txt' % OUT_GROUP,
3949N/A }
3949N/A </call>
3949N/A
3949N/A <call function="'testCase_Postamble'"/>
3949N/A </sequence>
3949N/A </testcase>
3949N/A
3612N/A <!--- Test Case information
3612N/A #@TestMarker Setup-Uninstall ports Tests
3612N/A #@TestName Setup-Uninstall: Ports:
3612N/A ldap-port-conflict
3612N/A #@TestID ldap-port-conflict
3612N/A #@TestPurpose Setup OpenDS, specifying a used LDAP port
3612N/A #@TestPreamble
3612N/A #@TestStep Setup OpenDS, specifying a used LDAP port
3612N/A Check for error
3612N/A #@TestPostamble
3612N/A #@TestResult PASS if all steps ran without errors
3612N/A -->
3612N/A <testcase name="getTestCaseName('ldap-port-conflict')">
3612N/A <sequence>
3612N/A
3612N/A <call function="'testCase_Preamble'"/>
3612N/A <message>'Ports: LDAP port conflict'</message>
3612N/A
3612N/A <script>
3612N/A c = '%s/%s/setup%s' % (ODS_UNZIPPED, OPENDSNAME, fileExt)
3612N/A p = []
3612N/A p.append('--cli --no-prompt --rootUserPassword kangourou')
3949N/A p.append('--ldapPort %s' % PORTS_I1_PORT)
3612N/A p = ' '.join(p)
3612N/A </script>
3612N/A
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 'command' : c,
3612N/A 'arguments' : p,
3612N/A 'path' : ODS_UNZIPPED,
3612N/A 'expectedRC': 2,
3612N/A 'outputFile': '%s/ports-setup-ldap-conflict.txt' % OUT_GROUP,
3612N/A }
3612N/A </call>
3612N/A
3612N/A <call function="'testCase_Postamble'"/>
3612N/A </sequence>
3612N/A </testcase>
3612N/A
3612N/A
3612N/A <!--- Test Case information
3612N/A #@TestMarker Setup-Uninstall ports Tests
3612N/A #@TestName Setup-Uninstall: Ports:
3612N/A ldaps-port-conflict
3612N/A #@TestID ldaps-port-conflict
3612N/A #@TestPurpose Setup OpenDS, specifying a used LDAPS port
3612N/A #@TestPreamble
3612N/A #@TestStep Setup OpenDS, specifying a used LDAPS port
3612N/A Check for error
3612N/A #@TestPostamble
3612N/A #@TestResult PASS if all steps ran without errors
3612N/A -->
3612N/A <testcase name="getTestCaseName('ldaps-port-conflict')">
3612N/A <sequence>
3612N/A
3612N/A <call function="'testCase_Preamble'"/>
3612N/A <message>'Ports: LDAPS port conflict'</message>
3612N/A
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 'service' : 'FS',
6035N/A 'request' : 'DELETE',
6035N/A 'arguments' : 'ENTRY %s RECURSE CONFIRM' % ODS_UNZIPPED
6035N/A }
6035N/A </call>
6035N/A <call function="'checktestRC'">
6035N/A { 'returncode' : RC,
6035N/A 'expected' : 0,
6035N/A 'result' : 'FAIL to remove files for this group at cleanup',
6035N/A }
6035N/A </call>
6035N/A <call function="'runSTAFCommand'">
6035N/A { 'name' : 'Create directory to contain unzipped OpenDS',
6035N/A 'location' : STAF_REMOTE_HOSTNAME,
6035N/A 'service' : 'FS',
6035N/A 'request' : 'CREATE',
6035N/A 'arguments' : 'DIRECTORY %s FAILIFEXISTS' % ODS_UNZIPPED
6035N/A }
6035N/A </call>
6035N/A <call function="'runSTAFCommand'">
6035N/A { 'name' : 'Extract OpenDS ZIP file',
6035N/A 'location' : STAF_REMOTE_HOSTNAME,
6035N/A 'service' : 'ZIP',
6035N/A 'request' : 'UNZIP',
6035N/A 'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
6035N/A % (DIRECTORY_INSTANCE_DIR, ZIPNAME, ODS_UNZIPPED)
6035N/A }
6035N/A </call>
6035N/A <call function="'checktestRC'">
6035N/A { 'returncode' : RC,
6035N/A 'expected' : 0,
6035N/A 'result' : 'FAIL to unzip OpenDS ZIP file',
6035N/A }
6035N/A </call>
6035N/A
3612N/A <script>
3612N/A c = '%s/%s/setup%s' % (ODS_UNZIPPED, OPENDSNAME, fileExt)
3612N/A p = []
3612N/A p.append('--cli --no-prompt --rootUserPassword kangourou')
3949N/A p.append('--ldapPort %s' % PORTS_I2_PORT)
3949N/A p.append('--ldapsPort %s' % PORTS_I1_PORT)
3612N/A p.append('--generateSelfSignedCertificate')
3612N/A p = ' '.join(p)
3612N/A </script>
3612N/A
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 'command' : c,
3612N/A 'arguments' : p,
3612N/A 'path' : ODS_UNZIPPED,
3612N/A 'expectedRC': 2,
3612N/A 'outputFile': '%s/ports-setup-ldaps-conflict.txt' % OUT_GROUP,
3612N/A }
3612N/A </call>
3612N/A
3612N/A <call function="'testCase_Postamble'"/>
3612N/A </sequence>
3612N/A </testcase>
3612N/A
3612N/A <!--- Test Case information
3612N/A #@TestMarker Setup-Uninstall ports Tests
3612N/A #@TestName Setup-Uninstall: Ports:
3612N/A jmx-port-conflict
3612N/A #@TestID jmx-port-conflict
3612N/A #@TestPurpose Setup OpenDS, specifying a used JMX port
3612N/A #@TestPreamble
3612N/A #@TestStep Setup OpenDS, specifying a used JMX port
3612N/A Check for error
3612N/A #@TestPostamble
3612N/A #@TestResult PASS if all steps ran without errors
3612N/A -->
3612N/A <testcase name="getTestCaseName('jmx-port-conflict')">
3612N/A <sequence>
3612N/A
3612N/A <call function="'testCase_Preamble'"/>
3612N/A <message>'Ports: JMX port conflict'</message>
3612N/A
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 'service' : 'FS',
6035N/A 'request' : 'DELETE',
6035N/A 'arguments' : 'ENTRY %s RECURSE CONFIRM' % ODS_UNZIPPED
6035N/A }
6035N/A </call>
6035N/A <call function="'checktestRC'">
6035N/A { 'returncode' : RC,
6035N/A 'expected' : 0,
6035N/A 'result' : 'FAIL to remove files for this group at cleanup',
6035N/A }
6035N/A </call>
6035N/A <call function="'runSTAFCommand'">
6035N/A { 'name' : 'Create directory to contain unzipped OpenDS',
6035N/A 'location' : STAF_REMOTE_HOSTNAME,
6035N/A 'service' : 'FS',
6035N/A 'request' : 'CREATE',
6035N/A 'arguments' : 'DIRECTORY %s FAILIFEXISTS' % ODS_UNZIPPED
6035N/A }
6035N/A </call>
6035N/A <call function="'runSTAFCommand'">
6035N/A { 'name' : 'Extract OpenDS ZIP file',
6035N/A 'location' : STAF_REMOTE_HOSTNAME,
6035N/A 'service' : 'ZIP',
6035N/A 'request' : 'UNZIP',
6035N/A 'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
6035N/A % (DIRECTORY_INSTANCE_DIR, ZIPNAME, ODS_UNZIPPED)
6035N/A }
6035N/A </call>
6035N/A <call function="'checktestRC'">
6035N/A { 'returncode' : RC,
6035N/A 'expected' : 0,
6035N/A 'result' : 'FAIL to unzip OpenDS ZIP file',
6035N/A }
6035N/A </call>
6035N/A
3612N/A <script>
3612N/A c = '%s/%s/setup%s' % (ODS_UNZIPPED, OPENDSNAME, fileExt)
3612N/A p = []
3612N/A p.append('--cli --no-prompt --rootUserPassword kangourou')
3949N/A p.append('--ldapPort %s' % PORTS_I2_PORT)
3949N/A p.append('--jmxPort %s' % PORTS_I1_PORT)
3612N/A p = ' '.join(p)
3612N/A </script>
3612N/A
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 'command' : c,
3612N/A 'arguments' : p,
3612N/A 'path' : ODS_UNZIPPED,
3612N/A 'expectedRC': 2,
3612N/A 'outputFile': '%s/ports-setup-jmx-conflict.txt' % OUT_GROUP,
3612N/A }
3612N/A </call>
3612N/A
3612N/A <call function="'testCase_Postamble'"/>
3612N/A </sequence>
3612N/A </testcase>
3612N/A
3612N/A <!--- Test Case information
3612N/A #@TestMarker Setup-Uninstall ports Tests
3612N/A #@TestName Setup-Uninstall: Ports:
3612N/A ldap-port-conflict-nocheck
3612N/A #@TestID ldap-port-conflict-nocheck
3612N/A #@TestPurpose Setup OpenDS, disabling the LDAP port check
3612N/A #@TestPreamble
3612N/A #@TestStep Unzip OpenDS ZIP distribution
3822N/A Setup OpenDS with 'skipPortCheck' and 'doNotStart'
3612N/A options
3612N/A Uninstall OpenDS
3612N/A #@TestPostamble
3612N/A #@TestResult PASS if all steps ran without errors
3612N/A -->
3612N/A <testcase name="getTestCaseName('ldap-port-conflict-nocheck')">
3612N/A <sequence>
3612N/A
3612N/A <script>
3949N/A PORTS_I2_BASE = '%s/ports_i2' % (OUT_GROUP)
3949N/A PORTS_I2_ROOT = '%s/%s' % (PORTS_I2_BASE, OPENDSNAME)
3612N/A </script>
3612N/A
3612N/A
3612N/A <call function="'testCase_Preamble'"/>
3612N/A <message>'Ports: '</message>
3612N/A
3612N/A <!-- 1. Setup options: baseDN baseDN sampleData -->
6035N/A <message>'Prepare Open DS ZIP (in %s)' % PORTS_I2_ROOT</message>
3612N/A
3612N/A <call function="'runSTAFCommand'">
3949N/A { 'name' : 'Create directory to contain I2',
3612N/A 'location' : STAF_REMOTE_HOSTNAME,
3612N/A 'service' : 'FS',
3612N/A 'request' : 'CREATE',
3949N/A 'arguments' : 'DIRECTORY %s FAILIFEXISTS' % PORTS_I2_BASE
3612N/A }
3612N/A </call>
3612N/A
3612N/A <call function="'checktestRC'">
3612N/A { 'returncode' : RC,
3612N/A 'expected' : 0,
3612N/A 'result' : 'FAIL to create directory',
3612N/A }
3612N/A </call>
3612N/A
3612N/A <call function="'runSTAFCommand'">
3612N/A { 'name' : 'Extract OpenDS ZIP file',
3612N/A 'location' : STAF_REMOTE_HOSTNAME,
3612N/A 'service' : 'ZIP',
3612N/A 'request' : 'UNZIP',
3612N/A 'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
3949N/A % (DIRECTORY_INSTANCE_DIR, ZIPNAME, PORTS_I2_BASE)
3612N/A }
3612N/A </call>
3612N/A
3612N/A <call function="'checktestRC'">
3612N/A { 'returncode' : RC,
3612N/A 'expected' : 0,
3612N/A 'result' : 'FAIL to unzip OpenDS ZIP file',
3612N/A }
3612N/A </call>
3612N/A
3612N/A <script>
3949N/A c = '%s/setup%s' % (PORTS_I2_ROOT, fileExt)
3612N/A p = []
3949N/A p.append('--cli --no-prompt --ldapPort %s' % PORTS_I1_PORT)
3612N/A p.append('--rootUserPassword "kangourou"')
3612N/A p.append('--skipPortCheck --doNotStart --noPropertiesFile')
3612N/A p = ' '.join(p)
3612N/A </script>
3612N/A
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 'command' : c,
3612N/A 'arguments' : p,
6035N/A 'path' : PORTS_I2_ROOT,
3612N/A 'expectedRC': 0,
3949N/A 'outputFile': '%s/ports-setup-confl-nocheck-i2.txt' % OUT_GROUP,
3612N/A }
3612N/A </call>
3612N/A
3612N/A <script>
3949N/A c = '%s/%s/start-ds%s' % (PORTS_I2_ROOT, fileFolder, fileExt)
3612N/A p = []
3612N/A p = ' '.join(p)
3612N/A </script>
3612N/A
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 'command' : c,
3612N/A 'arguments' : p,
3949N/A 'path' : PORTS_I2_ROOT,
3612N/A 'expectedRC': 1,
3949N/A 'outputFile': '%s/ports-start-conflict-i2.txt' % OUT_GROUP,
3612N/A }
3612N/A </call>
3612N/A
3612N/A <script>
3949N/A c = '%s/uninstall%s' % (PORTS_I2_ROOT, fileExt)
3612N/A p = []
3612N/A p.append('--cli --no-prompt')
3612N/A p.append('--quiet --forceOnError --remove-all')
3612N/A p.append('--referencedHostName %s' % STAF_REMOTE_HOSTNAME)
3612N/A p = ' '.join(p)
3612N/A </script>
3612N/A
3612N/A <message>'%s %s' % (c, p)</message>
3612N/A <call function="'runCommand'">
3612N/A { 'location' : STAF_REMOTE_HOSTNAME,
3949N/A 'name' : 'Uninstall I2',
3612N/A 'command' : c,
3612N/A 'arguments' : p,
6035N/A 'path' : PORTS_I2_ROOT,
3612N/A 'expectedRC': 0,
3949N/A 'outputFile': '%s/ports-uninstall-conflict-i2.txt' % OUT_GROUP,
3612N/A }
3612N/A </call>
3612N/A <call function="'testCase_Postamble'"/>
3612N/A
3612N/A
3612N/A </sequence>
3612N/A </testcase>
3612N/A
3612N/A
3612N/A <!--- Test Case information
3612N/A #@TestMarker Setup-Uninstall ports Tests
3612N/A #@TestName Setup-Uninstall: Ports:
3612N/A ldap-port-unauthorized
3612N/A #@TestID ldap-port-unauthorized
3612N/A #@TestPurpose Setup OpenDS, specifying a forbidden LDAP port
3612N/A #@TestPreamble
3612N/A #@TestStep Setup OpenDS with forbidden port number
3612N/A Check for error
3612N/A #@TestPostamble
3612N/A #@TestResult PASS if all steps ran without errors
3612N/A -->
3612N/A <testcase name="getTestCaseName('ldap-port-unauthorized')">
3612N/A <sequence>
3612N/A
3612N/A <call function="'testCase_Preamble'"/>
3612N/A <message>'Ports: Unauthorized LDAP port'</message>
3612N/A
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 'service' : 'FS',
6035N/A 'request' : 'DELETE',
6035N/A 'arguments' : 'ENTRY %s RECURSE CONFIRM' % ODS_UNZIPPED
6035N/A }
6035N/A </call>
6035N/A <call function="'checktestRC'">
6035N/A { 'returncode' : RC,
6035N/A 'expected' : 0,
6035N/A 'result' : 'FAIL to remove files for this group at cleanup',
6035N/A }
6035N/A </call>
6035N/A <call function="'runSTAFCommand'">
6035N/A { 'name' : 'Create directory to contain unzipped OpenDS',
6035N/A 'location' : STAF_REMOTE_HOSTNAME,
6035N/A 'service' : 'FS',
6035N/A 'request' : 'CREATE',
6035N/A 'arguments' : 'DIRECTORY %s FAILIFEXISTS' % ODS_UNZIPPED
6035N/A }
6035N/A </call>
6035N/A <call function="'runSTAFCommand'">
6035N/A { 'name' : 'Extract OpenDS ZIP file',
6035N/A 'location' : STAF_REMOTE_HOSTNAME,
6035N/A 'service' : 'ZIP',
6035N/A 'request' : 'UNZIP',
6035N/A 'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
6035N/A % (DIRECTORY_INSTANCE_DIR, ZIPNAME, ODS_UNZIPPED)
6035N/A }
6035N/A </call>
6035N/A <call function="'checktestRC'">
6035N/A { 'returncode' : RC,
6035N/A 'expected' : 0,
6035N/A 'result' : 'FAIL to unzip OpenDS ZIP file',
6035N/A }
6035N/A </call>
6035N/A
5470N/A <!-- This testcase is not relevant on Windows or as root user -->
3612N/A <script>
5470N/A from java.lang import System
5781N/A if is_windows_platform(STAF_REMOTE_HOSTNAME) or get_system_uid() == "root":
3949N/A skip=1
3949N/A else:
3949N/A skip=0
3949N/A </script>
3949N/A
3949N/A <if expr="skip == 0">
3949N/A <sequence>
3949N/A <script>
3949N/A c = '%s/%s/setup%s' % (ODS_UNZIPPED, OPENDSNAME, fileExt)
3949N/A p = []
3949N/A p.append('--cli --no-prompt --rootUserPassword kangourou')
3949N/A p.append('--ldapPort 1')
3949N/A p = ' '.join(p)
3949N/A </script>
3949N/A
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',
3949N/A 'command' : c,
3949N/A 'arguments' : p,
3949N/A 'path' : ODS_UNZIPPED,
3949N/A 'expectedRC': 2,
3949N/A 'outputFile': '%s/ports-unauthorized-ldap.txt' % OUT_GROUP,
3949N/A }
3949N/A </call>
3949N/A </sequence>
3949N/A <else>
3949N/A <sequence>
5470N/A <message>'This testcase is not relevant on Windows or as root user'</message>
3949N/A <tcstatus result="'pass'"/>
3949N/A </sequence>
3949N/A </else>
3949N/A </if>
3949N/A
3949N/A <call function="'testCase_Postamble'"/>
3949N/A </sequence>
3949N/A </testcase>
3949N/A
3949N/A <!--- Test Case information
3949N/A #@TestMarker Setup-Uninstall ports Tests
3949N/A #@TestName Setup-Uninstall: Ports:
3949N/A uninstall
3949N/A #@TestID uninstall
3949N/A #@TestPurpose Uninstall the first instance
3949N/A #@TestPreamble
3949N/A #@TestStep Uninstall the first instance
3949N/A #@TestPostamble
3949N/A #@TestResult PASS if all steps ran without errors
3949N/A -->
3949N/A <testcase name="getTestCaseName('uninstall')">
3949N/A <sequence>
3949N/A
3949N/A <call function="'testCase_Preamble'"/>
3949N/A <message>'Ports: Uninstall the first instance'</message>
3949N/A
3949N/A <script>
3949N/A PORTS_I1_BASE = '%s/port_i1' % (OUT_GROUP)
3949N/A PORTS_I1_ROOT = '%s/%s' % (PORTS_I1_BASE, OPENDSNAME)
3949N/A </script>
3949N/A
3949N/A <script>
3949N/A c = '%s/uninstall%s' % (PORTS_I1_ROOT, fileExt)
3612N/A p = []
3949N/A p.append('--cli --no-prompt')
3949N/A p.append('--quiet --forceOnError --remove-all')
3949N/A p.append('--referencedHostName %s' % STAF_REMOTE_HOSTNAME)
3612N/A p = ' '.join(p)
3612N/A </script>
3949N/A
3612N/A <message>'%s %s' % (c, p)</message>
3612N/A <call function="'runCommand'">
3612N/A { 'location' : STAF_REMOTE_HOSTNAME,
3949N/A 'name' : 'Uninstall I1',
3612N/A 'command' : c,
3612N/A 'arguments' : p,
3949N/A 'path' : PORTS_I1_ROOT,
3949N/A 'expectedRC': 0,
3949N/A 'outputFile': '%s/ports-uninstall-i1.txt' % OUT_GROUP,
3612N/A }
3612N/A </call>
3612N/A
3612N/A <call function="'testCase_Postamble'"/>
3612N/A </sequence>
3612N/A </testcase>
3612N/A
3612N/A <call function="'testSuite_Postamble'"/>
3612N/A
3612N/A </sequence>
3612N/A
3612N/A </function>
3612N/A
3612N/A</stax>