usbmgmt/usbmgrtest/t_usbmanager_suite/T_UsbManager/scripts/t_usbmancomponent_1.script
changeset 0 c9bc50fca66e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usbmgmt/usbmgrtest/t_usbmanager_suite/T_UsbManager/scripts/t_usbmancomponent_1.script	Tue Feb 02 02:02:59 2010 +0200
@@ -0,0 +1,163 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// USBSRV   Component tests
+
+LOAD_SUITE T_UsbManagerServer
+
+RUN_UTILS MkDir C:\testdata\
+RUN_UTILS MkDir C:\testdata\config\
+RUN_UTILS CopyFile Z:\testdata\config\stub2cc.ini C:\testdata\config\stub2cc.ini
+RUN_UTILS MakeReadWrite C:\testdata\config\stub2cc.ini
+RUN_UTILS MkDir c:\private\
+RUN_UTILS MkDir c:\private\101fe1db\
+RUN_UTILS CopyFile Z:\private\101fe1db\usbman.r01 c:\private\101fe1db\usbman.r01
+RUN_UTILS MakeReadWrite c:\private\101fe1db\usbman.r01
+// Delay 3 seconds for RUN_UTILS to complete
+DELAY 3000
+
+//! @SYMTestCaseID T_LoadPersonalitiesListNormal
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Test Normal Case for startup USB Server and loading of personality list
+//! @SYMFssID USB/DynamicClassChange/1
+//! @SYMFssID USB/DynamicClassChange/1.3.1
+//! @SYMFssID USB/DynamicClassChange/1.1.1
+//! @SYMFssID USB/DynamicClassChange/1.2.2
+//! @SYMFssID USB/DynamicClassChange/1.2.3
+//! @SYMFssID USB/DynamicClassChange/1.2.3.1
+//! @SYMFssID USB/DynamicClassChange/1.2.5
+//! @SYMTestActions Create a new session with CUsbServer. It's cause creation of new 
+//! CUsbDevice object wich read personality list from resource file and validate them.
+//! @SYMTestExpectedResults The personality IDs requested from CUsbDevice should be equal to expected. 
+//! Each personality should have expected textual description and UID list of supported CCs  
+//! @SYMTestPriority Low
+//! @SYMTestStatus Defined
+START_TESTCASE T_LoadPersonalitiesListNormal
+RUN_TEST_STEP 100 T_UsbManagerServer CUsbLoadPersonalityNormal z:\testdata\config\t_usbmancomponent.ini UsbLoadPersonalityNormal
+END_TESTCASE T_LoadPersonalitiesListNormal
+
+//! @SYMTestCaseID T_LoadPersonalitiesListOOM
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Test startup USB Server and loading of personality list in OOM conditions
+//! @SYMFssID USB/DynamicClassChange/1
+//! @SYMFssID USB/DynamicClassChange/1.3.1
+//! @SYMFssID USB/DynamicClassChange/1.1.1
+//! @SYMFssID USB/DynamicClassChange/1.2.3
+//! @SYMFssID USB/DynamicClassChange/1.2.5
+//! @SYMTestActions Try to create a new session with CUsbServer in OOM conditions. It's cause creation of new 
+//! CUsbDevice object which read personality list from recourse file and validate them.
+//! @SYMTestExpectedResults Until OOM condition is present RUsb::Conect() method  should fail with KErrNoMemory. 
+//! After removing OOM conditions the personality IDs requested from CUsbDevice should equal to expected. 
+//! Each personality should have expected textual description and list of supported CCs 
+//! @SYMTestPriority Low
+//! @SYMTestStatus Defined
+START_TESTCASE T_LoadPersonalitiesListOOM
+RUN_TEST_STEP 100 T_UsbManagerServer CUsbTestOOM z:\testdata\config\t_usbmancomponent.ini UsbTestOOM 
+END_TESTCASE T_LoadPersonalitiesListOOM 
+
+//! @SYMTestCaseID T_SwitchPersonalityNormal
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Test personality switching
+//! @SYMFssID USB/DynamicClassChange/1
+//! @SYMFssID USB/DynamicClassChange/1.2.1
+//! @SYMFssID USB/DynamicClassChange/1.2.4
+//! @SYMFssID USB/DynamicClassChange/1.2.5
+//! @SYMTestActions Create a new session with CUsbServer. Compare ID, PID, VID, CC UIDs and description of current personality with expected data. Switch personality and check parameters again.
+//! @SYMTestExpectedResults All gotten parameters should match with expected data. 
+//! @SYMTestPriority Low
+//! @SYMTestStatus Defined
+START_TESTCASE T_SwitchPersonalityNormal
+RUN_TEST_STEP 100 T_UsbManagerServer CUsbSwitchPersonalityNormal z:\testdata\config\t_usbmancomponent.ini UsbSwitchPersonalityNormal 
+END_TESTCASE T_SwitchPersonalityNormal  
+
+//! @SYMTestCaseID T_StartStopPersonality1
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Test start/stop personality with normal CCs and then with failed to start CC
+//! @SYMFssID USB/DynamicClassChange/1
+//! @SYMFssID USB/DynamicClassChange/1.3.3
+//! @SYMFssID USB/DynamicClassChange/1.4.2
+//! @SYMTestActions Create a new session with USB server, Issue TryStart request, try to change personality then TryStop. Switch to personality wich has "failure" stub CC.
+//! Try to start this personality
+//! @SYMTestExpectedResults The first TryStart request should be completed successfully.
+//! The attempt to switch personality should fail. The second TryStart request should return error code signaling about problem with starting CC.
+//! @SYMTestPriority Low
+//! @SYMTestStatus Defined
+START_TESTCASE T_StartStopPersonality1
+RUN_UTILS DeleteFile C:\testdata\config\stub1cc.ini
+RUN_UTILS CopyFile Z:\testdata\config\stub1cctest.ini C:\testdata\config\stub1cc.ini
+RUN_UTILS MakeReadWrite C:\testdata\config\stub1cc.ini
+DELAY 1000
+RUN_TEST_STEP 100 T_UsbManagerServer CUsbStartStopPersonality1 z:\testdata\config\t_usbmancomponent.ini UsbStartStopPersonality1
+RUN_UTILS DeleteFile C:\testdata\config\stub1cc.ini
+DELAY 1000
+END_TESTCASE T_StartStopPersonality1
+
+//! @SYMTestCaseID T_StartStopPersonality2
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Test start/stop personality at different USB server's states using TryStart/TryStop methods
+//! @SYMFssID USB/DynamicClassChange/1
+//! @SYMFssID USB/DynamicClassChange/1.3.3
+//! @SYMFssID USB/DynamicClassChange/1.4.2
+//! @SYMTestActions Create a new session with USB server, Issue TryStart and TryStop requests at all possible server's states.
+//! @SYMTestExpectedResults The requests should be succeeded or failed according to the "State Transition Diagram" chapter from 
+//! the "USB Design Document for PREQ 543"
+//! @SYMTestPriority Low
+//! @SYMTestStatus Defined
+START_TESTCASE T_StartStopPersonality2
+RUN_TEST_STEP 100 T_UsbManagerServer CUsbStartStopPersonality2 z:\testdata\config\t_usbmancomponent.ini UsbStartStopPersonality2 
+END_TESTCASE T_StartStopPersonality2 
+
+//! @SYMTestCaseID T_StartStopPersonality3
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Test start/stop personality at different USB server's states using Start/Stop methods
+//! @SYMFssID USB/DynamicClassChange/1
+//! @SYMFssID USB/DynamicClassChange/1.3.2
+//! @SYMFssID USB/DynamicClassChange/1.4.1
+//! @SYMTestActions Create a new session with USB server, Issue Start and Stop requests at all possible server's states and check state of the USB server.
+//! @SYMTestExpectedResults The requests should be succeeded, a finale state of USB manager after each request should be as requested. 
+//! @SYMTestPriority Low
+//! @SYMTestStatus Defined
+START_TESTCASE T_StartStopPersonality3
+RUN_TEST_STEP 100 T_UsbManagerServer CUsbStartStopPersonality3 z:\testdata\config\t_usbmancomponent.ini UsbStartStopPersonality3 
+END_TESTCASE T_StartStopPersonality3  
+
+
+//! @SYMTestCaseID T_SwitchPersonalityAbNormal
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Test personality switching
+//! @SYMFssID USB/DynamicClassChange/1
+//! @SYMFssID USB/DynamicClassChange/1.2.1
+//! @SYMFssID USB/DynamicClassChange/1.2.4
+//! @SYMFssID USB/DynamicClassChange/1.2.5
+//! @SYMTestActions Create a new session with CUsbServer. Compare ID, PID, VID, CC UIDs and description of current personality with expected data. Switch personality and check parameters again.
+//! @SYMTestExpectedResults All gotten parameters should match with expected data. 
+//! @SYMTestPriority Low
+//! @SYMTestStatus Defined
+START_TESTCASE T_SwitchPersonalityAbNormal
+RUN_TEST_STEP 100 T_UsbManagerServer CUsbSwitchPersonalityAbNormal z:\testdata\config\t_usbmancomponent.ini UsbSwitchPersonalityAbNormal 
+END_TESTCASE T_SwitchPersonalityAbNormal  
+
+
+//! @SYMTestCaseID T_MemoryAllocationFailure
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Test handling of memory allocation failure
+//! @SYMFssID USB/DynamicClassChange/1
+//! @SYMFssID USB/DynamicClassChange/1.3.1
+//! @SYMTestActions Create a session with  CUsbServer. Call __UHEAP_FAILNEXT(1) and then call APIs
+//! that requirement memory allocation. 
+//! @SYMTestExpectedResults all calls should return KErrNoMemory
+//! @SYMTestPriority Low
+//! @SYMTestStatus Defined
+START_TESTCASE T_MemoryAllocationFailure
+RUN_TEST_STEP 100 T_UsbManagerServer CMemAllocationFailure
+END_TESTCASE T_MemoryAllocationFailure