|
1 // |
|
2 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 // All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of the License "Eclipse Public License v1.0" |
|
6 // which accompanies this distribution, and is available |
|
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 // |
|
9 // Initial Contributors: |
|
10 // Nokia Corporation - initial contribution. |
|
11 // |
|
12 // Contributors: |
|
13 // |
|
14 // Description: |
|
15 // |
|
16 // Streaming CAF IpSec Unit Tests |
|
17 |
|
18 PRINT Run PREQ782 Streaming CAF IpSec Unit Tests |
|
19 |
|
20 // Load Suite |
|
21 LOAD_SUITE tscaf |
|
22 |
|
23 //! @SYMTestCaseID SEC-SCAF-E001 |
|
24 //! @SYMTestCaseDesc Smoke testing for IPSec plugin |
|
25 //! (ipsec_positiveconstruct) |
|
26 //! @SYMPREQ PREQ782 |
|
27 //! @SYMREQ REQ7779 |
|
28 //! @SYMTestPriority Critical |
|
29 //! @SYMTestStatus Implemented |
|
30 //! @SYMTestActions |
|
31 //! • Generate a IPSec protected key stream description. |
|
32 //! • Create a key stream sink from the protected key stream description. |
|
33 //! • Create an IPSec key association. |
|
34 //! • Supply the key association to the IPSec key stream sink. |
|
35 //! |
|
36 //! @SYMTestExpectedResults • Interfaces are invoked without leaves and panics. |
|
37 //! @SYMTestType CIT |
|
38 |
|
39 START_TESTCASE SEC-SCAF-E001 |
|
40 RUN_TEST_STEP 100 tscaf SCAFIpSec z:\tcaf\tscaf\tscaf.ini ipsec_positiveconstruct |
|
41 END_TESTCASE SEC-SCAF-E001 |
|
42 |
|
43 //! @SYMTestCaseID SEC-SCAF-E002 |
|
44 //! @SYMTestCaseDesc Testing SADB integration |
|
45 //! (ipsec_verify_sadb) |
|
46 //! @SYMPREQ PREQ782 |
|
47 //! @SYMREQ REQ7779 |
|
48 //! @SYMTestPriority Critical |
|
49 //! @SYMTestStatus Implemented |
|
50 //! @SYMTestActions |
|
51 //! • Same as with SEC-SCAF-E001. Take care to create a key association with a known SPI - SPI x. |
|
52 //! • Query the SADB with SADB_GET message on SPI x. |
|
53 //! • Submit another key association through IPSec with SPI y. |
|
54 //! • Query the SADB to verify that the SPI was submitted correctly. |
|
55 |
|
56 //! @SYMTestExpectedResults • Expected SA entries match when queried from SADB. |
|
57 //! @SYMTestType CIT |
|
58 |
|
59 START_TESTCASE SEC-SCAF-E002 |
|
60 RUN_TEST_STEP 100 tscaf SCAFIpSecSadbVerification z:\tcaf\tscaf\tscaf.ini ipsec_verify_sadb |
|
61 END_TESTCASE SEC-SCAF-E002 |
|
62 |
|
63 //! @SYMTestCaseID SEC-SCAF-E003 |
|
64 //! @SYMTestCaseDesc Testing SADB integration under concurrency |
|
65 //! (ipsec_verify_sadb_concurrency) |
|
66 //! @SYMPREQ PREQ782 |
|
67 //! @SYMREQ REQ7779 |
|
68 //! @SYMTestPriority High |
|
69 //! @SYMTestStatus Implemented |
|
70 //! @SYMTestActions |
|
71 //! • Same as with SEC-SCAF-E002, but using multiple threads - each hosting a different key stream sink. Different SPI values must be used in each key stream sink to avoid collisions in the SADB. |
|
72 //! @SYMTestExpectedResults • Expected SA entries match when queried from SADB. |
|
73 //! @SYMTestType CIT |
|
74 |
|
75 START_TESTCASE SEC-SCAF-E003 |
|
76 RUN_TEST_STEP 200 tscaf SCAFIpSecSadbVerificationConcurrency z:\tcaf\tscaf\tscaf.ini ipsec_verify_sadb_concurrency |
|
77 END_TESTCASE SEC-SCAF-E003 |
|
78 |
|
79 //! @SYMTestCaseID SEC-SCAF-E007 |
|
80 //! @SYMTestCaseDesc Negative testing for IPSec components |
|
81 //! (ipsec_negative) |
|
82 //! @SYMPREQ PREQ782 |
|
83 //! @SYMREQ REQ7779 |
|
84 //! @SYMTestPriority High |
|
85 //! @SYMTestStatus Implemented |
|
86 //! @SYMTestActions |
|
87 //! • Create an IPSec key stream sink as detailed in SEC-SCAF-A001. |
|
88 //! • Create an IPSec key association with incorrect keys. |
|
89 //! • Submit it to key stream sink - step A. |
|
90 //! • Create a non-IPSec key association. |
|
91 //! • Submit it to key stream sink - step B. |
|
92 //! • Delete the key stream sink. |
|
93 //! • Try adding twice the same valid key association again - step C. The second key association addition should fail. |
|
94 //! @SYMTestExpectedResults • Proper errors are returned in all steps. |
|
95 //! @SYMTestType CIT |
|
96 |
|
97 START_TESTCASE SEC-SCAF-E007 |
|
98 RUN_TEST_STEP 100 tscaf SCAFIpSecNegative z:\tcaf\tscaf\tscaf.ini ipsec_negative |
|
99 END_TESTCASE SEC-SCAF-E007 |
|
100 |
|
101 //! @SYMTestCaseID SEC-SCAF-E009 |
|
102 //! @SYMTestCaseDesc SA Removal |
|
103 //! (ipsec_sa_removal) |
|
104 //! @SYMPREQ PREQ782 |
|
105 //! @SYMREQ REQ7779 |
|
106 //! @SYMTestPriority High |
|
107 //! @SYMTestStatus Implemented |
|
108 //! @SYMTestActions |
|
109 //! • Create an IPSec key stream sink as detailed in SEC-SCAF-A001. |
|
110 //! • Submit 10 different key associations - all with different SPI-s. |
|
111 //! • Query the SADB. |
|
112 //! @SYMTestExpectedResults • Only the last 3 SA-s should be present in the SADB. The first 7 must not be present. The number 3 is a source constant - KDefaulMaxSpiNumber. |
|
113 //! @SYMTestType CIT |
|
114 |
|
115 START_TESTCASE SEC-SCAF-E009 |
|
116 RUN_TEST_STEP 100 tscaf SCAFIpSecSARemoval z:\tcaf\tscaf\tscaf.ini ipsec_sa_removal |
|
117 END_TESTCASE SEC-SCAF-E009 |
|
118 |
|
119 //! @SYMTestCaseID SEC-SCAF-E010 |
|
120 //! @SYMTestCaseDesc Change of algorithms |
|
121 //! (ipsec_algorithm_change) |
|
122 //! @SYMPREQ PREQ782 |
|
123 //! @SYMREQ REQ7779 |
|
124 //! @SYMTestPriority Medium |
|
125 //! @SYMTestStatus Implemented |
|
126 //! @SYMTestActions |
|
127 //! • Create an IPSec key stream sink as detailed in SEC-SCAF-A001. |
|
128 //! • Submit an IPSec key association with arbitrary parameters. |
|
129 //! • Try changing the encryption algorithm. |
|
130 //! • Repeat the previous steps, while trying to change the authentication algorithm. |
|
131 //! @SYMTestExpectedResults • KErrNotSupported should be returned each time. |
|
132 //! @SYMTestType CIT |
|
133 |
|
134 START_TESTCASE SEC-SCAF-E010 |
|
135 RUN_TEST_STEP 100 tscaf SCAFIpSecAlgorithmChange z:\tcaf\tscaf\tscaf.ini ipsec_algorithm_change |
|
136 END_TESTCASE SEC-SCAF-E010 |
|
137 |
|
138 //! @SYMTestCaseID SEC-SCAF-E011 |
|
139 //! @SYMTestCaseDesc IPSec - no authentication |
|
140 //! (ipsec_no_authentication) |
|
141 //! @SYMPREQ PREQ782 |
|
142 //! @SYMREQ REQ7779 |
|
143 //! @SYMTestPriority High |
|
144 //! @SYMTestStatus Implemented |
|
145 //! @SYMTestActions |
|
146 //! • Create an IPSec key stream sink as detailed in SEC-SCAF-A001. |
|
147 //! • Do not use authentication. |
|
148 //! • Submit a key association. |
|
149 //! • Query the SADB on the key association. |
|
150 |
|
151 //! @SYMTestExpectedResults • The key association should be in SADB. |
|
152 //! @SYMTestType CIT |
|
153 |
|
154 START_TESTCASE SEC-SCAF-E011 |
|
155 RUN_TEST_STEP 100 tscaf SCAFIpSecSadbVerification z:\tcaf\tscaf\tscaf.ini ipsec_no_authentication |
|
156 END_TESTCASE SEC-SCAF-E011 |
|
157 |
|
158 |
|
159 //! @SYMTestCaseID SEC-SCAF-E013 |
|
160 //! @SYMTestCaseDesc IPSec - unsupported algorithms |
|
161 //! (ipsec_unsupported_algorithms) |
|
162 //! @SYMPREQ PREQ782 |
|
163 //! @SYMREQ REQ7779 |
|
164 //! @SYMTestPriority High |
|
165 //! @SYMTestStatus Implemented |
|
166 //! @SYMTestActions |
|
167 //! • Create an IPSec key stream sink as detailed in SEC-SCAF-A001. |
|
168 //! • Try setting any encryption algorithm which is not AES-CBC. |
|
169 //! • Try setting any authentication algorithm which is not NULL or HMAC-SHA1. |
|
170 //! @SYMTestExpectedResults • KErrNotSupported should be returned each time. |
|
171 //! @SYMTestType CIT |
|
172 |
|
173 START_TESTCASE SEC-SCAF-E013 |
|
174 RUN_TEST_STEP !Result=-5 100 tscaf SCAFIpSec z:\tcaf\tscaf\tscaf.ini ipsec_wrong_enc_algorithm1 |
|
175 RUN_TEST_STEP !Result=-5 100 tscaf SCAFIpSec z:\tcaf\tscaf\tscaf.ini ipsec_wrong_enc_algorithm2 |
|
176 RUN_TEST_STEP !Result=-5 100 tscaf SCAFIpSec z:\tcaf\tscaf\tscaf.ini ipsec_wrong_enc_algorithm3 |
|
177 RUN_TEST_STEP !Result=-5 100 tscaf SCAFIpSec z:\tcaf\tscaf\tscaf.ini ipsec_wrong_auth_algorithm |
|
178 END_TESTCASE SEC-SCAF-E013 |
|
179 |
|
180 |
|
181 //! @SYMTestCaseID SEC-SCAF-E014 |
|
182 //! @SYMTestCaseDesc Multiple IPSec key stream sinks |
|
183 //! (ipsec_multiple_sinks) |
|
184 //! @SYMPREQ PREQ782 |
|
185 //! @SYMREQ REQ7779 |
|
186 //! @SYMTestPriority High |
|
187 //! @SYMTestStatus Implemented |
|
188 //! @SYMTestActions |
|
189 //! • Same as with SEC-SCAF-E002, but using a separate key stream sink for each association. |
|
190 |
|
191 //! @SYMTestExpectedResults • Expected SA entries match when queried from SADB. |
|
192 //! @SYMTestType CIT |
|
193 |
|
194 START_TESTCASE SEC-SCAF-E014 |
|
195 RUN_TEST_STEP 200 tscaf SCAFIpSecMultipleSinks z:\tcaf\tscaf\tscaf.ini ipsec_multiple_sinks |
|
196 END_TESTCASE SEC-SCAF-E014 |
|
197 |
|
198 //! @SYMTestCaseID SEC-SCAF-E015 |
|
199 //! @SYMTestCaseDesc Testing IPSec integration with key stream decoder - automatic |
|
200 //! (ipsec_integration_decoder_automatic) |
|
201 //! @SYMPREQ PREQ782 |
|
202 //! @SYMREQ REQ7779 |
|
203 //! @SYMTestPriority High |
|
204 //! @SYMTestStatus Implemented |
|
205 //! @SYMTestActions |
|
206 //! • Create manually a test agent key stream decoder using SDP information |
|
207 //! • Take care to supply an IPSec key stream sink as detailed in SEC-SCAF-E001. |
|
208 //! • Send the key association for the test agent. The key association is as defined in step SEC-SCAF-E004. |
|
209 //! • Verify with SADB_GET that associations was added |
|
210 //! |
|
211 //! @SYMTestExpectedResults • Associations was added |
|
212 //! @SYMTestType CIT |
|
213 |
|
214 START_TESTCASE SEC-SCAF-E015 |
|
215 RUN_TEST_STEP tscaf SCAFSetupRightsObjects z:\tcaf\tscaf\tscaf.ini Rights_Program |
|
216 // The time limit is disabled since this test is manual |
|
217 RUN_TEST_STEP -1 tscaf SCAFIpSecDecoderIntegration z:\tcaf\tscaf\tscaf.ini ipsec_integration_decoder_automatic |
|
218 END_TESTCASE SEC-SCAF-E015 |