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] 5116N/A ! Copyright 2008-2010 Sun Microsystems, Inc. 6184N/A ! Portions Copyright 2011-2013 ForgeRock AS 3612N/A <
defaultcall function="import"/>
3612N/A <!--- Test Suite information 3612N/A #@TestSuiteName Setup-Uninstall import Tests 3612N/A #@TestSuitePurpose Test all options of the setup command relative 3612N/A to initial data generation and data import 3612N/A (ie: all options that feed DS with data at setup 3612N/A #@TestGroup Setup-Uninstall 3612N/A CurrentTestPath['group'] = 'setup'
3612N/A CurrentTestPath['suite'] = 'import'
3612N/A <
call function="'testSuite_Preamble'"/>
3612N/A <
call function="'getFreePort'">
3612N/A 'host' : STAF_REMOTE_HOSTNAME,
3612N/A <
script>IMP_I1_PORT = STAXResult</
script>
3612N/A <
call function="'getFreePort'">
3612N/A 'host' : STAF_REMOTE_HOSTNAME,
4865N/A <
script>IMP_I1_ADMIN_PORT = STAXResult</
script>
3853N/A <
call function="'getFreePort'">
3853N/A 'host' : STAF_REMOTE_HOSTNAME,
3612N/A <
script>IMP_I2_PORT = STAXResult</
script>
3853N/A <
call function="'getFreePort'">
3853N/A 'host' : STAF_REMOTE_HOSTNAME,
3853N/A <
script>IMP_I2_ADMIN_PORT = STAXResult</
script>
3853N/A 'Got these free ports: %s, %s, %sand %s' % (IMP_I1_PORT, \
3853N/A IMP_I1_ADMIN_PORT, IMP_I2_PORT, IMP_I2_ADMIN_PORT)
3612N/A <!--- Test Case information 3612N/A #@TestMarker Setup-Uninstall Import options 3612N/A #@TestName Setup-Uninstall: import: 3612N/A setup_uninstall_import_sample 3612N/A #@TestID setup_uninstall_import_sample 3612N/A #@TestPurpose Test the ability of the setup command to 3612N/A generate and import LDAP entries 3612N/A #@TestStep Unzip OpenDS distribution 3612N/A Setup OpenDS with 2 suffixes and generate 5 3612N/A #@TestResult PASS if all steps ran without errors 3612N/A <
testcase name="getTestCaseName('setup_uninstall_import_sample')">
3612N/A IMP_I1_ROOT = '%s/%s' % (IMP_I1_BASE, OPENDSNAME)
3612N/A <
call function="'testCase_Preamble'"/>
3612N/A <
message>'Setup Uninstall: Sample data options'</
message>
3612N/A <!-- 1. Setup options: baseDN baseDN sampleData --> 3612N/A <
message>'Prepare Open DS ZIP (in %s)' % IMP_I1_ROOT</
message>
3612N/A <
call function="'runSTAFCommand'">
3612N/A { 'name' : 'Create directory to contain I1',
3612N/A 'location' : STAF_REMOTE_HOSTNAME,
3612N/A 'arguments' : 'DIRECTORY %s FAILIFEXISTS' % IMP_I1_BASE
3612N/A <
call function="'checktestRC'">
3612N/A 'result' : 'FAIL to create directory',
3612N/A <
call function="'runSTAFCommand'">
5369N/A { 'name' : 'Extract OpenDJ ZIP file',
3612N/A 'location' : STAF_REMOTE_HOSTNAME,
3612N/A 'arguments' : 'ZIPFILE %s/%s TODIRECTORY %s RESTOREPERMISSION' \
3690N/A % (DIRECTORY_INSTANCE_DIR, ZIPNAME, IMP_I1_BASE)
3612N/A <
call function="'checktestRC'">
5369N/A 'result' : 'FAIL to unzip OpenDJ ZIP file',
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 for I1',
3612N/A <!-- Check StartTLS is refused --> 3612N/A <
call function="'ldapSearchWithScript'">
3612N/A { 'dsInstancePort' : IMP_I1_PORT,
3612N/A 'dsInstanceDn' : "cn=Directory Manager",
3612N/A 'dsInstancePswd' : "kangourou",
3612N/A <!-- Check Data have been generated under o=o1 --> 3612N/A <
message>'Check Data have been generated under o=o1'</
message>
3612N/A <
call function="'ldapSearchWithScript'">
3612N/A { 'dsInstancePort' : IMP_I1_PORT,
3612N/A 'dsInstanceDn' : "cn=Directory Manager",
3612N/A 'dsInstancePswd' : "kangourou",
3612N/A 'dsFilter' : 'objectclass=*',
3612N/A <
call function="'CheckMatches'">
3612N/A 'mainString' : STAXResult[0][1],
3612N/A <!-- Check Data have been generated under o=o2 --> 3612N/A <
message>'Check Data have been generated under o=o2'</
message>
3612N/A <
call function="'ldapSearchWithScript'">
3612N/A { 'dsInstancePort' : IMP_I1_PORT,
3612N/A 'dsInstanceDn' : "cn=Directory Manager",
3612N/A 'dsInstancePswd' : "kangourou",
3612N/A 'dsFilter' : 'objectclass=*',
3612N/A <
call function="'CheckMatches'">
3612N/A 'mainString' : STAXResult[0][1],
3612N/A <!-- 2. Uninstall options: quiet forceOnError remove-all--> 3612N/A <
message>'Uninstall options: quiet forceOnError remove-all'</
message>
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 Import options 3612N/A #@TestName Setup-Uninstall: import: 3612N/A #@TestID import_reject_skip 3612N/A #@TestPurpose Test the ability of the setup command to 3612N/A import LDAP entries and manage rejected and 5369N/A #@TestStep Unzip OpenDJ distribution 5369N/A Setup OpenDJ with a LDIF file to import, and 3612N/A files for rejected and skipped entries 3822N/A Check skipped and rejected entries 3612N/A #@TestResult PASS if all steps ran without errors 3612N/A <
testcase name="getTestCaseName('import_reject_skip')">
3612N/A IMP_I2_ROOT = '%s/%s' % (IMP_I2_BASE, OPENDSNAME)
3612N/A <
call function="'testCase_Preamble'"/>
3612N/A <
message>'Setup and Import: Reject / Skip entries'</
message>
3612N/A <!-- 1. Setup options: baseDN "o=o1" ldifFile rejectFile 3612N/A <
message>'Prepare Open DS ZIP (in %s)' % IMP_I2_ROOT</
message>
3612N/A <
call function="'runSTAFCommand'">
3612N/A { 'name' : 'Create directory to contain I2',
3612N/A 'location' : STAF_REMOTE_HOSTNAME,
3612N/A 'arguments' : 'DIRECTORY %s FAILIFEXISTS' % IMP_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' \
3690N/A % (DIRECTORY_INSTANCE_DIR, ZIPNAME, IMP_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,
3612N/A 'name' : 'Launch setup command for I2',
3612N/A <
call function="'runSTAFCommand'">
3612N/A { 'name' : 'Get content of reject file',
3612N/A 'location' : STAF_REMOTE_HOSTNAME,
3612N/A 'arguments' : 'FILE %s TEXT' % IMP_REJECT_FILE
3612N/A <
call function="'checktestRC'">
3612N/A 'result' : 'FAIL to get content of reject file ',
3612N/A <
call function="'CheckMatches'">
3612N/A 'string2find' : 'violates',
3612N/A <
call function="'runSTAFCommand'">
3612N/A { 'name' : 'Get content of skip file',
3612N/A 'location' : STAF_REMOTE_HOSTNAME,
3612N/A 'arguments' : 'FILE %s TEXT' % IMP_SKIP_FILE
3612N/A <
call function="'checktestRC'">
3612N/A 'result' : 'FAIL to get content of skip file ',
3612N/A <
call function="'CheckMatches'">
3612N/A 'string2find' : 'Skipping',
3612N/A <
call function="'ldapSearchWithScript'">
3612N/A { 'dsInstancePort' : IMP_I2_PORT,
3612N/A 'dsInstancePswd' : "kangourou",
3612N/A 'dsFilter' : 'objectclass=*',
3612N/A <
call function="'CheckMatches'">
3612N/A 'mainString' : STAXResult[0][1],
3612N/A <
message>'Stop DS'</
message>
3612N/A <
call function="'StopDsWithScript'">
3853N/A { 'location' : STAF_REMOTE_HOSTNAME,
3853N/A 'dsPath' : '%s' % IMP_I2_ROOT,
3853N/A 'dsAdminPort' : IMP_I2_ADMIN_PORT,
3612N/A <!-- 3. Uninstall options: verbose forceOnError remove-all 3612N/A 'Uninstall opts: verbose forceOnError remove-all noPropertiesFile'
3612N/A <
message>'%s %s' % (c, p)</
message>
3612N/A <
call function="'runCommand'">
3612N/A { 'location' : STAF_REMOTE_HOSTNAME,
3612N/A <!-- Do some post-uninstall checks --> 3612N/A <
message>'Do some post-uninstall checks'</
message>
3612N/A <
call function="'runSTAFCommand'">
3612N/A { 'name' : 'Get content of skip file',
3612N/A 'location' : STAF_REMOTE_HOSTNAME,
3612N/A 'arguments' : 'DIRECTORY %s' % IMP_I2_ROOT
3612N/A <
call function="'checktestRC'">
3612N/A 'result' : 'FAIL to get content of install directory',
4865N/A if is_windows_platform(STAF_REMOTE_HOSTNAME):
4865N/A if is_windows_platform(STAF_REMOTE_HOSTNAME):
3612N/A <
call function="'checktestRC'">
3612N/A <call function="'checktestRC'"> 3612N/A <
call function="'testCase_Postamble'"/>
3612N/A <
call function="'testSuite_Postamble'"/>