10139N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
10139N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
10139N/A<!--
12158N/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
15894N/A ! (the "License"). You may not use this file except in compliance
10139N/A ! with the License.
10139N/A !
17178N/A ! You can obtain a copy of the license at
17178N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
10139N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
10139N/A ! See the License for the specific language governing permissions
10139N/A ! and limitations under the License.
17110N/A !
10139N/A ! When distributing Covered Code, exclude this CDDL HEADER in each
10139N/A ! file and exclude the License file at
10139N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
10139N/A ! add the following below this CDDL HEADER, with the fields enclosed
10139N/A ! by brackets "[]" replaced with your own identifying information:
16920N/A ! Portions Copyright [yyyy] [name of copyright owner]
10142N/A !
12132N/A ! CDDL HEADER END
12132N/A !
10142N/A ! Copyright 2008 Sun Microsystems, Inc.
12773N/A ! Portions Copyright 2013 ForgeRock AS
14434N/A ! -->
12773N/A<stax>
14434N/A
15440N/A <defaultcall function="ports"/>
15440N/A
15740N/A <function name="ports">
10139N/A
12107N/A <sequence>
10139N/A
10139N/A <!--- Test Suite information
10139N/A #@TestSuiteName Setup-Uninstall ports Tests
12796N/A #@TestSuitePurpose Test all port relative setup and uninstall
10139N/A options (port conflict, access right on port,
10139N/A ...)
10139N/A #@TestSuiteGroup ports
10139N/A #@TestSuiteID ports Tests
10139N/A #@TestGroup Setup-Uninstall
10139N/A #@TestScript ports.xml
10139N/A #@TestHTMLLink http://opends.dev.java.net/
12107N/A -->
13969N/A
12107N/A <script>
14181N/A if not CurrentTestPath.has_key('group'):
14181N/A CurrentTestPath['group'] = 'setup'
14181N/A CurrentTestPath['suite'] = 'ports'
14181N/A </script>
14181N/A
14181N/A <call function="'testSuite_Preamble'"/>
15440N/A
14181N/A <call function="'getFreePort'">
10139N/A {
14181N/A 'host' : STAF_REMOTE_HOSTNAME,
16852N/A 'port' : 2000,
16852N/A }
17108N/A </call>
17108N/A <script>PORTS_I1_PORT = STAXResult</script>
17165N/A
17165N/A <call function="'getFreePort'">
15864N/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
10139N/A <message>
10139N/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
10139N/A #@TestID bind-port
10139N/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 }
10139N/A </call>
10139N/A
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, PORTS_I1_BASE)
10139N/A }
10139N/A </call>
10139N/A
10139N/A <call function="'checktestRC'">
10139N/A { 'returncode' : RC,
10142N/A 'expected' : 0,
10139N/A 'result' : 'FAIL to unzip OpenDS ZIP file',
10139N/A }
12176N/A </call>
10139N/A
12796N/A <script>
12125N/A c = '%s/setup%s' % (PORTS_I1_ROOT, fileExt)
10139N/A p = []
10139N/A p.append('--cli --no-prompt --rootUserPassword kangourou %s' \
12886N/A % licenseOption)
12886N/A p.append('--ldapPort %s' % PORTS_I1_PORT)
12886N/A p.append('--adminConnectorPort %s' % PORTS_I1_ADMIN_PORT)
13367N/A p = ' '.join(p)
12127N/A </script>
15740N/A
14181N/A <message>'%s %s' % (c, p)</message>
16852N/A <call function="'runCommand'">
17108N/A { 'location' : STAF_REMOTE_HOSTNAME,
17165N/A 'name' : 'Setup a first instance to bind a port',
10139N/A 'command' : c,
14434N/A 'arguments' : p,
15440N/A 'path' : PORTS_I1_ROOT,
15440N/A 'expectedRC': 0,
15740N/A 'outputFile': '%s/ports-install-i1.txt' % OUT_GROUP,
14434N/A }
10139N/A </call>
10139N/A
10139N/A <call function="'testCase_Postamble'"/>
10139N/A </sequence>
10142N/A </testcase>
10139N/A
10139N/A <!--- Test Case information
10139N/A #@TestMarker Setup-Uninstall ports Tests
10139N/A #@TestName Setup-Uninstall: Ports:
10139N/A ldap-port-conflict
10139N/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>
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 %s %s' % (PORTS_I1_PORT, licenseOption))
10139N/A p = ' '.join(p)
10139N/A </script>
16174N/A
12773N/A <message>'%s %s' % (c, p)</message>
12773N/A <call function="'runCommand'">
12773N/A { 'location' : STAF_REMOTE_HOSTNAME,
12773N/A 'name' : 'Launch setup command with LDAP port conflict',
12773N/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,
15734N/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'">
10139N/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',
17108N/A 'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
17108N/A % (DIRECTORY_INSTANCE_DIR, ZIPNAME, ODS_UNZIPPED)
16852N/A }
16852N/A </call>
16852N/A <call function="'checktestRC'">
16764N/A { 'returncode' : RC,
16764N/A 'expected' : 0,
16484N/A 'result' : 'FAIL to unzip OpenDS ZIP file',
16484N/A }
16372N/A </call>
16372N/A
16159N/A <script>
16159N/A c = '%s/%s/setup%s' % (ODS_UNZIPPED, OPENDSNAME, fileExt)
16143N/A p = []
16143N/A p.append('--cli --no-prompt --rootUserPassword kangourou')
15862N/A p.append('--ldapPort %s' % PORTS_I2_PORT)
15862N/A p.append('--ldapsPort %s' % PORTS_I1_PORT)
15864N/A p.append('--generateSelfSignedCertificate %s' % licenseOption)
15862N/A p = ' '.join(p)
15862N/A </script>
15559N/A
15559N/A <message>'%s %s' % (c, p)</message>
15448N/A <call function="'runCommand'">
15448N/A { 'location' : STAF_REMOTE_HOSTNAME,
15440N/A 'name' : 'Launch setup command with LDAPS port conflict',
15440N/A 'command' : c,
15440N/A 'arguments' : p,
15440N/A 'path' : ODS_UNZIPPED,
14545N/A 'expectedRC': 2,
14545N/A 'outputFile': '%s/ports-setup-ldaps-conflict.txt' % OUT_GROUP,
14497N/A }
14497N/A </call>
14497N/A
14497N/A <call function="'testCase_Postamble'"/>
14497N/A </sequence>
14169N/A </testcase>
13780N/A
13780N/A <!--- Test Case information
13663N/A #@TestMarker Setup-Uninstall ports Tests
13663N/A #@TestName Setup-Uninstall: Ports:
13502N/A jmx-port-conflict
13502N/A #@TestID jmx-port-conflict
13424N/A #@TestPurpose Setup OpenDS, specifying a used JMX port
13424N/A #@TestPreamble
13329N/A #@TestStep Setup OpenDS, specifying a used JMX port
13329N/A Check for error
13329N/A #@TestPostamble
13329N/A #@TestResult PASS if all steps ran without errors
13327N/A -->
13058N/A <testcase name="getTestCaseName('jmx-port-conflict')">
13058N/A <sequence>
12998N/A
12998N/A <call function="'testCase_Preamble'"/>
12987N/A <message>'Ports: JMX port conflict'</message>
12998N/A
12825N/A <!-- Remove and recreate the unzipped instance -->
12825N/A <call function="'runSTAFCommand'">
12775N/A { 'name' : 'Delete directory containing unzipped OpenDS',
12775N/A 'location' : STAF_REMOTE_HOSTNAME,
12775N/A 'service' : 'FS',
12629N/A 'request' : 'DELETE',
12629N/A 'arguments' : 'ENTRY %s RECURSE CONFIRM' % ODS_UNZIPPED
12629N/A }
12629N/A </call>
12586N/A <call function="'checktestRC'">
12586N/A { 'returncode' : RC,
12467N/A 'expected' : 0,
12467N/A 'result' : 'FAIL to remove files for this group at cleanup',
12370N/A }
12370N/A </call>
12288N/A <call function="'runSTAFCommand'">
12288N/A { 'name' : 'Create directory to contain unzipped OpenDS',
12246N/A 'location' : STAF_REMOTE_HOSTNAME,
12246N/A 'service' : 'FS',
12215N/A 'request' : 'CREATE',
12215N/A 'arguments' : 'DIRECTORY %s FAILIFEXISTS' % ODS_UNZIPPED
12176N/A }
12176N/A </call>
12158N/A <call function="'runSTAFCommand'">
12158N/A { 'name' : 'Extract OpenDS ZIP file',
12158N/A 'location' : STAF_REMOTE_HOSTNAME,
12154N/A 'service' : 'ZIP',
12158N/A 'request' : 'UNZIP',
12142N/A 'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
12158N/A % (DIRECTORY_INSTANCE_DIR, ZIPNAME, ODS_UNZIPPED)
12127N/A }
12127N/A </call>
12142N/A <call function="'checktestRC'">
12158N/A { 'returncode' : RC,
12125N/A 'expected' : 0,
12125N/A 'result' : 'FAIL to unzip OpenDS ZIP file',
12104N/A }
12104N/A </call>
11981N/A
11981N/A <script>
11878N/A c = '%s/%s/setup%s' % (ODS_UNZIPPED, OPENDSNAME, fileExt)
11878N/A p = []
11855N/A p.append('--cli --no-prompt --rootUserPassword kangourou')
11855N/A p.append('--ldapPort %s' % PORTS_I2_PORT)
11438N/A p.append('--jmxPort %s %s' % (PORTS_I1_PORT, licenseOption))
11438N/A p = ' '.join(p)
11419N/A </script>
11419N/A
11419N/A <message>'%s %s' % (c, p)</message>
11252N/A <call function="'runCommand'">
11252N/A { 'location' : STAF_REMOTE_HOSTNAME,
11115N/A 'name' : 'Launch setup command with JMX port conflict',
11115N/A 'command' : c,
11070N/A 'arguments' : p,
11070N/A 'path' : ODS_UNZIPPED,
10986N/A 'expectedRC': 2,
10986N/A 'outputFile': '%s/ports-setup-jmx-conflict.txt' % OUT_GROUP,
10981N/A }
10981N/A </call>
10921N/A
10921N/A <call function="'testCase_Postamble'"/>
10821N/A </sequence>
10821N/A </testcase>
10746N/A
10746N/A <!--- Test Case information
10637N/A #@TestMarker Setup-Uninstall ports Tests
10637N/A #@TestName Setup-Uninstall: Ports:
10454N/A ldap-port-conflict-nocheck
10454N/A #@TestID ldap-port-conflict-nocheck
10264N/A #@TestPurpose Setup OpenDS, disabling the LDAP port check
10264N/A #@TestPreamble
10176N/A #@TestStep Unzip OpenDS ZIP distribution
10176N/A Setup OpenDS with 'skipPortCheck' and 'doNotStart'
10139N/A options
10139N/A Uninstall OpenDS
10139N/A #@TestPostamble
10139N/A #@TestResult PASS if all steps ran without errors
10139N/A -->
10139N/A <testcase name="getTestCaseName('ldap-port-conflict-nocheck')">
10139N/A <sequence>
10139N/A
10139N/A <script>
10139N/A PORTS_I2_BASE = '%s/ports_i2' % (OUT_GROUP)
10139N/A PORTS_I2_ROOT = '%s/%s' % (PORTS_I2_BASE, OPENDSNAME)
10139N/A </script>
10139N/A
10139N/A
10139N/A <call function="'testCase_Preamble'"/>
10139N/A <message>'Ports: '</message>
10139N/A
10139N/A <!-- 1. Setup options: baseDN baseDN sampleData -->
10139N/A <message>'Prepare Open DS ZIP (in %s)' % PORTS_I2_ROOT</message>
10139N/A
10139N/A <call function="'runSTAFCommand'">
10139N/A { 'name' : 'Create directory to contain I2',
10139N/A 'location' : STAF_REMOTE_HOSTNAME,
10139N/A 'service' : 'FS',
10139N/A 'request' : 'CREATE',
10139N/A 'arguments' : 'DIRECTORY %s FAILIFEXISTS' % PORTS_I2_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 }
10139N/A </call>
10139N/A
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, PORTS_I2_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 unzip OpenDS ZIP file',
10139N/A }
10139N/A </call>
10139N/A
10139N/A <script>
10139N/A c = '%s/setup%s' % (PORTS_I2_ROOT, fileExt)
10139N/A p = []
10139N/A p.append('--cli --no-prompt --ldapPort %s' % PORTS_I1_PORT)
10139N/A p.append('--rootUserPassword "kangourou" %s' % licenseOption)
10139N/A p.append('--skipPortCheck --doNotStart --noPropertiesFile')
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' : 'Setup command for I2 (port conflict but nocheck)',
10139N/A 'command' : c,
10139N/A 'arguments' : p,
10139N/A 'path' : PORTS_I2_ROOT,
10139N/A 'expectedRC': 0,
10139N/A 'outputFile': '%s/ports-setup-confl-nocheck-i2.txt' % OUT_GROUP,
10139N/A }
10139N/A </call>
10139N/A
10139N/A <script>
10139N/A c = '%s/%s/start-ds%s' % (PORTS_I2_ROOT, fileFolder, fileExt)
10139N/A p = []
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' : 'start DS (will raise port conflict)',
10139N/A 'command' : c,
10139N/A 'arguments' : p,
10139N/A 'path' : PORTS_I2_ROOT,
10139N/A 'expectedRC': 1,
10139N/A 'outputFile': '%s/ports-start-conflict-i2.txt' % OUT_GROUP,
10139N/A }
10139N/A </call>
10139N/A
10139N/A <script>
10139N/A c = '%s/uninstall%s' % (PORTS_I2_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 I2',
10139N/A 'command' : c,
10139N/A 'arguments' : p,
10139N/A 'path' : PORTS_I2_ROOT,
10139N/A 'expectedRC': 0,
10139N/A 'outputFile': '%s/ports-uninstall-conflict-i2.txt' % OUT_GROUP,
10139N/A }
10139N/A </call>
10139N/A <call function="'testCase_Postamble'"/>
10139N/A
10139N/A
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 ldap-port-unauthorized
10139N/A #@TestID ldap-port-unauthorized
10139N/A #@TestPurpose Setup OpenDS, specifying a forbidden LDAP port
10139N/A #@TestPreamble
10139N/A #@TestStep Setup OpenDS with forbidden port number
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-unauthorized')">
10139N/A <sequence>
10139N/A
10139N/A <call function="'testCase_Preamble'"/>
10139N/A <message>'Ports: Unauthorized LDAP port'</message>
10139N/A
10139N/A <!-- Remove and recreate the unzipped instance -->
10139N/A <call function="'runSTAFCommand'">
10139N/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)
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>
10139N/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