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 !
6982N/A ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
6982N/A ! or http://forgerock.org/license/CDDLv1.0.html.
3612N/A ! See the License for the specific language governing permissions
3612N/A ! and limitations under the License.
3612N/A !
6982N/A ! When distributing Covered Code, include this CDDL HEADER in each
6982N/A ! file and include the License file at legal-notices/CDDLv1_0.txt.
6982N/A ! If applicable, add the following below this CDDL HEADER, with the
6982N/A ! fields enclosed by brackets "[]" replaced with your own identifying
6982N/A ! 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.
3612N/A ! -->
3612N/A<stax>
3612N/A
3612N/A <defaultcall function="misc"/>
3612N/A
3612N/A <function name="misc">
3612N/A
3612N/A <sequence>
3612N/A
3612N/A <!--- Test Suite information
3612N/A #@TestSuiteName Setup-Uninstall misc Tests
3612N/A #@TestSuitePurpose Test miscelaneous setup/uninstall commands
3612N/A that do not fit into any other test suite
3612N/A #@TestSuiteGroup misc
3612N/A #@TestSuiteID misc Tests
3612N/A #@TestGroup Setup-Uninstall
3612N/A #@TestScript misc.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'] = 'misc'
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,
3612N/A 'port' : 7500,
3612N/A }
3612N/A </call>
3612N/A <script>MISC_I1_PORT = STAXResult</script>
3612N/A
3612N/A <message>
3612N/A 'Got this free port: %s' % MISC_I1_PORT
3612N/A </message>
3612N/A
3612N/A <!--- Test Case information
3612N/A #@TestMarker Setup-Uninstall Misc tests
3612N/A #@TestName Setup-Uninstall: Misc:
3612N/A misc
3612N/A #@TestID misc
3822N/A #@TestPurpose Launch buggy setup and uninstall commands and
3822N/A check that they are rejected
3612N/A #@TestPreamble
3612N/A #@TestStep Unzip OpenDS ZIP delivery
3612N/A Setup OpenDS with unexisting option
3612N/A Check for error
3612N/A Setup OpenDS with no options
3612N/A Check for error
3612N/A Uninstall an uninstalled OpenDS
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('misc')">
3612N/A <sequence>
3612N/A
3612N/A <script>
3612N/A MISC_I1_BASE = '%s/misc_i1' % (OUT_GROUP)
3612N/A MISC_I1_ROOT = '%s/%s' % (MISC_I1_BASE, OPENDSNAME)
3612N/A </script>
3612N/A
3612N/A
3612N/A <call function="'testCase_Preamble'"/>
3612N/A <message>'Setup Uninstall: Command errors'</message>
3612N/A
3612N/A <!-- 1. Setup options: baseDN baseDN sampleData -->
3612N/A <message>'++ Setup options: baseDN baseDN sampleData'</message>
3612N/A <message>'Prepare Open DS ZIP (in %s)' % MISC_I1_ROOT</message>
3612N/A
3612N/A <call function="'runSTAFCommand'">
3612N/A { 'name' : 'Create directory to contain I1',
3612N/A 'location' : STAF_REMOTE_HOSTNAME,
3612N/A 'service' : 'FS',
3612N/A 'request' : 'CREATE',
3612N/A 'arguments' : 'DIRECTORY %s FAILIFEXISTS' % MISC_I1_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' \
3690N/A % (DIRECTORY_INSTANCE_DIR, ZIPNAME, MISC_I1_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>
3612N/A c = '%s/setup%s' % (MISC_I1_ROOT, fileExt)
3612N/A p = []
3612N/A p.append('--cli --no-prompt')
3612N/A p.append('--rootUserPassword "kangourou"')
3612N/A p.append('--doesNotExist')
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 (buggy) setup command for I1',
3612N/A 'command' : c,
3612N/A 'arguments' : p,
3612N/A 'path' : MISC_I1_ROOT,
3612N/A 'expectedRC': 2,
3612N/A 'outputFile': '%s/misc-setup1-i1.txt' % OUT_GROUP,
3612N/A }
3612N/A </call>
3612N/A
3612N/A <script>
3612N/A c = '%s/setup%s' % (MISC_I1_ROOT, fileExt)
3612N/A p = []
3612N/A p.append('--cli --no-prompt')
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 (another buggy) setup command for I1',
3612N/A 'command' : c,
3612N/A 'arguments' : p,
3612N/A 'path' : MISC_I1_ROOT,
3612N/A 'expectedRC': 2,
3612N/A 'outputFile': '%s/misc-setup2-i1.txt' % OUT_GROUP,
3612N/A }
3612N/A </call>
3612N/A
3612N/A <script>
3612N/A c = '%s/uninstall%s' % (MISC_I1_ROOT, fileExt)
3612N/A p = []
3853N/A p.append('--cli --no-prompt --trustAll')
3612N/A p.append('--removeAll')
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 uninstall command for (uninstalled) I1',
3612N/A 'command' : c,
3612N/A 'arguments' : p,
3612N/A 'path' : MISC_I1_ROOT,
3612N/A 'expectedRC': 2,
3612N/A 'outputFile': '%s/misc-uninstall-i1.txt' % OUT_GROUP,
3612N/A }
3612N/A </call>
3612N/A
3612N/A
3612N/A <call function="'testCase_Postamble'"/>
3612N/A
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>