|
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // USBSRV Component tests |
|
15 |
|
16 LOAD_SUITE T_UsbManagerServer |
|
17 |
|
18 RUN_UTILS MkDir C:\testdata\ |
|
19 RUN_UTILS MkDir C:\testdata\config\ |
|
20 RUN_UTILS CopyFile Z:\testdata\config\stub2cc.ini C:\testdata\config\stub2cc.ini |
|
21 RUN_UTILS MakeReadWrite C:\testdata\config\stub2cc.ini |
|
22 RUN_UTILS MkDir c:\private\ |
|
23 RUN_UTILS MkDir c:\private\101fe1db\ |
|
24 RUN_UTILS CopyFile Z:\private\101fe1db\usbman.r01 c:\private\101fe1db\usbman.r01 |
|
25 RUN_UTILS MakeReadWrite c:\private\101fe1db\usbman.r01 |
|
26 // Delay 3 seconds for RUN_UTILS to complete |
|
27 DELAY 3000 |
|
28 |
|
29 //! @SYMTestCaseID T_LoadPersonalitiesListNormal |
|
30 //! @SYMTestType CT |
|
31 //! @SYMTestCaseDesc Test Normal Case for startup USB Server and loading of personality list |
|
32 //! @SYMFssID USB/DynamicClassChange/1 |
|
33 //! @SYMFssID USB/DynamicClassChange/1.3.1 |
|
34 //! @SYMFssID USB/DynamicClassChange/1.1.1 |
|
35 //! @SYMFssID USB/DynamicClassChange/1.2.2 |
|
36 //! @SYMFssID USB/DynamicClassChange/1.2.3 |
|
37 //! @SYMFssID USB/DynamicClassChange/1.2.3.1 |
|
38 //! @SYMFssID USB/DynamicClassChange/1.2.5 |
|
39 //! @SYMTestActions Create a new session with CUsbServer. It's cause creation of new |
|
40 //! CUsbDevice object wich read personality list from resource file and validate them. |
|
41 //! @SYMTestExpectedResults The personality IDs requested from CUsbDevice should be equal to expected. |
|
42 //! Each personality should have expected textual description and UID list of supported CCs |
|
43 //! @SYMTestPriority Low |
|
44 //! @SYMTestStatus Defined |
|
45 START_TESTCASE T_LoadPersonalitiesListNormal |
|
46 RUN_TEST_STEP 100 T_UsbManagerServer CUsbLoadPersonalityNormal z:\testdata\config\t_usbmancomponent.ini UsbLoadPersonalityNormal |
|
47 END_TESTCASE T_LoadPersonalitiesListNormal |
|
48 |
|
49 //! @SYMTestCaseID T_LoadPersonalitiesListOOM |
|
50 //! @SYMTestType CT |
|
51 //! @SYMTestCaseDesc Test startup USB Server and loading of personality list in OOM conditions |
|
52 //! @SYMFssID USB/DynamicClassChange/1 |
|
53 //! @SYMFssID USB/DynamicClassChange/1.3.1 |
|
54 //! @SYMFssID USB/DynamicClassChange/1.1.1 |
|
55 //! @SYMFssID USB/DynamicClassChange/1.2.3 |
|
56 //! @SYMFssID USB/DynamicClassChange/1.2.5 |
|
57 //! @SYMTestActions Try to create a new session with CUsbServer in OOM conditions. It's cause creation of new |
|
58 //! CUsbDevice object which read personality list from recourse file and validate them. |
|
59 //! @SYMTestExpectedResults Until OOM condition is present RUsb::Conect() method should fail with KErrNoMemory. |
|
60 //! After removing OOM conditions the personality IDs requested from CUsbDevice should equal to expected. |
|
61 //! Each personality should have expected textual description and list of supported CCs |
|
62 //! @SYMTestPriority Low |
|
63 //! @SYMTestStatus Defined |
|
64 START_TESTCASE T_LoadPersonalitiesListOOM |
|
65 RUN_TEST_STEP 100 T_UsbManagerServer CUsbTestOOM z:\testdata\config\t_usbmancomponent.ini UsbTestOOM |
|
66 END_TESTCASE T_LoadPersonalitiesListOOM |
|
67 |
|
68 //! @SYMTestCaseID T_SwitchPersonalityNormal |
|
69 //! @SYMTestType CT |
|
70 //! @SYMTestCaseDesc Test personality switching |
|
71 //! @SYMFssID USB/DynamicClassChange/1 |
|
72 //! @SYMFssID USB/DynamicClassChange/1.2.1 |
|
73 //! @SYMFssID USB/DynamicClassChange/1.2.4 |
|
74 //! @SYMFssID USB/DynamicClassChange/1.2.5 |
|
75 //! @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. |
|
76 //! @SYMTestExpectedResults All gotten parameters should match with expected data. |
|
77 //! @SYMTestPriority Low |
|
78 //! @SYMTestStatus Defined |
|
79 START_TESTCASE T_SwitchPersonalityNormal |
|
80 RUN_TEST_STEP 100 T_UsbManagerServer CUsbSwitchPersonalityNormal z:\testdata\config\t_usbmancomponent.ini UsbSwitchPersonalityNormal |
|
81 END_TESTCASE T_SwitchPersonalityNormal |
|
82 |
|
83 //! @SYMTestCaseID T_StartStopPersonality1 |
|
84 //! @SYMTestType CT |
|
85 //! @SYMTestCaseDesc Test start/stop personality with normal CCs and then with failed to start CC |
|
86 //! @SYMFssID USB/DynamicClassChange/1 |
|
87 //! @SYMFssID USB/DynamicClassChange/1.3.3 |
|
88 //! @SYMFssID USB/DynamicClassChange/1.4.2 |
|
89 //! @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. |
|
90 //! Try to start this personality |
|
91 //! @SYMTestExpectedResults The first TryStart request should be completed successfully. |
|
92 //! The attempt to switch personality should fail. The second TryStart request should return error code signaling about problem with starting CC. |
|
93 //! @SYMTestPriority Low |
|
94 //! @SYMTestStatus Defined |
|
95 START_TESTCASE T_StartStopPersonality1 |
|
96 RUN_UTILS DeleteFile C:\testdata\config\stub1cc.ini |
|
97 RUN_UTILS CopyFile Z:\testdata\config\stub1cctest.ini C:\testdata\config\stub1cc.ini |
|
98 RUN_UTILS MakeReadWrite C:\testdata\config\stub1cc.ini |
|
99 DELAY 1000 |
|
100 RUN_TEST_STEP 100 T_UsbManagerServer CUsbStartStopPersonality1 z:\testdata\config\t_usbmancomponent.ini UsbStartStopPersonality1 |
|
101 RUN_UTILS DeleteFile C:\testdata\config\stub1cc.ini |
|
102 DELAY 1000 |
|
103 END_TESTCASE T_StartStopPersonality1 |
|
104 |
|
105 //! @SYMTestCaseID T_StartStopPersonality2 |
|
106 //! @SYMTestType CT |
|
107 //! @SYMTestCaseDesc Test start/stop personality at different USB server's states using TryStart/TryStop methods |
|
108 //! @SYMFssID USB/DynamicClassChange/1 |
|
109 //! @SYMFssID USB/DynamicClassChange/1.3.3 |
|
110 //! @SYMFssID USB/DynamicClassChange/1.4.2 |
|
111 //! @SYMTestActions Create a new session with USB server, Issue TryStart and TryStop requests at all possible server's states. |
|
112 //! @SYMTestExpectedResults The requests should be succeeded or failed according to the "State Transition Diagram" chapter from |
|
113 //! the "USB Design Document for PREQ 543" |
|
114 //! @SYMTestPriority Low |
|
115 //! @SYMTestStatus Defined |
|
116 START_TESTCASE T_StartStopPersonality2 |
|
117 RUN_TEST_STEP 100 T_UsbManagerServer CUsbStartStopPersonality2 z:\testdata\config\t_usbmancomponent.ini UsbStartStopPersonality2 |
|
118 END_TESTCASE T_StartStopPersonality2 |
|
119 |
|
120 //! @SYMTestCaseID T_StartStopPersonality3 |
|
121 //! @SYMTestType CT |
|
122 //! @SYMTestCaseDesc Test start/stop personality at different USB server's states using Start/Stop methods |
|
123 //! @SYMFssID USB/DynamicClassChange/1 |
|
124 //! @SYMFssID USB/DynamicClassChange/1.3.2 |
|
125 //! @SYMFssID USB/DynamicClassChange/1.4.1 |
|
126 //! @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. |
|
127 //! @SYMTestExpectedResults The requests should be succeeded, a finale state of USB manager after each request should be as requested. |
|
128 //! @SYMTestPriority Low |
|
129 //! @SYMTestStatus Defined |
|
130 START_TESTCASE T_StartStopPersonality3 |
|
131 RUN_TEST_STEP 100 T_UsbManagerServer CUsbStartStopPersonality3 z:\testdata\config\t_usbmancomponent.ini UsbStartStopPersonality3 |
|
132 END_TESTCASE T_StartStopPersonality3 |
|
133 |
|
134 |
|
135 //! @SYMTestCaseID T_SwitchPersonalityAbNormal |
|
136 //! @SYMTestType CT |
|
137 //! @SYMTestCaseDesc Test personality switching |
|
138 //! @SYMFssID USB/DynamicClassChange/1 |
|
139 //! @SYMFssID USB/DynamicClassChange/1.2.1 |
|
140 //! @SYMFssID USB/DynamicClassChange/1.2.4 |
|
141 //! @SYMFssID USB/DynamicClassChange/1.2.5 |
|
142 //! @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. |
|
143 //! @SYMTestExpectedResults All gotten parameters should match with expected data. |
|
144 //! @SYMTestPriority Low |
|
145 //! @SYMTestStatus Defined |
|
146 START_TESTCASE T_SwitchPersonalityAbNormal |
|
147 RUN_TEST_STEP 100 T_UsbManagerServer CUsbSwitchPersonalityAbNormal z:\testdata\config\t_usbmancomponent.ini UsbSwitchPersonalityAbNormal |
|
148 END_TESTCASE T_SwitchPersonalityAbNormal |
|
149 |
|
150 |
|
151 //! @SYMTestCaseID T_MemoryAllocationFailure |
|
152 //! @SYMTestType CT |
|
153 //! @SYMTestCaseDesc Test handling of memory allocation failure |
|
154 //! @SYMFssID USB/DynamicClassChange/1 |
|
155 //! @SYMFssID USB/DynamicClassChange/1.3.1 |
|
156 //! @SYMTestActions Create a session with CUsbServer. Call __UHEAP_FAILNEXT(1) and then call APIs |
|
157 //! that requirement memory allocation. |
|
158 //! @SYMTestExpectedResults all calls should return KErrNoMemory |
|
159 //! @SYMTestPriority Low |
|
160 //! @SYMTestStatus Defined |
|
161 START_TESTCASE T_MemoryAllocationFailure |
|
162 RUN_TEST_STEP 100 T_UsbManagerServer CMemAllocationFailure |
|
163 END_TESTCASE T_MemoryAllocationFailure |