3361N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
3361N/A ! The contents of this file are subject to the terms of the 3361N/A ! Common Development and Distribution License, Version 1.0 only 3361N/A ! (the "License"). You may not use this file except in compliance 3361N/A ! You can obtain a copy of the license at 3361N/A ! See the License for the specific language governing permissions 3361N/A ! and limitations under the License. 3361N/A ! When distributing Covered Code, include this CDDL HEADER in each 3361N/A ! file and include the License file at 3361N/A ! add the following below this CDDL HEADER, with the fields enclosed 3361N/A ! by brackets "[]" replaced with your own identifying information: 3361N/A ! Portions Copyright [yyyy] [name of copyright owner] 4134N/A ! Portions Copyright 2008-2009 Sun Microsystems, Inc. 3361N/A <
defaultcall function="dsml_test" />
3361N/A <
function name="dsml_test">
4092N/A <!--- Test Suite information 4092N/A #@TestSuitePurpose test for the dsml test suite. 4092N/A CurrentTestPath['group'] = 'dsml'
4092N/A CurrentTestPath['suite'] = STAXCurrentBlock
4092N/A <
call function="'testSuite_Preamble'"/>
4495N/A <
import machine="STAF_LOCAL_HOSTNAME" 4495N/A <
call function="'dsml_setup'"/>
4092N/A <!--- Test Case information 4092N/A #@TestName test: test webcontainer 4092N/A #@TestPurpose test webcontainer responding necessary to the 4092N/A #@TestSteps get the list of DSML test family 4092N/A #@TestResult Success if returns 0. 4092N/A <
message>'List DSML suites families'</
message>
3949N/A <
call function="'runSTAFCommand'">
4092N/A { 'name' : 'list DSML suites families',
3949N/A 'location' : STAXServiceMachine,
3949N/A 'request' : 'LIST DIRECTORY',
4092N/A # The subversion folder could be present, if so remove it
4662N/A print "List element genericIssues does not exist"
4092N/A print "List element .svn does not exist"
4662N/A <
message>'dsml list of suites %s' % familyList</
message>
4662N/A <
message>'getting the list of generic known Issues spanning multiple tests'</
message>
4662N/A <
call function="'runSTAFCommand'">
4662N/A { 'name' : 'list known generic issues',
4662N/A 'location' : STAXServiceMachine,
4662N/A 'request' : 'LIST DIRECTORY',
4092N/A <
message>'DSML familyList = %s' % familyList</
message>
4092N/A <
iterate var="family" in="familyList">
4092N/A <
message>'DSML family %s ' % family</
message>
4092N/A <
call function="'runSTAFCommand'">
4092N/A { 'name' : 'List DSML suite %s input' % family,
4092N/A 'location' : STAXServiceMachine,
4092N/A 'request' : 'LIST DIRECTORY',
4092N/A <
call function="'runSTAFCommand'">
4092N/A { 'name' : 'List DSML suite %s expected results' % family,
4092N/A 'location' : STAXServiceMachine,
4092N/A 'request' : 'LIST DIRECTORY',
4092N/A familyExpected = STAFResult
4092N/A <
iterate var="test" in="familyInput">
4092N/A <
testcase name="getTestCaseName('%s-%s' % (family,test))">
4092N/A 'Test Name = %s' % STAXCurrentTestcase
4092N/A <
call function="'testCase_Preamble'"/>
4092N/A <
call function="'runSTAFCommand'">
4092N/A { 'name' : 'List DSML suite %s file %s' % (family,test),
4092N/A 'location' : STAXServiceMachine,
4092N/A 'arguments' : requestFilePath
4092N/A (DIRECTORY_INSTANCE_DN,DIRECTORY_INSTANCE_PSWD)) , \
4092N/A SOAPHeaders = SOAPHeaders + 'HEADER ' + s[0] + '=' + s[1] + ' '
4092N/A <
call function="'runSTAFCommand'">
4092N/A { 'name' : 'Submit SOAPBody',
4092N/A 'location' : STAXServiceMachine,
4092N/A 'request' : 'REQUEST METHOD POST',
4092N/A 'arguments' : 'URL %s FOLLOWREDIRECT %s CONTENT %s RETURNHEADERS ' \
4092N/A % (url, SOAPHeaders, SOAPBody)
4092N/A <!-- Check the STAFResult is expected class type --> 5585N/A <
if expr='STAFResult.__class__ is not PyDictionary'>
4092N/A <
message log="1" level="'Error'">
5585N/A 'ERROR : Invalid result type (%s), requires PyDictionary.' % STAFResult.__class__
4092N/A 'Result not a PyDictionary object.'
4092N/A <
call function="'checktestRC'">
4092N/A <
if expr="result['statusCode'] == '200'">
4092N/A # writing the result file to compare with expected result
4092N/A httpHeaders = result['headers']
4092N/A httpContent = result['content']
4092N/A resultContent += result['statusCode'] + ' '
4092N/A resultContent += result['statusMessage'] + '\n'
4092N/A resultContent += '\n\n' + httpContent
4092N/A <
message>'Comparing result %s and expected result %s' % (runFilePath, expectedFilePath)</
message>
4092N/A <
call function="'runSTAFCommand'">
4092N/A { 'name' : 'Compare SOAPResult with expected result',
4092N/A 'location' : STAXServiceMachine,
4092N/A 'request' : 'COMPARE FILE',
4092N/A 'arguments' : '%s EXP_FILE %s' %(runFilePath, expectedFilePath)
4662N/A <
message>"check against test's known issues"</
message>
4662N/A <
call function="'runSTAFCommand'">
4662N/A { 'name' : 'list known issues for the test',
4662N/A 'location' : STAXServiceMachine,
4662N/A 'request' : 'LIST DIRECTORY',
4662N/A knownTestIssues = STAFResult
4662N/A <
message >'known Test Issues %s' % knownTestIssues</
message>
4662N/A <
if expr="len(knownTestIssues) > 0">
4662N/A <
iterate var="issueFile" in="knownTestIssues">
4662N/A # the issue number is the before last element of the '.' splited path
4662N/A <
call function="'runSTAFCommand'">
4662N/A { 'name' : 'check if known issue %s' % issue,
4662N/A 'location' : STAXServiceMachine,
4662N/A 'arguments' : 'FILE %s EXP_FILE %s' %(runFilePath, issueFilePath)
4662N/A <!-- this is a known issue --> 4662N/A <
call function="'setKnownIssue'">
4780N/A <
if expr="not foundKnownIssue and len(genericIssues) > 0">
4662N/A <
iterate var="issueFile" in="genericIssues">
4662N/A # the issue number is the before last element of the '.' splited path
4662N/A <
call function="'runSTAFCommand'">
4662N/A { 'name' : 'check if known generic issue %s' % issue,
4662N/A 'location' : STAXServiceMachine,
4662N/A 'arguments' : 'FILE %s EXP_FILE %s' %(runFilePath, issueFilePath)
4662N/A <!-- this is a known issue --> 4662N/A <
call function="'setKnownIssue'">
4780N/A <
if expr="not foundKnownIssue">
4780N/A <
message>'checking string marker issues in result'</
message>
4780N/A <
call function="'runSTAFCommand'">
4780N/A { 'name' : 'check if known issue %s' % issue,
4780N/A 'location' : STAXServiceMachine,
4780N/A 'request' : 'CHECK_ERROR_STRINGS',
4780N/A 'arguments' : 'FILE %s ' %(runFilePath)
4780N/A <
if expr="RC >= 100000000">
4780N/A <!-- string marked issues start from 100000000 --> 4780N/A <!-- this is a known issue --> 4780N/A <
call function="'setKnownIssue'">
4662N/A <
catch exception="'...'" typevar="eType" var="eInfo">
4662N/A <
message log="1" level="'fatal'">
4662N/A 'Test case (%s) failed. eType(%s),eInfo(%s)' % (STAXCurrentTestcase,eType,eInfo)
4662N/A <
tcstatus result="'fail'"/>
4092N/A <
call function="'checktestRC'">
4865N/A <
elseif expr="result['statusCode'] == '404'">
4865N/A <
call function="'checktestRC'">
4865N/A 'returncode' : result['statusCode'] ,
4865N/A 'result' : result['statusMessage'],
4092N/A <
call function="'checktestRC'">
4092N/A 'returncode' : result['statusCode'] ,
4092N/A 'result' : result['statusMessage']
4092N/A <
catch exception="'...'" typevar="eType" var="eInfo">
4092N/A <
message log="1" level="'fatal'">
4092N/A 'Test case (%s) failed. eType(%s),eInfo(%s)' % (STAXCurrentTestcase,eType,eInfo)
4092N/A <
tcstatus result="'fail'"/>
4092N/A <
call function="'testCase_Postamble'"/>
4495N/A <!-- Test Suite Cleanup --> 4495N/A <
message>'Finally: Global DSML Cleanup.'</
message>
4495N/A <
import machine="STAF_LOCAL_HOSTNAME" 4495N/A <
call function="'dsml_cleanup'"/>
4495N/A <
catch exception="'STAFException'">
4495N/A <
message log="1" level="'fatal'">'Cleanup of test suite failed.'</
message>
4495N/A <
call function="'testSuite_Postamble'"/>