changeset 8 | 35751d3474b7 |
parent 0 | 2c201484c85f |
child 102 | deec7e509f66 |
2:675a964f4eb5 | 8:35751d3474b7 |
---|---|
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #include <iostream> |
19 #include <iostream> |
20 #include "certapp-api.h" |
20 #include <tools/certapp-api.h> |
21 #include "badconfigwriter.h" |
21 #include "badconfigwriter.h" |
22 #include "tcertapp_good.h" |
22 #include "tcertapp_good.h" |
23 #include "tcertapp_bad.h" |
23 #include "tcertapp_bad.h" |
24 #include "goodconfigwriter.h" |
24 #include "goodconfigwriter.h" |
25 #include <string> |
25 #include <string> |
26 #include <sstream> |
26 #include <sstream> |
27 #include <stdlib.h> |
27 #include <stdlib.h> |
28 #include <stdio.h> |
28 #include <stdio.h> |
29 #include <time.h> |
|
30 #include <sys\timeb.h> |
|
29 #include "logger.h" |
31 #include "logger.h" |
30 #include "utils.h" |
32 #include "utils.h" |
31 |
33 |
32 using namespace std; |
34 using namespace std; |
35 |
|
36 // Write a pass or fail result for a test case to the TMS log file |
|
37 void writeTMSResult(ofstream &aLogFile, stringstream &aTestCaseType, int aTestCaseIndex, bool aResult, stringstream &aLogging); |
|
33 |
38 |
34 //Funtions to generate Good/Valid config files for tcertapp |
39 //Funtions to generate Good/Valid config files for tcertapp |
35 void GoodFileCaCertTests(const stringstream &aFilename, int aArray_value); |
40 void GoodFileCaCertTests(const stringstream &aFilename, int aArray_value); |
36 void GoodFileCertClientsTests(const stringstream &aFilename); |
41 void GoodFileCertClientsTests(const stringstream &aFilename); |
37 void GoodSwiCertTests(const stringstream &aFilename, int aArray_value); |
42 void GoodSwiCertTests(const stringstream &aFilename, int aArray_value); |
38 |
43 |
39 //Functions to generate Good/Valid script files for emulator tests |
44 //Functions to generate Good/Valid script files for emulator tests |
40 void GenerateGoodCaCertsTestScripts(const stringstream &aFilename); |
45 void GenerateGoodCaCertsTestScripts(const stringstream &aFilename, const stringstream &aTestCaseType, int &aTestIndex); |
41 void GenerateGoodCertClientTestScripts(const stringstream &aFilename); |
46 void GenerateGoodCertClientTestScripts(const stringstream &aFilename, const stringstream &aTestCaseType, int &aTestIndex); |
42 void GenerateGoodSwiCertTestScripts(const stringstream &aFilename); |
47 void GenerateGoodSwiCertTestScripts(const stringstream &aFilename, const stringstream &aTestCaseType, int &aTestIndex); |
43 |
48 |
44 //Funtions to generate Bad/illegal config files for tcertapp |
49 //Funtions to generate Bad/illegal config files for tcertapp |
45 void BadFileCaCertTests(const stringstream &aFilename, int aArray_value); |
50 void BadFileCaCertTests(const stringstream &aFilename, int aArray_value, stringstream &aTestCaseType, int &aTestIndex); |
46 void BadFileCertClientsTests(const stringstream &aFilename, int aIndex); |
51 void BadFileCertClientsTests(const stringstream &aFilename, int aIndex, stringstream &aTestCaseType, int &aTestIndex); |
47 void BadSwiCertTests(const stringstream &aFilename, int aArray_value); |
52 void BadSwiCertTests(const stringstream &aFilename, int aArray_value, stringstream &aTestCaseType, int &aTestIndex); |
48 |
53 |
49 //Function call for RunCertApp api |
54 //Function call for RunCertApp api |
50 void RunCertAppTool(int argc, char **argv, stringstream &aStringval); |
55 void RunCertAppTool(int argc, char **argv, stringstream &aStringval, stringstream &testCaseType, int testCaseIndex); |
51 void RunCertAppToolForStoreDump(int aArgc, char **aArgv, stringstream &aStringval); |
56 void RunCertAppToolForStoreDump(int aArgc, char **aArgv, stringstream &aStringval, stringstream &testCaseType, int testCaseIndex); |
52 void RunCertAppToolForBadParams(int aArgc, char **aArgv, stringstream &aStringval); |
57 void RunCertAppToolForBadParams(int aArgc, char **aArgv, stringstream &aStringval, stringstream &testCaseType, int testCaseIndex); |
53 |
58 |
54 void TestsWithEmptyConfigFile(); |
59 void TestsWithEmptyConfigFile(); |
55 void CreateFileToAugmentStore(); |
60 void CreateFileToAugmentStore(); |
56 void TestsWithEncodedFileFormats(); |
61 void TestsWithEncodedFileFormats(); |
57 void TestToDecodeAndEncodeStore(); |
62 void TestToDecodeAndEncodeStore(); |
58 void TestToReviewingAggregateStore(); |
63 void TestToReviewingAggregateStore(); |
59 void TestBadConfigFiles(const stringstream &aFilename, bool aBool); |
64 void TestBadConfigFiles(const stringstream &aFilename, bool aBool, stringstream &aTestCaseType, int aTestCaseIndex); |
60 void CertClientBadParamsFuncCall(stringstream &aFileName); |
65 void CertClientBadParamsFuncCall(stringstream &aFileName, stringstream &aTestCaseType, int aTestCaseIndex); |
61 void decodeEncodeCertAppCall(const char *aArray[]); |
66 void decodeEncodeCertAppCall(const char *aArray[]); |
62 int CompareFiles(stringstream &aFileName1, stringstream &aFileName2); |
67 int CompareFiles(stringstream &aFileName1, stringstream &aFileName2); |
63 int Compare(istream &aIstream1, istream &aIstream2); |
68 int Compare(istream &aIstream1, istream &aIstream2); |
64 void TestWithUnicodFileName(); |
69 void TestWithUnicodFileName(); |
65 |
70 |
145 "--hfilecertstore=utf8_without_bom.txt", |
150 "--hfilecertstore=utf8_without_bom.txt", |
146 "--hfilecertstore=ucs2-bigendian.txt", |
151 "--hfilecertstore=ucs2-bigendian.txt", |
147 "--hfilecertstore=ucs2-littleendian.txt" |
152 "--hfilecertstore=ucs2-littleendian.txt" |
148 }; |
153 }; |
149 |
154 |
155 // Write a pass or fail result for a test case to the TMS log file |
|
156 void writeTMSResult(ofstream &aLogFile, stringstream &aTestCaseType, int aTestCaseIndex, bool aResult, stringstream &aLogging) |
|
157 { |
|
158 // get the current time |
|
159 time_t rawtime; |
|
160 struct tm * timeinfo; |
|
161 char standardTimeBuffer[10]; |
|
162 time(&rawtime); |
|
163 timeinfo = localtime(&rawtime); |
|
164 strftime(standardTimeBuffer, 10, "%H:%M:%S", timeinfo); |
|
165 |
|
166 struct _timeb tstruct; |
|
167 char millisecondTimeBuffer[6]; |
|
168 _ftime(&tstruct); |
|
169 sprintf(millisecondTimeBuffer, ":%03u ", tstruct.millitm); |
|
170 |
|
171 stringstream timeBuffer; |
|
172 timeBuffer << standardTimeBuffer << millisecondTimeBuffer; |
|
173 |
|
174 // set result string |
|
175 stringstream resultBuffer; |
|
176 |
|
177 if (aResult) |
|
178 { |
|
179 resultBuffer << "PASS"; |
|
180 } |
|
181 else |
|
182 { |
|
183 resultBuffer << "FAIL"; |
|
184 } |
|
185 |
|
186 // set test case ID string |
|
187 char testCaseIndexBuffer[6]; |
|
188 sprintf(testCaseIndexBuffer, "-%04d", aTestCaseIndex); |
|
189 |
|
190 // write result in the correct format |
|
191 aLogFile << "<html><body><pre>\r\n"; |
|
192 aLogFile << timeBuffer.str(); |
|
193 aLogFile << "START_TESTCASE "; |
|
194 aLogFile << aTestCaseType.str() << testCaseIndexBuffer; |
|
195 aLogFile << "\r\n"; |
|
196 aLogFile << timeBuffer.str(); |
|
197 aLogFile << "Line = 1 Command = START_TESTCASE "; |
|
198 aLogFile << aTestCaseType.str() << testCaseIndexBuffer; |
|
199 aLogFile << "\r\n"; |
|
200 |
|
201 if (aLogging.str() != "") |
|
202 { |
|
203 aLogFile << timeBuffer.str(); |
|
204 aLogFile << aLogging.str(); |
|
205 aLogFile << "\r\n"; |
|
206 } |
|
207 |
|
208 aLogFile << timeBuffer.str(); |
|
209 aLogFile << "END_TESTCASE "; |
|
210 aLogFile << aTestCaseType.str() << testCaseIndexBuffer; |
|
211 aLogFile << "\r\n"; |
|
212 aLogFile << timeBuffer.str(); |
|
213 aLogFile << "Line = 1 Command = END_TESTCASE "; |
|
214 aLogFile << aTestCaseType.str() << testCaseIndexBuffer; |
|
215 aLogFile << " ***TestCaseResult = "; |
|
216 aLogFile << resultBuffer.str(); |
|
217 aLogFile << "\r\n</pre></body></html>\r\n"; |
|
218 } |
|
150 |
219 |
151 //RunCertApp call to create store from text input |
220 //RunCertApp call to create store from text input |
152 void RunCertAppTool( int argc, char **argv, stringstream &stringval) |
221 void RunCertAppTool( int argc, char **argv, stringstream &stringval, stringstream &testCaseType, int testCaseIndex) |
153 { |
222 { |
154 for(int i =0; i<argc; i++) |
223 for(int i =0; i<argc; i++) |
155 { |
224 { |
156 cout << "Arguments Being passed to the RunCertApp tool is " << argv[i] << endl; |
225 cout << "Arguments Being passed to the RunCertApp tool is " << argv[i] << endl; |
157 } |
226 } |
158 int ret = RunCertApp(progress, errors, argc, argv); |
227 int ret = RunCertApp(progress, errors, argc, argv); |
159 cout << "Return Value from CertApp Tool is " << ret << endl; |
228 cout << "Return Value from CertApp Tool is " << ret << endl; |
229 stringstream logging; |
|
160 if(ret!= 0) |
230 if(ret!= 0) |
161 { |
231 { |
162 failCount++; |
232 failCount++; |
163 file<< "Error in creating store for " << stringval.str() << " and result is " << ret << " Fail" << endl ; |
233 logging << "Error in creating store for " << stringval.str() << " and result is " << ret << " Fail" ; |
164 } |
234 } |
165 else |
235 else |
166 { |
236 { |
167 passCount++; |
237 passCount++; |
168 file << "No Error in creating store for " << stringval.str() << " and result is " << ret << " Pass" <<endl ; |
238 logging << "No Error in creating store for " << stringval.str() << " and result is " << ret << " Pass" ; |
169 } |
239 } |
240 |
|
241 writeTMSResult(file, testCaseType, testCaseIndex, ret==0, logging); |
|
170 } |
242 } |
171 |
243 |
172 //RunCertApp call to dump the store to human readable format |
244 //RunCertApp call to dump the store to human readable format |
173 void RunCertAppToolForStoreDump(int argc, char **argv, stringstream &stringval) |
245 void RunCertAppToolForStoreDump(int argc, char **argv, stringstream &stringval, stringstream &testCaseType, int testCaseIndex) |
174 { |
246 { |
175 int ret = RunCertApp(progress, errors, argc, argv); |
247 int ret = RunCertApp(progress, errors, argc, argv); |
176 cout << "Return Value from CertApp Tool is " << ret << endl; |
248 cout << "Return Value from CertApp Tool is " << ret << endl; |
249 stringstream logging; |
|
177 if(ret!= 0) |
250 if(ret!= 0) |
178 { |
251 { |
179 failCount++; |
252 failCount++; |
180 file<< "Error in Dumping the store file for " << stringval.str() << " and result is " << ret << " Fail" << endl ; |
253 logging << "Error in Dumping the store file for " << stringval.str() << " and result is " << ret << " Fail"; |
181 } |
254 } |
182 else |
255 else |
183 { |
256 { |
184 passCount++; |
257 passCount++; |
185 file << "No Error in Dumping store for " << stringval.str() << " and result is " << ret << " Pass" <<endl ; |
258 logging << "No Error in Dumping store for " << stringval.str() << " and result is " << ret << " Pass"; |
186 } |
259 } |
260 |
|
261 writeTMSResult(file, testCaseType, testCaseIndex, ret==0, logging); |
|
187 } |
262 } |
188 |
263 |
189 //RunCertApp call to create store for bad params |
264 //RunCertApp call to create store for bad params |
190 void RunCertAppToolForBadParams(int argc, char **argv, stringstream &stringval) |
265 void RunCertAppToolForBadParams(int argc, char **argv, stringstream &stringval, stringstream &testCaseType, int testCaseIndex) |
191 { |
266 { |
192 int ret = RunCertApp(progress, errors, argc, argv); |
267 int ret = RunCertApp(progress, errors, argc, argv); |
268 stringstream logging; |
|
193 if(ret!= 0) |
269 if(ret!= 0) |
194 { |
270 { |
195 passCount++; |
271 passCount++; |
196 cout << "We have passsed bad paramerters! Expected Return value is -1 And the RunCertApp has returned " << ret << " as Expected"<< endl; |
272 cout << "We have passsed bad paramerters! Expected Return value is -1 And the RunCertApp has returned " << ret << " as Expected"<< endl; |
197 file<< "Bad Params! So Cannot create the store for " << stringval.str() << " and result is " << ret << " Pass" << endl ; |
273 logging << "Bad Params! So Cannot create the store for " << stringval.str() << " and result is " << ret << " Pass"; |
198 } |
274 } |
199 else |
275 else |
200 { |
276 { |
201 failCount++; |
277 failCount++; |
202 file << "We are using bad parameters! So the tools should fail to create store! " << stringval.str() << " and result is " << ret << " Fail" <<endl ; |
278 logging << "We are using bad parameters! So the tools should fail to create store! " << stringval.str() << " and result is " << ret << " Fail"; |
203 cout << "We have passsed bad paramerters! The Tool has failed- It should return -1, But returned" << ret << endl; |
279 cout << "We have passsed bad paramerters! The Tool has failed- It should return -1, But returned" << ret << endl; |
204 } |
280 } |
281 |
|
282 writeTMSResult(file, testCaseType, testCaseIndex, ret==0, logging); |
|
205 } |
283 } |
206 |
284 |
207 |
285 |
208 /** |
286 /** |
209 main entry to the program |
287 main entry to the program |
210 */ |
288 */ |
211 int main(int /*argc*/, char ** /*argv*/) |
289 int main(int /*argc*/, char ** /*argv*/) |
212 { |
290 { |
291 stringstream testCaseType; |
|
292 int testCaseIndex = 0; |
|
293 |
|
213 dbg.SetStream(&std::cout); |
294 dbg.SetStream(&std::cout); |
214 prog.SetStream(&std::cout); |
295 prog.SetStream(&std::cout); |
215 std::cout << std::dec; |
296 std::cout << std::dec; |
216 |
297 |
217 int num_tests = 0; |
298 int num_tests = 0; |
218 int argCount3 = 3; |
299 int argCount3 = 3; |
219 int argCount4 = 4; |
300 int argCount4 = 4; |
220 // File to log the result of all tests |
301 // File to log the result of all tests |
221 if(file) |
302 if(file) |
222 { |
303 { |
223 file.open("tCertapp_Output.txt", ios_base::trunc | ios_base::out); |
304 file.open("tCertapp_Output.htm", ios_base::trunc | ios_base::out); |
224 } |
305 } |
225 |
306 |
226 //create a file to augment the content to existing store |
307 //create a file to augment the content to existing store |
227 CreateFileToAugmentStore(); |
308 CreateFileToAugmentStore(); |
309 |
|
310 /** |
|
311 @SYMTestCaseID SEC-TOOLS-CERTAPP-CCDAT_CREATE-0000 |
|
312 @SYMTestCaseDesc Create store |
|
313 */ |
|
228 |
314 |
229 //create certclient config files |
315 //create certclient config files |
230 //Format used for the files name is SDP-Security_Tools-CertApp-XXX-000X to match with the TMS test case id |
316 //Format used for the files name is SDP-Security_Tools-CertApp-XXX-000X to match with the TMS test case id |
231 stringstream certclientfileName; |
317 stringstream certclientfileName; |
232 certclientfileName << "SDP-Security_Tools-CertApp-CCDAT_000"<<num_tests<<".txt"; |
318 certclientfileName << "SDP-Security_Tools-CertApp-CCDAT_000"<<num_tests<<".txt"; |
257 { |
343 { |
258 argument_ptr[n1] = const_cast<char*>(argv_certclient[n1]); |
344 argument_ptr[n1] = const_cast<char*>(argv_certclient[n1]); |
259 argv = argument_ptr; |
345 argv = argument_ptr; |
260 } |
346 } |
261 |
347 |
262 RunCertAppTool(argCount3, argv, certclientfileName); // creating dat file |
348 testCaseType.str("SEC-TOOLS-CERTAPP-CCDAT_CREATE"); |
263 |
349 RunCertAppTool(argCount3, argv, certclientfileName, testCaseType, 0); // creating dat file |
350 |
|
351 /** |
|
352 @SYMTestCaseID SEC-TOOLS-CERTAPP-CCAUG_AUGMENT-0000 |
|
353 @SYMTestCaseDesc Augment the Store with Extra entries |
|
354 */ |
|
355 |
|
264 //Augment the Store with Extra entries |
356 //Augment the Store with Extra entries |
265 augFileName<<"SDP-Security_Tools-CertApp-CCAUG_0000.dat"; |
357 augFileName<<"SDP-Security_Tools-CertApp-CCAUG_0000.dat"; |
266 argv_certclient[0] = "--hcertclients=tCertClient_Augment.txt"; |
358 argv_certclient[0] = "--hcertclients=tCertClient_Augment.txt"; |
267 argv_certclient[1] = argv_certclient[2]; |
359 argv_certclient[1] = argv_certclient[2]; |
268 argv_certclient[2] = "--out"; |
360 argv_certclient[2] = "--out"; |
270 for(int x = 0; x<argCount4; x++) |
362 for(int x = 0; x<argCount4; x++) |
271 { |
363 { |
272 argument_ptr[x] = const_cast<char*>(argv_certclient[x]); |
364 argument_ptr[x] = const_cast<char*>(argv_certclient[x]); |
273 argv1 = argument_ptr; |
365 argv1 = argument_ptr; |
274 } |
366 } |
275 RunCertAppTool(argCount4, argv1, augFileName); |
367 |
368 testCaseType.str("SEC-TOOLS-CERTAPP-CCAUG_AUGMENT"); |
|
369 RunCertAppTool(argCount4, argv1, augFileName, testCaseType, 0); |
|
370 |
|
371 /** |
|
372 @SYMTestCaseID SEC-TOOLS-CERTAPP-CCDAT_DUMP-0000 |
|
373 @SYMTestCaseDesc Dump the dat file to human readable text format |
|
374 */ |
|
276 |
375 |
277 //Dump the dat file to human readable text format |
376 //Dump the dat file to human readable text format |
278 argv_certclient[0] = argv_certclient[3]; |
377 argv_certclient[0] = argv_certclient[3]; |
279 argv_certclient[1] = "--out"; |
378 argv_certclient[1] = "--out"; |
280 argv_certclient[2] = "--hcertclients=SDP-Security_Tools-CertApp-CCDUMP_0000.txt"; |
379 argv_certclient[2] = "--hcertclients=SDP-Security_Tools-CertApp-CCDUMP_0000.txt"; |
282 for(int k = 0; k<argCount3; k++) |
381 for(int k = 0; k<argCount3; k++) |
283 { |
382 { |
284 argument_ptr[k] = const_cast<char*>(argv_certclient[k]); |
383 argument_ptr[k] = const_cast<char*>(argv_certclient[k]); |
285 argv1 = argument_ptr; |
384 argv1 = argument_ptr; |
286 } |
385 } |
287 RunCertAppToolForStoreDump(argCount3, argv1, certclientfileName); |
386 |
387 testCaseType.str("SEC-TOOLS-CERTAPP-CCDAT_DUMP"); |
|
388 RunCertAppToolForStoreDump(argCount3, argv1, certclientfileName, testCaseType, 0); |
|
288 //End of t_certclients |
389 //End of t_certclients |
289 |
390 |
290 //Creates good config files to augment store and dump store to text format for file certstore - cacerts.dat |
391 //Creates good config files to augment store and dump store to text format for file certstore - cacerts.dat |
291 //Test for all positive cases |
392 //Test for all positive cases |
292 for(num_tests = 0; num_tests<=KFileArrayIndex; num_tests++) |
393 for(num_tests = 0; num_tests<=KFileArrayIndex; num_tests++) |
293 { |
394 { |
294 stringstream caCertFileName; |
395 stringstream caCertFileName; |
295 caCertFileName << "SDP-Security_Tools-CertApp-FILEDAT_000"<<num_tests<<".txt"; |
396 caCertFileName << "SDP-Security_Tools-CertApp-FILEDAT_000"<<num_tests<<".txt"; |
296 GoodFileCaCertTests(caCertFileName,num_tests); |
397 GoodFileCaCertTests(caCertFileName,num_tests); |
398 |
|
399 /** |
|
400 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDAT_CREATE-0000 |
|
401 @SYMTestCaseDesc CREATE CACERTS STORE FROM HUMAN READABLE TEXT INPUT |
|
402 */ |
|
403 /** |
|
404 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDAT_CREATE-0001 |
|
405 @SYMTestCaseDesc CREATE CACERTS STORE FROM HUMAN READABLE TEXT INPUT |
|
406 */ |
|
407 /** |
|
408 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDAT_CREATE-0002 |
|
409 @SYMTestCaseDesc CREATE CACERTS STORE FROM HUMAN READABLE TEXT INPUT |
|
410 */ |
|
411 /** |
|
412 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDAT_CREATE-0003 |
|
413 @SYMTestCaseDesc CREATE CACERTS STORE FROM HUMAN READABLE TEXT INPUT |
|
414 */ |
|
415 /** |
|
416 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDAT_CREATE-0004 |
|
417 @SYMTestCaseDesc CREATE CACERTS STORE FROM HUMAN READABLE TEXT INPUT |
|
418 */ |
|
419 /** |
|
420 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDAT_CREATE-0005 |
|
421 @SYMTestCaseDesc CREATE CACERTS STORE FROM HUMAN READABLE TEXT INPUT |
|
422 */ |
|
423 /** |
|
424 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDAT_CREATE-0006 |
|
425 @SYMTestCaseDesc CREATE CACERTS STORE FROM HUMAN READABLE TEXT INPUT |
|
426 */ |
|
427 /** |
|
428 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDAT_CREATE-0007 |
|
429 @SYMTestCaseDesc CREATE CACERTS STORE FROM HUMAN READABLE TEXT INPUT |
|
430 */ |
|
431 /** |
|
432 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDAT_CREATE-0008 |
|
433 @SYMTestCaseDesc CREATE CACERTS STORE FROM HUMAN READABLE TEXT INPUT |
|
434 */ |
|
297 |
435 |
298 // CREATE CACERTS STORE FROM HUMAN READABLE TEXT INPUT |
436 // CREATE CACERTS STORE FROM HUMAN READABLE TEXT INPUT |
299 //ex:certapp --hcertclients=t_certclients_0.txt --hfilecertstore=t_cacerts_0.txt --out --bfilecertstore=cacerts_x.dat |
437 //ex:certapp --hcertclients=t_certclients_0.txt --hfilecertstore=t_cacerts_0.txt --out --bfilecertstore=cacerts_x.dat |
300 stringstream strArg1, strArg2, strArg3, strArg4, strArg5; |
438 stringstream strArg1, strArg2, strArg3, strArg4, strArg5; |
301 strArg1 <<"--hfilecertstore=SDP-Security_Tools-CertApp-FILEDAT_000" <<num_tests << ".txt" ; |
439 strArg1 <<"--hfilecertstore=SDP-Security_Tools-CertApp-FILEDAT_000" <<num_tests << ".txt" ; |
323 for(int n = 0; n<argCount4; n++) |
461 for(int n = 0; n<argCount4; n++) |
324 { |
462 { |
325 argument_ptr[n] = const_cast<char*>(argv_certclient[n]); |
463 argument_ptr[n] = const_cast<char*>(argv_certclient[n]); |
326 argv = argument_ptr; |
464 argv = argument_ptr; |
327 } |
465 } |
328 RunCertAppTool(argCount4, argv, caCertFileName); |
466 |
467 testCaseType.str("SEC-TOOLS-CERTAPP-FILEDAT_CREATE"); |
|
468 RunCertAppTool(argCount4, argv, caCertFileName, testCaseType, num_tests); |
|
469 |
|
470 /** |
|
471 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEAUG_AUGMENT-0000 |
|
472 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
473 */ |
|
474 /** |
|
475 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEAUG_AUGMENT-0001 |
|
476 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
477 */ |
|
478 /** |
|
479 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEAUG_AUGMENT-0002 |
|
480 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
481 */ |
|
482 /** |
|
483 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEAUG_AUGMENT-0003 |
|
484 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
485 */ |
|
486 /** |
|
487 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEAUG_AUGMENT-0004 |
|
488 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
489 */ |
|
490 /** |
|
491 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEAUG_AUGMENT-0005 |
|
492 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
493 */ |
|
494 /** |
|
495 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEAUG_AUGMENT-0006 |
|
496 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
497 */ |
|
498 /** |
|
499 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEAUG_AUGMENT-0007 |
|
500 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
501 */ |
|
502 /** |
|
503 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEAUG_AUGMENT-0008 |
|
504 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
505 */ |
|
329 |
506 |
330 //AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
507 //AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
331 //ex:certapp --hfilecertstore=tAugment_cacerts_x.txt --bfilecertstore=cacerts.dat --out --bfilecertstore=new_extra_filecertstore.dat |
508 //ex:certapp --hfilecertstore=tAugment_cacerts_x.txt --bfilecertstore=cacerts.dat --out --bfilecertstore=new_extra_filecertstore.dat |
332 stringstream augFileName, textDumpFileName; |
509 stringstream augFileName, textDumpFileName; |
333 augFileName<<"SDP-Security_Tools-CertApp-FILEAUG_000" <<num_tests << ".dat"; |
510 augFileName<<"SDP-Security_Tools-CertApp-FILEAUG_000" <<num_tests << ".dat"; |
341 for(int x = 0; x<argCount4; x++) |
518 for(int x = 0; x<argCount4; x++) |
342 { |
519 { |
343 argument_ptr[x] = const_cast<char*>(argv_certclient[x]); |
520 argument_ptr[x] = const_cast<char*>(argv_certclient[x]); |
344 argv1 = argument_ptr; |
521 argv1 = argument_ptr; |
345 } |
522 } |
346 RunCertAppTool(argCount4, argv1, augFileName); |
523 |
347 |
524 testCaseType.str("SEC-TOOLS-CERTAPP-FILEAUG_AUGMENT"); |
525 RunCertAppTool(argCount4, argv1, augFileName, testCaseType, num_tests); |
|
526 |
|
527 /** |
|
528 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDUMP_DUMP-0000 |
|
529 @SYMTestCaseDesc DUMP THE STORE TO HUMAN READABLE FORMAT |
|
530 */ |
|
531 /** |
|
532 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDUMP_DUMP-0001 |
|
533 @SYMTestCaseDesc DUMP THE STORE TO HUMAN READABLE FORMAT |
|
534 */ |
|
535 /** |
|
536 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDUMP_DUMP-0002 |
|
537 @SYMTestCaseDesc DUMP THE STORE TO HUMAN READABLE FORMAT |
|
538 */ |
|
539 /** |
|
540 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDUMP_DUMP-0003 |
|
541 @SYMTestCaseDesc DUMP THE STORE TO HUMAN READABLE FORMAT |
|
542 */ |
|
543 /** |
|
544 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDUMP_DUMP-0004 |
|
545 @SYMTestCaseDesc DUMP THE STORE TO HUMAN READABLE FORMAT |
|
546 */ |
|
547 /** |
|
548 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDUMP_DUMP-0005 |
|
549 @SYMTestCaseDesc DUMP THE STORE TO HUMAN READABLE FORMAT |
|
550 */ |
|
551 /** |
|
552 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDUMP_DUMP-0006 |
|
553 @SYMTestCaseDesc DUMP THE STORE TO HUMAN READABLE FORMAT |
|
554 */ |
|
555 /** |
|
556 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDUMP_DUMP-0007 |
|
557 @SYMTestCaseDesc DUMP THE STORE TO HUMAN READABLE FORMAT |
|
558 */ |
|
559 /** |
|
560 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEDUMP_DUMP-0008 |
|
561 @SYMTestCaseDesc DUMP THE STORE TO HUMAN READABLE FORMAT |
|
562 */ |
|
563 |
|
348 //DUMP THE STORE TO HUMAN READABLE FORMAT |
564 //DUMP THE STORE TO HUMAN READABLE FORMAT |
349 //ex:certapp --bfilecertstore=test.dat --out --hfilecertstore=t_cacerts.txt |
565 //ex:certapp --bfilecertstore=test.dat --out --hfilecertstore=t_cacerts.txt |
350 textDumpFileName <<"SDP-Security_Tools-CertApp-FILEDUMP_000"<< num_tests << ".txt"; |
566 textDumpFileName <<"SDP-Security_Tools-CertApp-FILEDUMP_000"<< num_tests << ".txt"; |
351 argv_certclient[0] = argv_certclient[3]; //--bfilecertstore=aug_cacerts_x.dat |
567 argv_certclient[0] = argv_certclient[3]; //--bfilecertstore=aug_cacerts_x.dat |
352 argv_certclient[1] = "--out"; |
568 argv_certclient[1] = "--out"; |
358 { |
574 { |
359 argument_ptr[k] = const_cast<char*>(argv_certclient[k]); |
575 argument_ptr[k] = const_cast<char*>(argv_certclient[k]); |
360 argv2 = argument_ptr; |
576 argv2 = argument_ptr; |
361 } |
577 } |
362 //Dumps the augmented store |
578 //Dumps the augmented store |
363 RunCertAppToolForStoreDump(argCount3, argv2, textDumpFileName); |
579 |
580 testCaseType.str("SEC-TOOLS-CERTAPP-FILEDUMP_DUMP"); |
|
581 RunCertAppToolForStoreDump(argCount3, argv2, textDumpFileName, testCaseType, num_tests); |
|
364 }//End of cacerts |
582 }//End of cacerts |
365 |
583 |
366 |
584 |
367 //create config files with legal values for swi certstore |
585 //create config files with legal values for swi certstore |
368 for(num_tests = 0; num_tests<KSwicertIndex; num_tests++) |
586 for(num_tests = 0; num_tests<KSwicertIndex; num_tests++) |
369 { |
587 { |
370 stringstream swiCertStoreFileName; |
588 stringstream swiCertStoreFileName; |
371 swiCertStoreFileName << "SDP-Security_Tools-CertApp-SWIDAT_000"<<num_tests<<".txt"; |
589 swiCertStoreFileName << "SDP-Security_Tools-CertApp-SWIDAT_000"<<num_tests<<".txt"; |
372 GoodSwiCertTests(swiCertStoreFileName,num_tests); |
590 GoodSwiCertTests(swiCertStoreFileName,num_tests); |
591 |
|
592 /** |
|
593 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDAT_CREATE-0000 |
|
594 @SYMTestCaseDesc CREATE THE SWICERTSTORE FROM THE HUMAN READABLE TEXT INPUT |
|
595 */ |
|
596 /** |
|
597 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDAT_CREATE-0001 |
|
598 @SYMTestCaseDesc CREATE THE SWICERTSTORE FROM THE HUMAN READABLE TEXT INPUT |
|
599 */ |
|
600 /** |
|
601 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDAT_CREATE-0002 |
|
602 @SYMTestCaseDesc CREATE THE SWICERTSTORE FROM THE HUMAN READABLE TEXT INPUT |
|
603 */ |
|
604 /** |
|
605 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDAT_CREATE-0003 |
|
606 @SYMTestCaseDesc CREATE THE SWICERTSTORE FROM THE HUMAN READABLE TEXT INPUT |
|
607 */ |
|
608 /** |
|
609 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDAT_CREATE-0004 |
|
610 @SYMTestCaseDesc CREATE THE SWICERTSTORE FROM THE HUMAN READABLE TEXT INPUT |
|
611 */ |
|
612 /** |
|
613 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDAT_CREATE-0005 |
|
614 @SYMTestCaseDesc CREATE THE SWICERTSTORE FROM THE HUMAN READABLE TEXT INPUT |
|
615 */ |
|
616 /** |
|
617 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDAT_CREATE-0006 |
|
618 @SYMTestCaseDesc CREATE THE SWICERTSTORE FROM THE HUMAN READABLE TEXT INPUT |
|
619 */ |
|
620 /** |
|
621 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDAT_CREATE-0007 |
|
622 @SYMTestCaseDesc CREATE THE SWICERTSTORE FROM THE HUMAN READABLE TEXT INPUT |
|
623 */ |
|
624 /** |
|
625 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDAT_CREATE-0008 |
|
626 @SYMTestCaseDesc CREATE THE SWICERTSTORE FROM THE HUMAN READABLE TEXT INPUT |
|
627 */ |
|
628 /** |
|
629 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDAT_CREATE-0009 |
|
630 @SYMTestCaseDesc CREATE THE SWICERTSTORE FROM THE HUMAN READABLE TEXT INPUT |
|
631 */ |
|
373 |
632 |
374 //CREATE THE SWICERTSTORE FROM THE HUMAN READABLE TEXT INPUT |
633 //CREATE THE SWICERTSTORE FROM THE HUMAN READABLE TEXT INPUT |
375 //Ex: certapp --hcertclients=t_certclients_0.txt --hswicertstore=t_swicertstore_0.txt --out --bswicertstore=swicertstore_x.dat |
634 //Ex: certapp --hcertclients=t_certclients_0.txt --hswicertstore=t_swicertstore_0.txt --out --bswicertstore=swicertstore_x.dat |
376 stringstream strArg1, strArg2, strArg3, strArg4, strArg5; |
635 stringstream strArg1, strArg2, strArg3, strArg4, strArg5; |
377 strArg1 <<"--hswicertstore=SDP-Security_Tools-CertApp-SWIDAT_000" <<num_tests << ".txt" ; //--hswicertstore=t_cacerts_x.txt |
636 strArg1 <<"--hswicertstore=SDP-Security_Tools-CertApp-SWIDAT_000" <<num_tests << ".txt" ; //--hswicertstore=t_cacerts_x.txt |
405 for(int n = 0; n<argCount4; n++) |
664 for(int n = 0; n<argCount4; n++) |
406 { |
665 { |
407 argument_ptr[n] = const_cast<char*>(argv_certclient[n]); |
666 argument_ptr[n] = const_cast<char*>(argv_certclient[n]); |
408 argv = argument_ptr; |
667 argv = argument_ptr; |
409 } |
668 } |
410 RunCertAppTool(argCount4, argv,swiCertStoreFileName); |
669 |
670 testCaseType.str("SEC-TOOLS-CERTAPP-SWIDAT_CREATE"); |
|
671 RunCertAppTool(argCount4, argv,swiCertStoreFileName, testCaseType, num_tests); |
|
672 |
|
673 /** |
|
674 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIAUG_AUGMENT-0000 |
|
675 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
676 */ |
|
677 /** |
|
678 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIAUG_AUGMENT-0001 |
|
679 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
680 */ |
|
681 /** |
|
682 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIAUG_AUGMENT-0002 |
|
683 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
684 */ |
|
685 /** |
|
686 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIAUG_AUGMENT-0003 |
|
687 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
688 */ |
|
689 /** |
|
690 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIAUG_AUGMENT-0004 |
|
691 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
692 */ |
|
693 /** |
|
694 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIAUG_AUGMENT-0005 |
|
695 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
696 */ |
|
697 /** |
|
698 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIAUG_AUGMENT-0006 |
|
699 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
700 */ |
|
701 /** |
|
702 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIAUG_AUGMENT-0007 |
|
703 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
704 */ |
|
705 /** |
|
706 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIAUG_AUGMENT-0008 |
|
707 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
708 */ |
|
709 /** |
|
710 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIAUG_AUGMENT-0009 |
|
711 @SYMTestCaseDesc AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
|
712 */ |
|
411 |
713 |
412 //AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
714 //AUGMENT THE CACERT STORE WITH EXTRA INFORMATION |
413 //certapp --hswicertstore=tAugment_swicertstore_x.txt --bswicertstore=swicertstore_x.dat --out --bswicertstore=aug_swicertstore_x.dat |
715 //certapp --hswicertstore=tAugment_swicertstore_x.txt --bswicertstore=swicertstore_x.dat --out --bswicertstore=aug_swicertstore_x.dat |
414 stringstream augFileName, textDumpFileName; |
716 stringstream augFileName, textDumpFileName; |
415 augFileName << "SDP-Security_Tools-CertApp-SWIAUG_000" << num_tests <<".dat"; |
717 augFileName << "SDP-Security_Tools-CertApp-SWIAUG_000" << num_tests <<".dat"; |
423 for(int x = 0; x<argCount4; x++) |
725 for(int x = 0; x<argCount4; x++) |
424 { |
726 { |
425 argument_ptr[x] = const_cast<char*>(argv_certclient[x]); |
727 argument_ptr[x] = const_cast<char*>(argv_certclient[x]); |
426 argv1 = argument_ptr; |
728 argv1 = argument_ptr; |
427 } |
729 } |
428 RunCertAppTool(argCount4, argv1, augFileName); |
730 |
429 |
731 testCaseType.str("SEC-TOOLS-CERTAPP-SWIAUG_AUGMENT"); |
732 RunCertAppTool(argCount4, argv1, augFileName, testCaseType, num_tests); |
|
733 |
|
734 /** |
|
735 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDUMP_DUMP-0000 |
|
736 @SYMTestCaseDesc DUMP THE SWI CERTSTORE TO HUMAN READABLE FORMAT |
|
737 */ |
|
738 /** |
|
739 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDUMP_DUMP-0001 |
|
740 @SYMTestCaseDesc DUMP THE SWI CERTSTORE TO HUMAN READABLE FORMAT |
|
741 */ |
|
742 /** |
|
743 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDUMP_DUMP-0002 |
|
744 @SYMTestCaseDesc DUMP THE SWI CERTSTORE TO HUMAN READABLE FORMAT |
|
745 */ |
|
746 /** |
|
747 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDUMP_DUMP-0003 |
|
748 @SYMTestCaseDesc DUMP THE SWI CERTSTORE TO HUMAN READABLE FORMAT |
|
749 */ |
|
750 /** |
|
751 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDUMP_DUMP-0004 |
|
752 @SYMTestCaseDesc DUMP THE SWI CERTSTORE TO HUMAN READABLE FORMAT |
|
753 */ |
|
754 /** |
|
755 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDUMP_DUMP-0005 |
|
756 @SYMTestCaseDesc DUMP THE SWI CERTSTORE TO HUMAN READABLE FORMAT |
|
757 */ |
|
758 /** |
|
759 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDUMP_DUMP-0006 |
|
760 @SYMTestCaseDesc DUMP THE SWI CERTSTORE TO HUMAN READABLE FORMAT |
|
761 */ |
|
762 /** |
|
763 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDUMP_DUMP-0007 |
|
764 @SYMTestCaseDesc DUMP THE SWI CERTSTORE TO HUMAN READABLE FORMAT |
|
765 */ |
|
766 /** |
|
767 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDUMP_DUMP-0008 |
|
768 @SYMTestCaseDesc DUMP THE SWI CERTSTORE TO HUMAN READABLE FORMAT |
|
769 */ |
|
770 /** |
|
771 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIDUMP_DUMP-0009 |
|
772 @SYMTestCaseDesc DUMP THE SWI CERTSTORE TO HUMAN READABLE FORMAT |
|
773 */ |
|
774 |
|
430 //DUMP THE SWI CERTSTORE TO HUMAN READABLE FORMAT |
775 //DUMP THE SWI CERTSTORE TO HUMAN READABLE FORMAT |
431 textDumpFileName << "SDP-Security_Tools-CertApp-SWIDUMP_000" <<num_tests << ".txt"; |
776 textDumpFileName << "SDP-Security_Tools-CertApp-SWIDUMP_000" <<num_tests << ".txt"; |
432 argv_certclient[0] = argv_certclient[3]; |
777 argv_certclient[0] = argv_certclient[3]; |
433 argv_certclient[1] = "--out"; |
778 argv_certclient[1] = "--out"; |
434 strArg5<< "--hswicertstore=SDP-Security_Tools-CertApp-SWIDUMP_000" <<num_tests << ".txt"; |
779 strArg5<< "--hswicertstore=SDP-Security_Tools-CertApp-SWIDUMP_000" <<num_tests << ".txt"; |
440 { |
785 { |
441 argument_ptr[k] = const_cast<char*>(argv_certclient[k]); |
786 argument_ptr[k] = const_cast<char*>(argv_certclient[k]); |
442 argv2 = argument_ptr; |
787 argv2 = argument_ptr; |
443 } |
788 } |
444 |
789 |
445 RunCertAppToolForStoreDump(argCount3, argv2, textDumpFileName); |
790 testCaseType.str("SEC-TOOLS-CERTAPP-SWIDUMP_DUMP"); |
791 RunCertAppToolForStoreDump(argCount3, argv2, textDumpFileName, testCaseType, num_tests); |
|
446 } |
792 } |
447 |
793 |
448 //Test with unicode filename |
794 //Test with unicode filename |
449 TestWithUnicodFileName(); |
795 TestWithUnicodFileName(); |
450 |
796 |
459 |
805 |
460 //Test case for REQ10314 - reviewing aggregate certificate database |
806 //Test case for REQ10314 - reviewing aggregate certificate database |
461 TestToReviewingAggregateStore(); |
807 TestToReviewingAggregateStore(); |
462 |
808 |
463 //Test cases for BAD Params |
809 //Test cases for BAD Params |
810 /** |
|
811 @SYMTestCaseID SEC-TOOLS-CERTAPP-CCBADPARAMS_CREATE-0000 |
|
812 @SYMTestCaseDesc Create bad certclient config files |
|
813 */ |
|
814 /** |
|
815 @SYMTestCaseID SEC-TOOLS-CERTAPP-CCBADPARAMS_CREATE-0001 |
|
816 @SYMTestCaseDesc Create bad certclient config files |
|
817 */ |
|
818 /** |
|
819 @SYMTestCaseID SEC-TOOLS-CERTAPP-CCBADPARAMS_CREATEE-0002 |
|
820 @SYMTestCaseDesc Create bad certclient config files |
|
821 */ |
|
822 /** |
|
823 @SYMTestCaseID SEC-TOOLS-CERTAPP-CCBADPARAMS_CREATE-0003 |
|
824 @SYMTestCaseDesc Create bad certclient config files |
|
825 */ |
|
826 /** |
|
827 @SYMTestCaseID SEC-TOOLS-CERTAPP-CCBADPARAMS_CREATE-0004 |
|
828 @SYMTestCaseDesc Create bad certclient config files |
|
829 */ |
|
830 /** |
|
831 @SYMTestCaseID SEC-TOOLS-CERTAPP-CCBADPARAMS_CREATE-0005 |
|
832 @SYMTestCaseDesc Create bad certclient config files |
|
833 */ |
|
834 /** |
|
835 @SYMTestCaseID SEC-TOOLS-CERTAPP-CCBADPARAMS_CREATE-0006 |
|
836 @SYMTestCaseDesc Create bad certclient config files |
|
837 */ |
|
838 /** |
|
839 @SYMTestCaseID SEC-TOOLS-CERTAPP-CCBADPARAMS_CREATE-0007 |
|
840 @SYMTestCaseDesc Create bad certclient config files |
|
841 */ |
|
842 /** |
|
843 @SYMTestCaseID SEC-TOOLS-CERTAPP-CCBADPARAMS_CREATE-0008 |
|
844 @SYMTestCaseDesc Create bad certclient config files |
|
845 */ |
|
464 //create certclient config files |
846 //create certclient config files |
847 testCaseType.str("SEC-TOOLS-CERTAPP-CCBADPARAMS_CREATE"); |
|
848 testCaseIndex = 0; |
|
465 for(num_tests =0; num_tests<3; num_tests++) |
849 for(num_tests =0; num_tests<3; num_tests++) |
466 { |
850 { |
467 stringstream badCertClientsFileName; |
851 stringstream badCertClientsFileName; |
468 badCertClientsFileName << "SDP-Security_Tools-CertApp-CCBadParams-000"<<num_tests; |
852 badCertClientsFileName << "SDP-Security_Tools-CertApp-CCBadParams-000"<<num_tests; |
469 BadFileCertClientsTests(badCertClientsFileName,num_tests); |
853 BadFileCertClientsTests(badCertClientsFileName,num_tests,testCaseType,testCaseIndex); |
470 } //End of bad params for cerclients |
854 } //End of bad params for cerclients |
471 |
855 |
856 /** |
|
857 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0000 |
|
858 @SYMTestCaseDesc Create bad config files for file certstore |
|
859 */ |
|
860 /** |
|
861 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0001 |
|
862 @SYMTestCaseDesc Create bad config files for file certstore |
|
863 */ |
|
864 /** |
|
865 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0002 |
|
866 @SYMTestCaseDesc Create bad config files for file certstore |
|
867 */ |
|
868 /** |
|
869 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0003 |
|
870 @SYMTestCaseDesc Create bad config files for file certstore |
|
871 */ |
|
872 /** |
|
873 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0004 |
|
874 @SYMTestCaseDesc Create bad config files for file certstore |
|
875 */ |
|
876 /** |
|
877 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0005 |
|
878 @SYMTestCaseDesc Create bad config files for file certstore |
|
879 */ |
|
880 /** |
|
881 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0006 |
|
882 @SYMTestCaseDesc Create bad config files for file certstore |
|
883 */ |
|
884 /** |
|
885 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0007 |
|
886 @SYMTestCaseDesc Create bad config files for file certstore |
|
887 */ |
|
888 /** |
|
889 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0008 |
|
890 @SYMTestCaseDesc Create bad config files for file certstore |
|
891 */ |
|
892 /** |
|
893 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0009 |
|
894 @SYMTestCaseDesc Create bad config files for file certstore |
|
895 */ |
|
896 /** |
|
897 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0010 |
|
898 @SYMTestCaseDesc Create bad config files for file certstore |
|
899 */ |
|
900 /** |
|
901 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0011 |
|
902 @SYMTestCaseDesc Create bad config files for file certstore |
|
903 */ |
|
904 /** |
|
905 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0012 |
|
906 @SYMTestCaseDesc Create bad config files for file certstore |
|
907 */ |
|
908 /** |
|
909 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0013 |
|
910 @SYMTestCaseDesc Create bad config files for file certstore |
|
911 */ |
|
912 /** |
|
913 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0014 |
|
914 @SYMTestCaseDesc Create bad config files for file certstore |
|
915 */ |
|
916 /** |
|
917 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0015 |
|
918 @SYMTestCaseDesc Create bad config files for file certstore |
|
919 */ |
|
920 /** |
|
921 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0016 |
|
922 @SYMTestCaseDesc Create bad config files for file certstore |
|
923 */ |
|
924 /** |
|
925 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0017 |
|
926 @SYMTestCaseDesc Create bad config files for file certstore |
|
927 */ |
|
928 /** |
|
929 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0018 |
|
930 @SYMTestCaseDesc Create bad config files for file certstore |
|
931 */ |
|
932 /** |
|
933 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0019 |
|
934 @SYMTestCaseDesc Create bad config files for file certstore |
|
935 */ |
|
936 /** |
|
937 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0020 |
|
938 @SYMTestCaseDesc Create bad config files for file certstore |
|
939 */ |
|
940 /** |
|
941 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0021 |
|
942 @SYMTestCaseDesc Create bad config files for file certstore |
|
943 */ |
|
944 /** |
|
945 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0022 |
|
946 @SYMTestCaseDesc Create bad config files for file certstore |
|
947 */ |
|
948 /** |
|
949 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0023 |
|
950 @SYMTestCaseDesc Create bad config files for file certstore |
|
951 */ |
|
952 /** |
|
953 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0024 |
|
954 @SYMTestCaseDesc Create bad config files for file certstore |
|
955 */ |
|
956 /** |
|
957 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0025 |
|
958 @SYMTestCaseDesc Create bad config files for file certstore |
|
959 */ |
|
960 /** |
|
961 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE-0026 |
|
962 @SYMTestCaseDesc Create bad config files for file certstore |
|
963 */ |
|
472 //create bad config files for file certstore - cacerts.dat |
964 //create bad config files for file certstore - cacerts.dat |
965 testCaseType.str("SEC-TOOLS-CERTAPP-FILEBADPARAMS_CREATE"); |
|
966 testCaseIndex = 0; |
|
473 for(num_tests = 0; num_tests<KFileArrayIndex+1; num_tests++) |
967 for(num_tests = 0; num_tests<KFileArrayIndex+1; num_tests++) |
474 { |
968 { |
475 stringstream badCaCertsFileName; |
969 stringstream badCaCertsFileName; |
476 badCaCertsFileName << "SDP-Security_Tools-CertApp-FileBadParams-000"<<num_tests; |
970 badCaCertsFileName << "SDP-Security_Tools-CertApp-FileBadParams-000"<<num_tests; |
477 BadFileCaCertTests(badCaCertsFileName,num_tests); |
971 BadFileCaCertTests(badCaCertsFileName,num_tests,testCaseType,testCaseIndex); |
478 } |
972 } |
479 |
973 |
974 /** |
|
975 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0000 |
|
976 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
977 */ |
|
978 /** |
|
979 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0001 |
|
980 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
981 */ |
|
982 /** |
|
983 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0002 |
|
984 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
985 */ |
|
986 /** |
|
987 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0003 |
|
988 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
989 */ |
|
990 /** |
|
991 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0004 |
|
992 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
993 */ |
|
994 /** |
|
995 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0005 |
|
996 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
997 */ |
|
998 /** |
|
999 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0006 |
|
1000 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1001 */ |
|
1002 /** |
|
1003 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0007 |
|
1004 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1005 */ |
|
1006 /** |
|
1007 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0008 |
|
1008 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1009 */ |
|
1010 /** |
|
1011 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0009 |
|
1012 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1013 */ |
|
1014 /** |
|
1015 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0010 |
|
1016 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1017 */ |
|
1018 /** |
|
1019 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0011 |
|
1020 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1021 */ |
|
1022 /** |
|
1023 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0012 |
|
1024 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1025 */ |
|
1026 /** |
|
1027 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0013 |
|
1028 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1029 */ |
|
1030 /** |
|
1031 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0014 |
|
1032 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1033 */ |
|
1034 /** |
|
1035 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0015 |
|
1036 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1037 */ |
|
1038 /** |
|
1039 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0016 |
|
1040 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1041 */ |
|
1042 /** |
|
1043 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0017 |
|
1044 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1045 */ |
|
1046 /** |
|
1047 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0018 |
|
1048 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1049 */ |
|
1050 /** |
|
1051 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0019 |
|
1052 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1053 */ |
|
1054 /** |
|
1055 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0020 |
|
1056 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1057 */ |
|
1058 /** |
|
1059 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0021 |
|
1060 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1061 */ |
|
1062 /** |
|
1063 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0022 |
|
1064 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1065 */ |
|
1066 /** |
|
1067 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0023 |
|
1068 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1069 */ |
|
1070 /** |
|
1071 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0024 |
|
1072 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1073 */ |
|
1074 /** |
|
1075 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0025 |
|
1076 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1077 */ |
|
1078 /** |
|
1079 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0026 |
|
1080 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1081 */ |
|
1082 /** |
|
1083 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0027 |
|
1084 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1085 */ |
|
1086 /** |
|
1087 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0028 |
|
1088 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1089 */ |
|
1090 /** |
|
1091 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0029 |
|
1092 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1093 */ |
|
1094 /** |
|
1095 @SYMTestCaseID SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE-0030 |
|
1096 @SYMTestCaseDesc Create config files with invalid values swi certstore |
|
1097 */ |
|
480 //create config files with invalid values swi certstore |
1098 //create config files with invalid values swi certstore |
1099 testCaseType.str("SEC-TOOLS-CERTAPP-SWIBADPARAMS_CREATE"); |
|
1100 testCaseIndex = 0; |
|
481 for(num_tests = 0; num_tests<KSwiBadcertIndex; num_tests++) |
1101 for(num_tests = 0; num_tests<KSwiBadcertIndex; num_tests++) |
482 { |
1102 { |
483 stringstream badSwiCertsFileName; |
1103 stringstream badSwiCertsFileName; |
484 badSwiCertsFileName << "SDP-Security_Tools-CertApp-SwiBadParams-000"<<num_tests; |
1104 badSwiCertsFileName << "SDP-Security_Tools-CertApp-SwiBadParams-000"<<num_tests; |
485 BadSwiCertTests(badSwiCertsFileName,num_tests); |
1105 BadSwiCertTests(badSwiCertsFileName,num_tests,testCaseType,testCaseIndex); |
486 } |
1106 } |
487 |
1107 |
1108 /** |
|
1109 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0001 |
|
1110 @SYMTestCaseDesc Initializing a CUnifiedCertStore |
|
1111 */ |
|
1112 /** |
|
1113 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0002 |
|
1114 @SYMTestCaseDesc Get the list of certificates |
|
1115 */ |
|
1116 /** |
|
1117 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0003 |
|
1118 @SYMTestCaseDesc Get certificate details |
|
1119 */ |
|
1120 /** |
|
1121 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0004 |
|
1122 @SYMTestCaseDesc Get Trust certificate |
|
1123 */ |
|
1124 /** |
|
1125 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0005 |
|
1126 @SYMTestCaseDesc Get applications |
|
1127 */ |
|
1128 /** |
|
1129 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0006 |
|
1130 @SYMTestCaseDesc Retrieve Certificate |
|
1131 */ |
|
1132 /** |
|
1133 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0007 |
|
1134 @SYMTestCaseDesc Get certificate details |
|
1135 */ |
|
1136 /** |
|
1137 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0008 |
|
1138 @SYMTestCaseDesc Get Trust certificate |
|
1139 */ |
|
1140 /** |
|
1141 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0009 |
|
1142 @SYMTestCaseDesc Get applications |
|
1143 */ |
|
1144 /** |
|
1145 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0010 |
|
1146 @SYMTestCaseDesc Retrieve Certificate |
|
1147 */ |
|
1148 /** |
|
1149 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0011 |
|
1150 @SYMTestCaseDesc Get certificate details |
|
1151 */ |
|
1152 /** |
|
1153 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0012 |
|
1154 @SYMTestCaseDesc Get Trust certificate |
|
1155 */ |
|
1156 /** |
|
1157 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0013 |
|
1158 @SYMTestCaseDesc Get applications |
|
1159 */ |
|
1160 /** |
|
1161 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0014 |
|
1162 @SYMTestCaseDesc Retrieve Certificate |
|
1163 */ |
|
1164 /** |
|
1165 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0015 |
|
1166 @SYMTestCaseDesc Get certificate details |
|
1167 */ |
|
1168 /** |
|
1169 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0016 |
|
1170 @SYMTestCaseDesc Get Trust certificate |
|
1171 */ |
|
1172 /** |
|
1173 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0017 |
|
1174 @SYMTestCaseDesc Get applications |
|
1175 */ |
|
1176 /** |
|
1177 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0018 |
|
1178 @SYMTestCaseDesc Retrieve Certificate |
|
1179 */ |
|
1180 /** |
|
1181 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0019 |
|
1182 @SYMTestCaseDesc Get certificate details |
|
1183 */ |
|
1184 /** |
|
1185 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0020 |
|
1186 @SYMTestCaseDesc Get Trust certificate |
|
1187 */ |
|
1188 /** |
|
1189 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0021 |
|
1190 @SYMTestCaseDesc Get applications |
|
1191 */ |
|
1192 /** |
|
1193 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0022 |
|
1194 @SYMTestCaseDesc Retrieve Certificate |
|
1195 */ |
|
1196 /** |
|
1197 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0023 |
|
1198 @SYMTestCaseDesc Get certificate details |
|
1199 */ |
|
1200 /** |
|
1201 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0024 |
|
1202 @SYMTestCaseDesc Get Trust certificate |
|
1203 */ |
|
1204 /** |
|
1205 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0025 |
|
1206 @SYMTestCaseDesc Get applications |
|
1207 */ |
|
1208 /** |
|
1209 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCACERT-0026 |
|
1210 @SYMTestCaseDesc Retrieve Certificate |
|
1211 */ |
|
488 //Code to create Script files for the file/sw/certclients to run validation tests on emulator |
1212 //Code to create Script files for the file/sw/certclients to run validation tests on emulator |
489 //create script file for the symbian test harness- for cacerts.dat |
1213 //create script file for the symbian test harness- for cacerts.dat |
1214 testCaseType.str("SEC-TOOLS-CERTAPP-GOODCACERT"); |
|
1215 testCaseIndex = 0; |
|
490 for(num_tests = 0; num_tests<1; num_tests++) |
1216 for(num_tests = 0; num_tests<1; num_tests++) |
491 { |
1217 { |
492 stringstream emu_CacertsFileName; |
1218 stringstream emu_CacertsFileName; |
493 emu_CacertsFileName << "SDP-Security_Tools-CertApp-FILEDAT-EMU0"<<num_tests<<".txt"; |
1219 emu_CacertsFileName << "SDP-Security_Tools-CertApp-FILEDAT-EMU0"<<num_tests<<".script"; |
494 GenerateGoodCaCertsTestScripts(emu_CacertsFileName); |
1220 GenerateGoodCaCertsTestScripts(emu_CacertsFileName,testCaseType,testCaseIndex); |
495 } |
1221 } |
496 |
1222 |
1223 /** |
|
1224 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCERT-0001 |
|
1225 @SYMTestCaseDesc Initialise a CertClientStore |
|
1226 */ |
|
1227 /** |
|
1228 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCERT-0002 |
|
1229 @SYMTestCaseDesc Get Count of Applications |
|
1230 */ |
|
1231 /** |
|
1232 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCERT-0003 |
|
1233 @SYMTestCaseDesc Getting the application list |
|
1234 */ |
|
1235 /** |
|
1236 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCERT-0004 |
|
1237 @SYMTestCaseDesc Get application with given id |
|
1238 */ |
|
1239 /** |
|
1240 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCERT-0005 |
|
1241 @SYMTestCaseDesc Get application with given id |
|
1242 */ |
|
1243 /** |
|
1244 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCERT-0006 |
|
1245 @SYMTestCaseDesc Get application with given id |
|
1246 */ |
|
1247 /** |
|
1248 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCERT-0007 |
|
1249 @SYMTestCaseDesc Get application with given id |
|
1250 */ |
|
1251 /** |
|
1252 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODCERT-0008 |
|
1253 @SYMTestCaseDesc Destroy the manager |
|
1254 */ |
|
497 //create script file for certclients.dat |
1255 //create script file for certclients.dat |
1256 testCaseType.str("SEC-TOOLS-CERTAPP-GOODCERT"); |
|
1257 testCaseIndex = 0; |
|
498 for(num_tests = 0; num_tests<1; num_tests++) |
1258 for(num_tests = 0; num_tests<1; num_tests++) |
499 { |
1259 { |
500 stringstream emu_CertClientsFileName; |
1260 stringstream emu_CertClientsFileName; |
501 emu_CertClientsFileName << "SDP-Security_Tools-CertApp-CCDAT-EMU0"<<num_tests<<".txt"; |
1261 emu_CertClientsFileName << "SDP-Security_Tools-CertApp-CCDAT-EMU0"<<num_tests<<".script"; |
502 GenerateGoodCertClientTestScripts(emu_CertClientsFileName); |
1262 GenerateGoodCertClientTestScripts(emu_CertClientsFileName,testCaseType,testCaseIndex); |
503 } |
1263 } |
504 |
1264 |
1265 /** |
|
1266 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0001 |
|
1267 @SYMTestCaseDesc Initialise a SWICertStore |
|
1268 */ |
|
1269 /** |
|
1270 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0002 |
|
1271 @SYMTestCaseDesc Get the list of certificates |
|
1272 */ |
|
1273 /** |
|
1274 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0003 |
|
1275 @SYMTestCaseDesc Get the systemupgrade flag |
|
1276 */ |
|
1277 /** |
|
1278 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0004 |
|
1279 @SYMTestCaseDesc Retrieve Certificate |
|
1280 */ |
|
1281 /** |
|
1282 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0005 |
|
1283 @SYMTestCaseDesc Get applications |
|
1284 */ |
|
1285 /** |
|
1286 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0006 |
|
1287 @SYMTestCaseDesc Get Trust certificate |
|
1288 */ |
|
1289 /** |
|
1290 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0007 |
|
1291 @SYMTestCaseDesc Get the capabilities |
|
1292 */ |
|
1293 /** |
|
1294 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0008 |
|
1295 @SYMTestCaseDesc Get the mandatory flag |
|
1296 */ |
|
1297 /** |
|
1298 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0009 |
|
1299 @SYMTestCaseDesc Get the systemupgrade flag |
|
1300 */ |
|
1301 /** |
|
1302 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0010 |
|
1303 @SYMTestCaseDesc Retrieve Certificate |
|
1304 */ |
|
1305 /** |
|
1306 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0011 |
|
1307 @SYMTestCaseDesc Get applications |
|
1308 */ |
|
1309 /** |
|
1310 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0012 |
|
1311 @SYMTestCaseDesc Get Trust certificate |
|
1312 */ |
|
1313 /** |
|
1314 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0013 |
|
1315 @SYMTestCaseDesc Get the capabilities |
|
1316 */ |
|
1317 /** |
|
1318 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0014 |
|
1319 @SYMTestCaseDesc Get the mandatory flag |
|
1320 */ |
|
1321 /** |
|
1322 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0015 |
|
1323 @SYMTestCaseDesc Get the systemupgrade flag |
|
1324 */ |
|
1325 /** |
|
1326 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0016 |
|
1327 @SYMTestCaseDesc Retrieve Certificate |
|
1328 */ |
|
1329 /** |
|
1330 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0017 |
|
1331 @SYMTestCaseDesc Get applications |
|
1332 */ |
|
1333 /** |
|
1334 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0018 |
|
1335 @SYMTestCaseDesc Get Trust certificate |
|
1336 */ |
|
1337 /** |
|
1338 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0019 |
|
1339 @SYMTestCaseDesc Get the capabilities |
|
1340 */ |
|
1341 /** |
|
1342 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0020 |
|
1343 @SYMTestCaseDesc Get the mandatory flag |
|
1344 */ |
|
1345 /** |
|
1346 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0021 |
|
1347 @SYMTestCaseDesc Get the systemupgrade flag |
|
1348 */ |
|
1349 /** |
|
1350 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0022 |
|
1351 @SYMTestCaseDesc Retrieve Certificate |
|
1352 */ |
|
1353 /** |
|
1354 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0023 |
|
1355 @SYMTestCaseDesc Get applications |
|
1356 */ |
|
1357 /** |
|
1358 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0024 |
|
1359 @SYMTestCaseDesc Get Trust certificate |
|
1360 */ |
|
1361 /** |
|
1362 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0025 |
|
1363 @SYMTestCaseDesc Get the capabilities |
|
1364 */ |
|
1365 /** |
|
1366 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0026 |
|
1367 @SYMTestCaseDesc Get the mandatory flag |
|
1368 */ |
|
1369 /** |
|
1370 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0027 |
|
1371 @SYMTestCaseDesc Get the systemupgrade flag |
|
1372 */ |
|
1373 /** |
|
1374 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0028 |
|
1375 @SYMTestCaseDesc Retrieve Certificate |
|
1376 */ |
|
1377 /** |
|
1378 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0029 |
|
1379 @SYMTestCaseDesc Get applications |
|
1380 */ |
|
1381 /** |
|
1382 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0030 |
|
1383 @SYMTestCaseDesc Get Trust certificate |
|
1384 */ |
|
1385 /** |
|
1386 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0031 |
|
1387 @SYMTestCaseDesc Get the capabilities |
|
1388 */ |
|
1389 /** |
|
1390 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0032 |
|
1391 @SYMTestCaseDesc Get the mandatory flag |
|
1392 */ |
|
1393 /** |
|
1394 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0033 |
|
1395 @SYMTestCaseDesc Get the systemupgrade flag |
|
1396 */ |
|
1397 /** |
|
1398 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0034 |
|
1399 @SYMTestCaseDesc Retrieve Certificate |
|
1400 */ |
|
1401 /** |
|
1402 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0035 |
|
1403 @SYMTestCaseDesc Get applications |
|
1404 */ |
|
1405 /** |
|
1406 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0036 |
|
1407 @SYMTestCaseDesc Get Trust certificate |
|
1408 */ |
|
1409 /** |
|
1410 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0037 |
|
1411 @SYMTestCaseDesc Get the capabilities |
|
1412 */ |
|
1413 /** |
|
1414 @SYMTestCaseID SEC-TOOLS-CERTAPP-GOODSWICERT-0038 |
|
1415 @SYMTestCaseDesc Get the mandatory flag |
|
1416 */ |
|
505 //create script file for the symbian test harness- for swicerts.dat |
1417 //create script file for the symbian test harness- for swicerts.dat |
1418 testCaseType.str("SEC-TOOLS-CERTAPP-GOODSWICERT"); |
|
1419 testCaseIndex = 0; |
|
506 for(num_tests = 0; num_tests<1; num_tests++) |
1420 for(num_tests = 0; num_tests<1; num_tests++) |
507 { |
1421 { |
508 stringstream emu_SwiCertsFileName; |
1422 stringstream emu_SwiCertsFileName; |
509 emu_SwiCertsFileName << "SDP-Security_Tools-CertApp-SWIDAT-EMU0"<<num_tests<<".txt"; |
1423 emu_SwiCertsFileName << "SDP-Security_Tools-CertApp-SWIDAT-EMU0"<<num_tests<<".script"; |
510 GenerateGoodSwiCertTestScripts(emu_SwiCertsFileName); |
1424 GenerateGoodSwiCertTestScripts(emu_SwiCertsFileName,testCaseType,testCaseIndex); |
511 } |
1425 } |
512 |
1426 |
513 int testCaseCount = failCount+passCount; |
1427 int testCaseCount = failCount+passCount; |
514 cout << "\nTestrun result is :: " << failCount <<" tests failed out of " << testCaseCount <<endl; |
1428 cout << "\nTestrun result is :: " << failCount <<" tests failed out of " << testCaseCount <<endl; |
515 file << "\n\nTotal number of test cases run is -> " << testCaseCount << endl; |
1429 file << "\n\nTotal number of test cases run is -> " << testCaseCount << endl; |
539 FileCertClientConfigWriter certclientwriter(certclientName); |
1453 FileCertClientConfigWriter certclientwriter(certclientName); |
540 certclientwriter.WriteExtraCertClientEntry(); |
1454 certclientwriter.WriteExtraCertClientEntry(); |
541 } |
1455 } |
542 |
1456 |
543 |
1457 |
1458 /** |
|
1459 @SYMTestCaseID SEC-TOOLS-CERTAPP-UNICODEFILE_CREATE-0000 |
|
1460 @SYMTestCaseDesc Check the certapp tool for unicode named config file |
|
1461 */ |
|
544 /** |
1462 /** |
545 Test case to check the certapp tool for unicode named config file |
1463 Test case to check the certapp tool for unicode named config file |
546 Testing with only one unicode named config file for now |
1464 Testing with only one unicode named config file for now |
547 */ |
1465 */ |
548 void TestWithUnicodFileName() |
1466 void TestWithUnicodFileName() |
598 cout << "Arguments Being passed to the RunCertApp tool is " << argv[i] << endl; |
1516 cout << "Arguments Being passed to the RunCertApp tool is " << argv[i] << endl; |
599 } |
1517 } |
600 |
1518 |
601 int ret = RunCertApp(progress, errors, argCount, argv); |
1519 int ret = RunCertApp(progress, errors, argCount, argv); |
602 cout << "Return value from certapp is " << ret <<endl; |
1520 cout << "Return value from certapp is " << ret <<endl; |
1521 stringstream logging; |
|
603 if(ret!= 0) |
1522 if(ret!= 0) |
604 { |
1523 { |
605 failCount++; |
1524 failCount++; |
606 file<< "Error in creating store using the unicode file name config file " << filename << " and result is " << ret << " Fail" << endl ; |
1525 logging << "Error in creating store using the unicode file name config file " << filename << " and result is " << ret << " Fail"; |
607 } |
1526 } |
608 else |
1527 else |
609 { |
1528 { |
610 passCount++; |
1529 passCount++; |
611 file << "No Error in creating store using the unicode file named config file " << filename << " and result is " << ret << " Pass" <<endl ; |
1530 logging << "No Error in creating store using the unicode file named config file " << filename << " and result is " << ret << " Pass"; |
612 } |
1531 } |
1532 |
|
1533 stringstream testCaseType("SEC-TOOLS-CERTAPP-UNICODEFILE_CREATE"); |
|
1534 writeTMSResult(file, testCaseType, 0, ret==0, logging); |
|
613 } |
1535 } |
614 |
1536 |
615 /** |
1537 /** |
616 Generate Certclient config files |
1538 Generate Certclient config files |
617 */ |
1539 */ |
846 } |
1768 } |
847 |
1769 |
848 /** |
1770 /** |
849 Generate config files with invalid values for the store |
1771 Generate config files with invalid values for the store |
850 */ |
1772 */ |
851 void TestBadConfigFiles(const stringstream &aFilename, bool aBool) |
1773 void TestBadConfigFiles(const stringstream &aFilename, bool aBool, stringstream &aTestCaseType, int aTestCaseIndex) |
852 { |
1774 { |
853 // create command line input for cacerts |
1775 // create command line input for cacerts |
854 //Ex:certapp --hcertclients=t_certclients_0.txt --hfilecertstore=t_cacerts_0.txt --out --bfilecertstore=cacerts_x.dat |
1776 //Ex:certapp --hcertclients=t_certclients_0.txt --hfilecertstore=t_cacerts_0.txt --out --bfilecertstore=cacerts_x.dat |
855 stringstream strArg1, strArg2, strArg3; |
1777 stringstream strArg1, strArg2, strArg3; |
856 stringstream configFileName; |
1778 stringstream configFileName; |
892 for(int n = 0; n<argCount4; n++) |
1814 for(int n = 0; n<argCount4; n++) |
893 { |
1815 { |
894 argument_ptr[n] = const_cast<char*>(argv_certclient[n]); |
1816 argument_ptr[n] = const_cast<char*>(argv_certclient[n]); |
895 argv = argument_ptr; |
1817 argv = argument_ptr; |
896 } |
1818 } |
897 RunCertAppToolForBadParams(argCount4, argv, configFileName); |
1819 RunCertAppToolForBadParams(argCount4, argv, configFileName, aTestCaseType, aTestCaseIndex); |
898 } |
1820 } |
899 |
1821 |
900 /** |
1822 /** |
901 Generate bad config files for cacerts |
1823 Generate bad config files for cacerts |
902 */ |
1824 */ |
903 void BadFileCaCertTests(const stringstream &aFilename ,int aValue) |
1825 void BadFileCaCertTests(const stringstream &aFilename ,int aValue, stringstream &aTestCaseType, int &aTestIndex) |
904 { |
1826 { |
905 const char **caCertPtr; |
1827 const char **caCertPtr; |
906 int count = 0; |
1828 int count = 0; |
907 switch(aValue) |
1829 switch(aValue) |
908 { |
1830 { |
914 stringstream file1, file2; |
1836 stringstream file1, file2; |
915 file1 << aFilename.str() <<"_"<<count; |
1837 file1 << aFilename.str() <<"_"<<count; |
916 file2 << aFilename.str() <<"_"<<count <<".txt"; |
1838 file2 << aFilename.str() <<"_"<<count <<".txt"; |
917 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
1839 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
918 badcertfileWriter.WriteFileEntry(*caCertPtr); |
1840 badcertfileWriter.WriteFileEntry(*caCertPtr); |
919 TestBadConfigFiles(file1, 0); |
1841 TestBadConfigFiles(file1, 0, aTestCaseType, aTestIndex++); |
920 count++; |
1842 count++; |
921 } |
1843 } |
922 break; |
1844 break; |
923 } |
1845 } |
924 case 1: |
1846 case 1: |
929 stringstream file1, file2; |
1851 stringstream file1, file2; |
930 file1 << aFilename.str() <<"_"<<count; |
1852 file1 << aFilename.str() <<"_"<<count; |
931 file2 << aFilename.str() <<"_"<<count <<".txt"; |
1853 file2 << aFilename.str() <<"_"<<count <<".txt"; |
932 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
1854 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
933 badcertfileWriter.WriteFileEntry(0,*caCertPtr); |
1855 badcertfileWriter.WriteFileEntry(0,*caCertPtr); |
934 TestBadConfigFiles(file1,0); |
1856 TestBadConfigFiles(file1,0,aTestCaseType,aTestIndex++); |
935 count++; |
1857 count++; |
936 } |
1858 } |
937 break; |
1859 break; |
938 } |
1860 } |
939 case 2: |
1861 case 2: |
944 stringstream file1, file2; |
1866 stringstream file1, file2; |
945 file1 << aFilename.str() <<"_"<<count; |
1867 file1 << aFilename.str() <<"_"<<count; |
946 file2 << aFilename.str() <<"_"<<count <<".txt"; |
1868 file2 << aFilename.str() <<"_"<<count <<".txt"; |
947 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
1869 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
948 badcertfileWriter.WriteFileEntry(0,0,*caCertPtr); |
1870 badcertfileWriter.WriteFileEntry(0,0,*caCertPtr); |
949 TestBadConfigFiles(file1,0); |
1871 TestBadConfigFiles(file1,0,aTestCaseType,aTestIndex++); |
950 count++; |
1872 count++; |
951 } |
1873 } |
952 break; |
1874 break; |
953 } |
1875 } |
954 case 3: |
1876 case 3: |
959 stringstream file1, file2; |
1881 stringstream file1, file2; |
960 file1 << aFilename.str() <<"_"<<count; |
1882 file1 << aFilename.str() <<"_"<<count; |
961 file2 << aFilename.str() <<"_"<<count <<".txt"; |
1883 file2 << aFilename.str() <<"_"<<count <<".txt"; |
962 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
1884 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
963 badcertfileWriter.WriteFileEntry(0,0,0,*caCertPtr); |
1885 badcertfileWriter.WriteFileEntry(0,0,0,*caCertPtr); |
964 TestBadConfigFiles(file1,0); |
1886 TestBadConfigFiles(file1,0,aTestCaseType,aTestIndex++); |
965 count++; |
1887 count++; |
966 } |
1888 } |
967 break; |
1889 break; |
968 } |
1890 } |
969 case 4: |
1891 case 4: |
974 stringstream file1, file2; |
1896 stringstream file1, file2; |
975 file1 << aFilename.str() <<"_"<<count; |
1897 file1 << aFilename.str() <<"_"<<count; |
976 file2 << aFilename.str() <<"_"<<count <<".txt"; |
1898 file2 << aFilename.str() <<"_"<<count <<".txt"; |
977 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
1899 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
978 badcertfileWriter.WriteFileEntry(0,0,0,0,*caCertPtr); |
1900 badcertfileWriter.WriteFileEntry(0,0,0,0,*caCertPtr); |
979 TestBadConfigFiles(file1,0); |
1901 TestBadConfigFiles(file1,0,aTestCaseType,aTestIndex++); |
980 count++; |
1902 count++; |
981 } |
1903 } |
982 break; |
1904 break; |
983 } |
1905 } |
984 case 5: |
1906 case 5: |
989 stringstream file1, file2; |
1911 stringstream file1, file2; |
990 file1 << aFilename.str() <<"_"<<count; |
1912 file1 << aFilename.str() <<"_"<<count; |
991 file2 << aFilename.str() <<"_"<<count <<".txt"; |
1913 file2 << aFilename.str() <<"_"<<count <<".txt"; |
992 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
1914 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
993 badcertfileWriter.WriteFileEntry(0,0,0,0,0,*caCertPtr); |
1915 badcertfileWriter.WriteFileEntry(0,0,0,0,0,*caCertPtr); |
994 TestBadConfigFiles(file1,0); |
1916 TestBadConfigFiles(file1,0,aTestCaseType,aTestIndex++); |
995 count++; |
1917 count++; |
996 } |
1918 } |
997 break; |
1919 break; |
998 } |
1920 } |
999 case 6: |
1921 case 6: |
1003 stringstream file1, file2; |
1925 stringstream file1, file2; |
1004 file1 << aFilename.str() <<"_"<<count; |
1926 file1 << aFilename.str() <<"_"<<count; |
1005 file2 << aFilename.str() <<"_"<<count <<".txt"; |
1927 file2 << aFilename.str() <<"_"<<count <<".txt"; |
1006 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
1928 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
1007 badcertfileWriter.WriteFileEntry(0,0,0,0,0,0,*caCertPtr); |
1929 badcertfileWriter.WriteFileEntry(0,0,0,0,0,0,*caCertPtr); |
1008 TestBadConfigFiles(file1,0); |
1930 TestBadConfigFiles(file1,0,aTestCaseType,aTestIndex++); |
1009 break; |
1931 break; |
1010 } |
1932 } |
1011 case 7: |
1933 case 7: |
1012 { |
1934 { |
1013 //Tests for BadTrusteds |
1935 //Tests for BadTrusteds |
1016 stringstream file1, file2; |
1938 stringstream file1, file2; |
1017 file1 << aFilename.str() <<"_"<<count; |
1939 file1 << aFilename.str() <<"_"<<count; |
1018 file2 << aFilename.str() <<"_"<<count <<".txt"; |
1940 file2 << aFilename.str() <<"_"<<count <<".txt"; |
1019 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
1941 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
1020 badcertfileWriter.WriteFileEntry(0,0,0,0,0,0,0,*caCertPtr); |
1942 badcertfileWriter.WriteFileEntry(0,0,0,0,0,0,0,*caCertPtr); |
1021 TestBadConfigFiles(file1,0); |
1943 TestBadConfigFiles(file1,0,aTestCaseType,aTestIndex++); |
1022 count++; |
1944 count++; |
1023 } |
1945 } |
1024 break; |
1946 break; |
1025 } |
1947 } |
1026 case 8: |
1948 case 8: |
1031 stringstream file1, file2; |
1953 stringstream file1, file2; |
1032 file1 << aFilename.str() <<"_"<<count; |
1954 file1 << aFilename.str() <<"_"<<count; |
1033 file2 << aFilename.str() <<"_"<<count <<".txt"; |
1955 file2 << aFilename.str() <<"_"<<count <<".txt"; |
1034 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
1956 FileBadCertStoreConfigWriter badcertfileWriter(file2); |
1035 badcertfileWriter.WriteFileEntry(0,0,0,0,0,0,0,0,*caCertPtr); |
1957 badcertfileWriter.WriteFileEntry(0,0,0,0,0,0,0,0,*caCertPtr); |
1036 TestBadConfigFiles(file1,0); |
1958 TestBadConfigFiles(file1,0,aTestCaseType,aTestIndex++); |
1037 count++; |
1959 count++; |
1038 } |
1960 } |
1039 break; |
1961 break; |
1040 } |
1962 } |
1041 default: |
1963 default: |
1045 |
1967 |
1046 |
1968 |
1047 /** |
1969 /** |
1048 Generate bad Certclient config files |
1970 Generate bad Certclient config files |
1049 */ |
1971 */ |
1050 void BadFileCertClientsTests(const stringstream &aFilename, int aIndex) |
1972 void BadFileCertClientsTests(const stringstream &aFilename, int aIndex, stringstream &aTestCaseType, int &aTestCaseIndex) |
1051 { |
1973 { |
1052 FileBadCertClientConfigWriter certfileWriter(aFilename); |
1974 FileBadCertClientConfigWriter certfileWriter(aFilename); |
1053 const char *certfilePtr1, *certfilePtr2; |
1975 const char *certfilePtr1, *certfilePtr2; |
1054 |
1976 |
1055 switch(aIndex) |
1977 switch(aIndex) |
1064 FileBadCertClientConfigWriter certfileWriter(file1); |
1986 FileBadCertClientConfigWriter certfileWriter(file1); |
1065 certfilePtr1 = goodcertclient_array[0]; // good app name and |
1987 certfilePtr1 = goodcertclient_array[0]; // good app name and |
1066 certfilePtr2 = badUids[i]; |
1988 certfilePtr2 = badUids[i]; |
1067 certfileWriter.WriteCertClientUid(certfilePtr2); // bad uid entry |
1989 certfileWriter.WriteCertClientUid(certfilePtr2); // bad uid entry |
1068 certfileWriter.WriteCertClientName(certfilePtr1); |
1990 certfileWriter.WriteCertClientName(certfilePtr1); |
1069 CertClientBadParamsFuncCall(file2); |
1991 CertClientBadParamsFuncCall(file2, aTestCaseType, aTestCaseIndex++); |
1070 } |
1992 } |
1071 break; |
1993 break; |
1072 } |
1994 } |
1073 |
1995 |
1074 case 1: |
1996 case 1: |
1081 FileBadCertClientConfigWriter certfileWriter(file1); |
2003 FileBadCertClientConfigWriter certfileWriter(file1); |
1082 certfilePtr1 = badcertclient_array[i]; |
2004 certfilePtr1 = badcertclient_array[i]; |
1083 certfilePtr2 = goodUids[0]; |
2005 certfilePtr2 = goodUids[0]; |
1084 certfileWriter.WriteCertClientUid(certfilePtr2); |
2006 certfileWriter.WriteCertClientUid(certfilePtr2); |
1085 certfileWriter.WriteCertClientName(certfilePtr1); |
2007 certfileWriter.WriteCertClientName(certfilePtr1); |
1086 CertClientBadParamsFuncCall(file2); |
2008 CertClientBadParamsFuncCall(file2, aTestCaseType, aTestCaseIndex++); |
1087 } |
2009 } |
1088 break; |
2010 break; |
1089 } |
2011 } |
1090 |
2012 |
1091 // multiple names mapping to single uid |
2013 // multiple names mapping to single uid |
1099 certfilePtr1 = goodAppNames[i]; //app names - SW Install,SW install Ocsp Signing etc. |
2021 certfilePtr1 = goodAppNames[i]; //app names - SW Install,SW install Ocsp Signing etc. |
1100 certfilePtr2 = goodUids[0]; |
2022 certfilePtr2 = goodUids[0]; |
1101 certfileWriter.WriteCertClientName(certfilePtr1); |
2023 certfileWriter.WriteCertClientName(certfilePtr1); |
1102 certfileWriter.WriteCertClientUid(certfilePtr2); |
2024 certfileWriter.WriteCertClientUid(certfilePtr2); |
1103 } |
2025 } |
1104 CertClientBadParamsFuncCall(file1); |
2026 CertClientBadParamsFuncCall(file1, aTestCaseType, aTestCaseIndex++); |
1105 break; |
2027 break; |
1106 } |
2028 } |
1107 |
2029 |
1108 default: |
2030 default: |
1109 break; |
2031 break; |
1110 } |
2032 } |
1111 } |
2033 } |
1112 |
2034 |
1113 |
2035 |
1114 void CertClientBadParamsFuncCall(stringstream &aFileName) |
2036 void CertClientBadParamsFuncCall(stringstream &aFileName, stringstream &aTestCaseType, int aTestCaseIndex) |
1115 { |
2037 { |
1116 //Ex:certapp --hcertclients=t_certclients_0.txt --out --bcertclients=t_certclients_0.dat |
2038 //Ex:certapp --hcertclients=t_certclients_0.txt --out --bcertclients=t_certclients_0.dat |
1117 stringstream strArg1, strArg2, strArg3; |
2039 stringstream strArg1, strArg2, strArg3; |
1118 strArg1 <<"--hcertclients=" << aFileName.str() << ".txt"; |
2040 strArg1 <<"--hcertclients=" << aFileName.str() << ".txt"; |
1119 |
2041 |
1136 for(int n = 0; n<argCount3; n++) |
2058 for(int n = 0; n<argCount3; n++) |
1137 { |
2059 { |
1138 argument_ptr[n] = const_cast<char*>(argv_certclient[n]); |
2060 argument_ptr[n] = const_cast<char*>(argv_certclient[n]); |
1139 argv = argument_ptr; |
2061 argv = argument_ptr; |
1140 } |
2062 } |
1141 RunCertAppToolForBadParams(argCount3, argv, aFileName); |
2063 RunCertAppToolForBadParams(argCount3, argv, aFileName, aTestCaseType, aTestCaseIndex); |
1142 } |
2064 } |
1143 |
2065 |
1144 |
2066 |
1145 /** |
2067 /** |
1146 Generate config file for swicert |
2068 Generate config file for swicert |
1147 */ |
2069 */ |
1148 void BadSwiCertTests(const stringstream &aFileName, int aIndex) |
2070 void BadSwiCertTests(const stringstream &aFileName, int aIndex, stringstream &aTestCaseType, int &aTestIndex) |
1149 { |
2071 { |
1150 const char **swicertPtr1; |
2072 const char **swicertPtr1; |
1151 int count = 0 ; |
2073 int count = 0 ; |
1152 switch(aIndex) |
2074 switch(aIndex) |
1153 { |
2075 { |
1159 stringstream file1, file2; |
2081 stringstream file1, file2; |
1160 file1 << aFileName.str() <<"_"<<count; |
2082 file1 << aFileName.str() <<"_"<<count; |
1161 file2 << aFileName.str() <<"_"<<count <<".txt"; |
2083 file2 << aFileName.str() <<"_"<<count <<".txt"; |
1162 SwiBadCertStoreConfigWriter badswiWriter(file2); |
2084 SwiBadCertStoreConfigWriter badswiWriter(file2); |
1163 badswiWriter.WriteSwiEntry(*swicertPtr1); |
2085 badswiWriter.WriteSwiEntry(*swicertPtr1); |
1164 TestBadConfigFiles(file1,1); |
2086 TestBadConfigFiles(file1,1,aTestCaseType,aTestIndex++); |
1165 count++; |
2087 count++; |
1166 } |
2088 } |
1167 break; |
2089 break; |
1168 } |
2090 } |
1169 |
2091 |
1175 stringstream file1, file2; |
2097 stringstream file1, file2; |
1176 file1 << aFileName.str() <<"_"<<count; |
2098 file1 << aFileName.str() <<"_"<<count; |
1177 file2 << aFileName.str() <<"_"<<count <<".txt"; |
2099 file2 << aFileName.str() <<"_"<<count <<".txt"; |
1178 SwiBadCertStoreConfigWriter badswiWriter(file2); |
2100 SwiBadCertStoreConfigWriter badswiWriter(file2); |
1179 badswiWriter.WriteSwiEntry(0,*swicertPtr1); |
2101 badswiWriter.WriteSwiEntry(0,*swicertPtr1); |
1180 TestBadConfigFiles(file1,1); |
2102 TestBadConfigFiles(file1,1,aTestCaseType,aTestIndex++); |
1181 count++; |
2103 count++; |
1182 } |
2104 } |
1183 break; |
2105 break; |
1184 } |
2106 } |
1185 case 2: |
2107 case 2: |
1190 stringstream file1, file2; |
2112 stringstream file1, file2; |
1191 file1 << aFileName.str() <<"_"<<count; |
2113 file1 << aFileName.str() <<"_"<<count; |
1192 file2 << aFileName.str() <<"_"<<count <<".txt"; |
2114 file2 << aFileName.str() <<"_"<<count <<".txt"; |
1193 SwiBadCertStoreConfigWriter badswiWriter(file2); |
2115 SwiBadCertStoreConfigWriter badswiWriter(file2); |
1194 badswiWriter.WriteSwiEntry(0,0,*swicertPtr1); |
2116 badswiWriter.WriteSwiEntry(0,0,*swicertPtr1); |
1195 TestBadConfigFiles(file1,1); |
2117 TestBadConfigFiles(file1,1,aTestCaseType,aTestIndex++); |
1196 count++; |
2118 count++; |
1197 } |
2119 } |
1198 break; |
2120 break; |
1199 } |
2121 } |
1200 case 3: |
2122 case 3: |
1205 stringstream file1, file2; |
2127 stringstream file1, file2; |
1206 file1 << aFileName.str() <<"_"<<count; |
2128 file1 << aFileName.str() <<"_"<<count; |
1207 file2 << aFileName.str() <<"_"<<count <<".txt"; |
2129 file2 << aFileName.str() <<"_"<<count <<".txt"; |
1208 SwiBadCertStoreConfigWriter badswiWriter(file2); |
2130 SwiBadCertStoreConfigWriter badswiWriter(file2); |
1209 badswiWriter.WriteSwiEntry(0,0,0,*swicertPtr1); |
2131 badswiWriter.WriteSwiEntry(0,0,0,*swicertPtr1); |
1210 TestBadConfigFiles(file1,1); |
2132 TestBadConfigFiles(file1,1,aTestCaseType,aTestIndex++); |
1211 count++; |
2133 count++; |
1212 } |
2134 } |
1213 break; |
2135 break; |
1214 } |
2136 } |
1215 case 4: |
2137 case 4: |
1220 stringstream file1, file2; |
2142 stringstream file1, file2; |
1221 file1 << aFileName.str() <<"_"<<count; |
2143 file1 << aFileName.str() <<"_"<<count; |
1222 file2 << aFileName.str() <<"_"<<count <<".txt"; |
2144 file2 << aFileName.str() <<"_"<<count <<".txt"; |
1223 SwiBadCertStoreConfigWriter badswiWriter(file2); |
2145 SwiBadCertStoreConfigWriter badswiWriter(file2); |
1224 badswiWriter.WriteSwiEntry(0,0,0,0,*swicertPtr1); |
2146 badswiWriter.WriteSwiEntry(0,0,0,0,*swicertPtr1); |
1225 TestBadConfigFiles(file1,1); |
2147 TestBadConfigFiles(file1,1,aTestCaseType,aTestIndex++); |
1226 count++; |
2148 count++; |
1227 } |
2149 } |
1228 break; |
2150 break; |
1229 } |
2151 } |
1230 case 5: |
2152 case 5: |
1235 stringstream file1, file2; |
2157 stringstream file1, file2; |
1236 file1 << aFileName.str() <<"_"<<count; |
2158 file1 << aFileName.str() <<"_"<<count; |
1237 file2 << aFileName.str() <<"_"<<count <<".txt"; |
2159 file2 << aFileName.str() <<"_"<<count <<".txt"; |
1238 SwiBadCertStoreConfigWriter badswiWriter(file2); |
2160 SwiBadCertStoreConfigWriter badswiWriter(file2); |
1239 badswiWriter.WriteSwiEntry(0,0,0,0,0,*swicertPtr1); |
2161 badswiWriter.WriteSwiEntry(0,0,0,0,0,*swicertPtr1); |
1240 TestBadConfigFiles(file1,1); |
2162 TestBadConfigFiles(file1,1,aTestCaseType,aTestIndex++); |
1241 count++; |
2163 count++; |
1242 } |
2164 } |
1243 break; |
2165 break; |
1244 } |
2166 } |
1245 case 6: |
2167 case 6: |
1250 stringstream file1, file2; |
2172 stringstream file1, file2; |
1251 file1 << aFileName.str() <<"_"<<count; |
2173 file1 << aFileName.str() <<"_"<<count; |
1252 file2 << aFileName.str() <<"_"<<count <<".txt"; |
2174 file2 << aFileName.str() <<"_"<<count <<".txt"; |
1253 SwiBadCertStoreConfigWriter badswiWriter(file2); |
2175 SwiBadCertStoreConfigWriter badswiWriter(file2); |
1254 badswiWriter.WriteSwiEntry(0,0,0,0,0,0,*swicertPtr1); |
2176 badswiWriter.WriteSwiEntry(0,0,0,0,0,0,*swicertPtr1); |
1255 TestBadConfigFiles(file1,1); |
2177 TestBadConfigFiles(file1,1,aTestCaseType,aTestIndex++); |
1256 count++; |
2178 count++; |
1257 } |
2179 } |
1258 break; |
2180 break; |
1259 } |
2181 } |
1260 case 7: |
2182 case 7: |
1265 stringstream file1, file2; |
2187 stringstream file1, file2; |
1266 file1 << aFileName.str() <<"_"<<count; |
2188 file1 << aFileName.str() <<"_"<<count; |
1267 file2 << aFileName.str() <<"_"<<count <<".txt"; |
2189 file2 << aFileName.str() <<"_"<<count <<".txt"; |
1268 SwiBadCertStoreConfigWriter badswiWriter(file2); |
2190 SwiBadCertStoreConfigWriter badswiWriter(file2); |
1269 badswiWriter.WriteSwiEntry(0,0,0,0,0,0,0,*swicertPtr1); |
2191 badswiWriter.WriteSwiEntry(0,0,0,0,0,0,0,*swicertPtr1); |
1270 TestBadConfigFiles(file1,1); |
2192 TestBadConfigFiles(file1,1,aTestCaseType,aTestIndex++); |
1271 count++; |
2193 count++; |
1272 } |
2194 } |
1273 break; |
2195 break; |
1274 } |
2196 } |
1275 case 8: |
2197 case 8: |
1280 stringstream file1, file2; |
2202 stringstream file1, file2; |
1281 file1 << aFileName.str() <<"_"<<count; |
2203 file1 << aFileName.str() <<"_"<<count; |
1282 file2 << aFileName.str() <<"_"<<count <<".txt"; |
2204 file2 << aFileName.str() <<"_"<<count <<".txt"; |
1283 SwiBadCertStoreConfigWriter badswiWriter(file2); |
2205 SwiBadCertStoreConfigWriter badswiWriter(file2); |
1284 badswiWriter.WriteSwiEntry(0,0,0,0,0,0,0,0,*swicertPtr1); |
2206 badswiWriter.WriteSwiEntry(0,0,0,0,0,0,0,0,*swicertPtr1); |
1285 TestBadConfigFiles(file1,1); |
2207 TestBadConfigFiles(file1,1,aTestCaseType,aTestIndex++); |
1286 count++; |
2208 count++; |
1287 } |
2209 } |
1288 break; |
2210 break; |
1289 } |
2211 } |
1290 case 9: |
2212 case 9: |
1295 stringstream file1, file2; |
2217 stringstream file1, file2; |
1296 file1 << aFileName.str() <<"_"<<count; |
2218 file1 << aFileName.str() <<"_"<<count; |
1297 file2 << aFileName.str() <<"_"<<count <<".txt"; |
2219 file2 << aFileName.str() <<"_"<<count <<".txt"; |
1298 SwiBadCertStoreConfigWriter badswiWriter(file2); |
2220 SwiBadCertStoreConfigWriter badswiWriter(file2); |
1299 badswiWriter.WriteSwiEntry(0,0,0,0,0,0,0,0,0,*swicertPtr1); |
2221 badswiWriter.WriteSwiEntry(0,0,0,0,0,0,0,0,0,*swicertPtr1); |
1300 TestBadConfigFiles(file1,1); |
2222 TestBadConfigFiles(file1,1,aTestCaseType,aTestIndex++); |
1301 count++; |
2223 count++; |
1302 } |
2224 } |
1303 break; |
2225 break; |
1304 } |
2226 } |
1305 case 10: |
2227 case 10: |
1310 stringstream file1, file2; |
2232 stringstream file1, file2; |
1311 file1 << aFileName.str() <<"_"<<count; |
2233 file1 << aFileName.str() <<"_"<<count; |
1312 file2 << aFileName.str() <<"_"<<count <<".txt"; |
2234 file2 << aFileName.str() <<"_"<<count <<".txt"; |
1313 SwiBadCertStoreConfigWriter badswiWriter(file2); |
2235 SwiBadCertStoreConfigWriter badswiWriter(file2); |
1314 badswiWriter.WriteSwiEntry(0,0,0,0,0,0,0,0,0,0,*swicertPtr1); |
2236 badswiWriter.WriteSwiEntry(0,0,0,0,0,0,0,0,0,0,*swicertPtr1); |
1315 TestBadConfigFiles(file1,1); |
2237 TestBadConfigFiles(file1,1,aTestCaseType,aTestIndex++); |
1316 count++; |
2238 count++; |
1317 } |
2239 } |
1318 break; |
2240 break; |
1319 } |
2241 } |
1320 default: |
2242 default: |
1321 break; |
2243 break; |
1322 } |
2244 } |
1323 } |
2245 } |
1324 |
2246 |
2247 /** |
|
2248 @SYMTestCaseID SEC-TOOLS-CERTAPP-EMPTYFILE_CREATE-0000 |
|
2249 @SYMTestCaseDesc Test the tool with empty configuration file as input |
|
2250 */ |
|
2251 /** |
|
2252 @SYMTestCaseID SEC-TOOLS-CERTAPP-EMPTYFILE_CREATE-0001 |
|
2253 @SYMTestCaseDesc Test the tool with empty configuration file as input |
|
2254 */ |
|
2255 /** |
|
2256 @SYMTestCaseID SEC-TOOLS-CERTAPP-EMPTYFILE_CREATE-0002 |
|
2257 @SYMTestCaseDesc Test the tool with empty configuration file as input |
|
2258 */ |
|
1325 /** |
2259 /** |
1326 Test cases to test the tool with empty configuration files as input for all the stores |
2260 Test cases to test the tool with empty configuration files as input for all the stores |
1327 */ |
2261 */ |
1328 void TestsWithEmptyConfigFile() |
2262 void TestsWithEmptyConfigFile() |
1329 { |
2263 { |
2264 stringstream testCaseType("SEC-TOOLS-CERTAPP-EMPTYFILE_CREATE"); |
|
1330 for(int i = 0 ; i<3 ; i++) |
2265 for(int i = 0 ; i<3 ; i++) |
1331 { |
2266 { |
1332 stringstream emptyConfigFileName, configFileName1, configFileName2; |
2267 stringstream emptyConfigFileName, configFileName1, configFileName2; |
1333 emptyConfigFileName<< "SDP-Security_Tools-CertApp-EmptyFile_000"<< i <<".txt"; |
2268 emptyConfigFileName<< "SDP-Security_Tools-CertApp-EmptyFile_000"<< i <<".txt"; |
1334 switch(i) |
2269 switch(i) |
1381 for(int z=0; z<argcount; z++) |
2316 for(int z=0; z<argcount; z++) |
1382 { |
2317 { |
1383 cout << "Testing with empty configuration file" << argv[z] <<endl; |
2318 cout << "Testing with empty configuration file" << argv[z] <<endl; |
1384 } |
2319 } |
1385 |
2320 |
1386 RunCertAppTool(argcount, argv, emptyConfigFileName); |
2321 RunCertAppTool(argcount, argv, emptyConfigFileName, testCaseType, i); |
1387 } |
2322 } |
1388 } |
2323 } |
1389 |
2324 |
2325 /** |
|
2326 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEFORMATS_CREATE-0000 |
|
2327 @SYMTestCaseDesc Test the certapp tool for different file encode formats |
|
2328 */ |
|
2329 /** |
|
2330 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEFORMATS_CREATE-0001 |
|
2331 @SYMTestCaseDesc Test the certapp tool for different file encode formats |
|
2332 */ |
|
2333 /** |
|
2334 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEFORMATS_CREATE-0002 |
|
2335 @SYMTestCaseDesc Test the certapp tool for different file encode formats |
|
2336 */ |
|
2337 /** |
|
2338 @SYMTestCaseID SEC-TOOLS-CERTAPP-FILEFORMATS_CREATE-0003 |
|
2339 @SYMTestCaseDesc Test the certapp tool for different file encode formats |
|
2340 */ |
|
1390 /** |
2341 /** |
1391 Code to test the certapp tool for different file encode formats |
2342 Code to test the certapp tool for different file encode formats |
1392 */ |
2343 */ |
1393 void TestsWithEncodedFileFormats() |
2344 void TestsWithEncodedFileFormats() |
1394 { |
2345 { |
2346 stringstream testCaseType("SEC-TOOLS-CERTAPP-FILEFORMATS_CREATE"); |
|
2347 bool hasResult; |
|
2348 |
|
1395 //Provide files with different encoded formats |
2349 //Provide files with different encoded formats |
1396 for(int i = 0; i<4; i++) |
2350 for(int i = 0; i<4; i++) |
1397 { |
2351 { |
1398 stringstream unicodeName, outputFileName, strArg3; |
2352 stringstream unicodeName, outputFileName, strArg3; |
1399 const char *argv_certclient[KIndex]; |
2353 const char *argv_certclient[KIndex]; |
1426 } |
2380 } |
1427 |
2381 |
1428 int ret = RunCertApp(progress, errors, KIndex, argv); |
2382 int ret = RunCertApp(progress, errors, KIndex, argv); |
1429 cout << "Return value from RunCertApp tool is " << ret << endl; |
2383 cout << "Return value from RunCertApp tool is " << ret << endl; |
1430 |
2384 |
2385 hasResult = false; |
|
2386 stringstream logging; |
|
1431 if(ret!= 0 && ((strcmp(unicodeName.str().c_str(),"--hfilecertstore=ucs2-bigendian.txt")==0) || (strcmp(unicodeName.str().c_str(),"--hfilecertstore=ucs2-littleendian.txt")==0))) |
2387 if(ret!= 0 && ((strcmp(unicodeName.str().c_str(),"--hfilecertstore=ucs2-bigendian.txt")==0) || (strcmp(unicodeName.str().c_str(),"--hfilecertstore=ucs2-littleendian.txt")==0))) |
1432 { |
2388 { |
1433 passCount++; |
2389 passCount++; |
1434 file<< "Tool doesnt support for UCS encoded file-"<< outputFileName.str() <<" so the result is " << ret << " Pass" << endl ; |
2390 logging << "Tool doesnt support for UCS encoded file-"<< outputFileName.str() <<" so the result is " << ret << " Pass"; |
2391 hasResult = true; |
|
1435 } |
2392 } |
1436 else if(ret== 0 && ((strcmp(unicodeName.str().c_str(),"--hfilecertstore=utf8.txt") ==0) || (strcmp(unicodeName.str().c_str(),"--hfilecertstore=utf8_without_bom.txt")==0))) |
2393 else if(ret== 0 && ((strcmp(unicodeName.str().c_str(),"--hfilecertstore=utf8.txt") ==0) || (strcmp(unicodeName.str().c_str(),"--hfilecertstore=utf8_without_bom.txt")==0))) |
1437 { |
2394 { |
1438 passCount++; |
2395 passCount++; |
1439 file << "No Error in creating store for UTF8 encoded file-"<<outputFileName.str()<< " and result is " << ret << " Pass" <<endl ; |
2396 logging << "No Error in creating store for UTF8 encoded file-"<<outputFileName.str()<< " and result is " << ret << " Pass"; |
2397 hasResult = true; |
|
2398 } |
|
2399 |
|
2400 if (hasResult) |
|
2401 { |
|
2402 writeTMSResult(file, testCaseType, i, true, logging); |
|
1440 } |
2403 } |
1441 } //End of encoded file formats testing |
2404 } //End of encoded file formats testing |
1442 } |
2405 } |
1443 |
2406 |
2407 /** |
|
2408 @SYMTestCaseID SEC-TOOLS-CERTAPP-AGGRCERTSTORE_CREATE-0000 |
|
2409 @SYMTestCaseDesc Test case for REQ-10314 (Reviewing Aggregate Certificate DataBase) |
|
2410 */ |
|
2411 /** |
|
2412 @SYMTestCaseID SEC-TOOLS-CERTAPP-AGGRCERTSTORE_CREATE-0001 |
|
2413 @SYMTestCaseDesc Test case for REQ-10314 (Reviewing Aggregate Certificate DataBase) |
|
2414 */ |
|
1444 /** |
2415 /** |
1445 Test case for REQ-10314 (Reviewing Aggregate Certificate DataBase) |
2416 Test case for REQ-10314 (Reviewing Aggregate Certificate DataBase) |
1446 */ |
2417 */ |
1447 void TestToReviewingAggregateStore() |
2418 void TestToReviewingAggregateStore() |
1448 { |
2419 { |
2420 stringstream testCaseType("SEC-TOOLS-CERTAPP-AGGRCERTSTORE_CREATE"); |
|
2421 |
|
1449 for(int index = 0; index<2; index++) |
2422 for(int index = 0; index<2; index++) |
1450 { |
2423 { |
1451 stringstream file1, file2; |
2424 stringstream file1, file2; |
1452 const char *argv_certclient[4]; |
2425 const char *argv_certclient[4]; |
1453 argv_certclient[2] = "--out"; |
2426 argv_certclient[2] = "--out"; |
1488 argument_ptr[n] = const_cast<char*>(argv_certclient[n]); |
2461 argument_ptr[n] = const_cast<char*>(argv_certclient[n]); |
1489 argv = argument_ptr; |
2462 argv = argument_ptr; |
1490 } |
2463 } |
1491 |
2464 |
1492 int ret = RunCertApp(progress, errors, KIndex, argv); |
2465 int ret = RunCertApp(progress, errors, KIndex, argv); |
2466 stringstream logging; |
|
1493 if(!ret) |
2467 if(!ret) |
1494 { |
2468 { |
1495 passCount++; |
2469 passCount++; |
1496 int compareValue = CompareFiles(file1,file2); // compare with the reference files in perforce |
2470 int compareValue = CompareFiles(file1,file2); // compare with the reference files in perforce |
1497 if (compareValue) |
2471 if (compareValue) |
1498 { |
2472 { |
1499 file << "Failed to successfully create Aggregate Database for " << file1.str() << " is Fail" <<endl; |
2473 logging << "Failed to successfully create Aggregate Database for " << file1.str() << " is Fail"; |
2474 |
|
1500 } |
2475 } |
1501 else |
2476 else |
1502 { |
2477 { |
1503 file << "Successfully created Aggregate Database(text form) for " <<file1.str() << " result is Pass" <<endl; |
2478 logging << "Successfully created Aggregate Database(text form) for " <<file1.str() << " result is Pass"; |
1504 } |
2479 } |
1505 } |
2480 } |
1506 else |
2481 else |
1507 { |
2482 { |
1508 failCount++; |
2483 failCount++; |
1509 file << "Failed to dump the stores to single text format for " <<file1.str() <<endl; |
2484 logging << "Failed to dump the stores to single text format for " <<file1.str(); |
1510 } |
2485 } |
2486 |
|
2487 writeTMSResult(file, testCaseType, index, !ret, logging); |
|
1511 } |
2488 } |
1512 } |
2489 } |
1513 |
2490 |
1514 |
2491 |
2492 /** |
|
2493 @SYMTestCaseID SEC-TOOLS-CERTAPP-DECODEENCODE_COMPARE-0000 |
|
2494 @SYMTestCaseDesc Encode-decode test for certclient store |
|
2495 */ |
|
1515 /** |
2496 /** |
1516 TestCase to test the req of 10313- decode/encode certstore |
2497 TestCase to test the req of 10313- decode/encode certstore |
1517 Encode-decode test for certclient store |
2498 Encode-decode test for certclient store |
1518 */ |
2499 */ |
1519 void TestToDecodeAndEncodeStore() |
2500 void TestToDecodeAndEncodeStore() |
1520 { |
2501 { |
2502 stringstream testCaseType("SEC-TOOLS-CERTAPP-DECODEENCODE_COMPARE"); |
|
2503 |
|
1521 stringstream outputFileName, strArg1, strArg2; |
2504 stringstream outputFileName, strArg1, strArg2; |
1522 outputFileName <<"SDP-Security_Tools-CertApp-DecodeEncode-0000"; |
2505 outputFileName <<"SDP-Security_Tools-CertApp-DecodeEncode-0000"; |
1523 strArg1 << "decodeoutput1.txt"; |
2506 strArg1 << "decodeoutput1.txt"; |
1524 strArg2 << "decodeoutput2.txt"; |
2507 strArg2 << "decodeoutput2.txt"; |
1525 |
2508 |
1538 argv_certclient[0] = "--bcertclients=decodeoutput.dat"; |
2521 argv_certclient[0] = "--bcertclients=decodeoutput.dat"; |
1539 argv_certclient[2] = "--hcertclients=decodeoutput2.txt"; |
2522 argv_certclient[2] = "--hcertclients=decodeoutput2.txt"; |
1540 decodeEncodeCertAppCall(argv_certclient); |
2523 decodeEncodeCertAppCall(argv_certclient); |
1541 |
2524 |
1542 int compVal = CompareFiles(strArg1, strArg2); |
2525 int compVal = CompareFiles(strArg1, strArg2); |
2526 stringstream logging; |
|
1543 cout << "Return value of comparision is " << compVal <<endl; |
2527 cout << "Return value of comparision is " << compVal <<endl; |
1544 if (compVal) |
2528 if (compVal) |
1545 { |
2529 { |
1546 failCount++; |
2530 failCount++; |
1547 file << "Encode-Decode fail for " <<outputFileName.str() << " result is Fail" <<endl; |
2531 logging << "Encode-Decode fail for " <<outputFileName.str() << " result is Fail"; |
1548 } |
2532 } |
1549 else |
2533 else |
1550 { |
2534 { |
1551 passCount++; |
2535 passCount++; |
1552 file << "Encode-Decode Pass for " <<outputFileName.str() << " result is Pass" <<endl; |
2536 logging << "Encode-Decode Pass for " <<outputFileName.str() << " result is Pass"; |
1553 } |
2537 } |
2538 |
|
2539 writeTMSResult(file, testCaseType, 0, compVal==0, logging); |
|
1554 } |
2540 } |
1555 |
2541 |
1556 void decodeEncodeCertAppCall(const char *aArray[]) |
2542 void decodeEncodeCertAppCall(const char *aArray[]) |
1557 { |
2543 { |
1558 char *argument_ptr[3]; |
2544 char *argument_ptr[3]; |
1616 |
2602 |
1617 |
2603 |
1618 /** |
2604 /** |
1619 Generate script files for the filecertstore emulator tests |
2605 Generate script files for the filecertstore emulator tests |
1620 */ |
2606 */ |
1621 void GenerateGoodCertClientTestScripts(const stringstream &aFilename) |
2607 void GenerateGoodCertClientTestScripts(const stringstream &aFilename, const stringstream &aTestCaseType, int &aTestIndex) |
1622 { |
2608 { |
1623 CertClientsStoreScriptGeneration cert_clients(aFilename); |
2609 CertClientsStoreScriptGeneration cert_clients(aFilename); |
1624 |
2610 |
1625 cert_clients.WriteInitialiseCertClient(); |
2611 cert_clients.WriteInitialiseCertClient(aTestCaseType, aTestIndex); |
1626 cert_clients.WriteGetCount(KAppUidIndex); |
2612 cert_clients.WriteGetCount(KAppUidIndex, aTestCaseType, aTestIndex); |
1627 cert_clients.WriteGetApplicationsList(); |
2613 cert_clients.WriteGetApplicationsList(aTestCaseType, aTestIndex); |
1628 |
2614 |
1629 for(int i = 0; i<KAppUidIndex;i++) |
2615 for(int i = 0; i<KAppUidIndex;i++) |
1630 { |
2616 { |
1631 const char *goodlabel = goodcertclient_array[i]; |
2617 const char *goodlabel = goodcertclient_array[i]; |
1632 const char *uid = gooddecimalUid_array[i]; |
2618 const char *uid = gooddecimalUid_array[i]; |
1633 cert_clients.WriteGetAppWithUid(goodlabel, uid); |
2619 cert_clients.WriteGetAppWithUid(goodlabel, uid, aTestCaseType, aTestIndex); |
1634 } |
2620 } |
1635 cert_clients.WriteDestroyManager(); |
2621 cert_clients.WriteDestroyManager(aTestCaseType, aTestIndex); |
1636 } |
2622 } |
1637 |
2623 |
1638 /** |
2624 /** |
1639 Generates config files for cacerts |
2625 Generates config files for cacerts |
1640 */ |
2626 */ |
1641 void GenerateGoodCaCertsTestScripts(const stringstream &aFilename) |
2627 void GenerateGoodCaCertsTestScripts(const stringstream &aFilename, const stringstream &aTestCaseType, int &aTestIndex) |
1642 { |
2628 { |
1643 FileStoreScriptGeneration fileStore(aFilename); |
2629 FileStoreScriptGeneration fileStore(aFilename); |
1644 |
2630 |
1645 const char *mode = "write"; |
2631 const char *mode = "write"; |
1646 const char *ownertype = goodOwnerType[0]; //CA ownerType |
2632 const char *ownertype = goodOwnerType[0]; //CA ownerType |
1647 |
2633 |
1648 fileStore.WriteInitialiseCert(mode); |
2634 fileStore.WriteInitialiseCert(mode, aTestCaseType, aTestIndex); |
1649 fileStore.WriteListcert(ownertype); |
2635 fileStore.WriteListcert(ownertype, aTestCaseType, aTestIndex); |
1650 |
2636 |
1651 for(int i = 0; i<6;i++) |
2637 for(int i = 0; i<6;i++) |
1652 { |
2638 { |
1653 const char *trust = goodTrust[0]; // true |
2639 const char *trust = goodTrust[0]; // true |
1654 const char *goodlabel = goodEmuCert_array[i]; // list of label - root5ca , symbiandtestcsa, symbiantestrcsa |
2640 const char *goodlabel = goodEmuCert_array[i]; // list of label - root5ca , symbiandtestcsa, symbiantestrcsa |
1655 |
2641 |
1656 fileStore.WriteGetCertificateDetails(goodlabel); |
2642 fileStore.WriteGetCertificateDetails(goodlabel, aTestCaseType, aTestIndex); |
1657 fileStore.WriteGetTrust(goodlabel,trust); |
2643 fileStore.WriteGetTrust(goodlabel, trust, aTestCaseType, aTestIndex); |
1658 fileStore.WriteGetApplications(goodlabel); |
2644 fileStore.WriteGetApplications(goodlabel, aTestCaseType, aTestIndex); |
1659 fileStore.WriteRetrieveCerts(goodlabel); |
2645 fileStore.WriteRetrieveCerts(goodlabel, aTestCaseType, aTestIndex); |
1660 } |
2646 } |
1661 } |
2647 } |
1662 |
2648 |
1663 /** |
2649 /** |
1664 Generate script files for the swicertstore emulator tests |
2650 Generate script files for the swicertstore emulator tests |
1665 */ |
2651 */ |
1666 void GenerateGoodSwiCertTestScripts(const stringstream &aFilename) |
2652 void GenerateGoodSwiCertTestScripts(const stringstream &aFilename, const stringstream &aTestCaseType, int &aTestIndex) |
1667 { |
2653 { |
1668 SWIStoreScriptGeneration swiStore(aFilename); |
2654 SWIStoreScriptGeneration swiStore(aFilename); |
1669 |
2655 |
1670 const char *ownertype = goodOwnerType[0]; //CA ownerType |
2656 const char *ownertype = goodOwnerType[0]; //CA ownerType |
1671 |
2657 |
1672 //initilaise the store and get list all the certificate ones |
2658 //initilaise the store and get list all the certificate ones |
1673 swiStore.WriteInitialiseCert(); |
2659 swiStore.WriteInitialiseCert(aTestCaseType, aTestIndex); |
1674 swiStore.WriteListcert(ownertype); |
2660 swiStore.WriteListcert(ownertype, aTestCaseType, aTestIndex); |
1675 |
2661 |
1676 for(int i = 0; i<6;i++) |
2662 for(int i = 0; i<6;i++) |
1677 { |
2663 { |
1678 const char *trust = goodTrust[0]; // true |
2664 const char *trust = goodTrust[0]; // true |
1679 const char *goodlabel = goodSwiCert_array[i]; // list of label - root5ca , symbiandtestcsa, symbiantestrcsa |
2665 const char *goodlabel = goodSwiCert_array[i]; // list of label - root5ca , symbiandtestcsa, symbiantestrcsa |
1680 const char *mandatoryVal = mandatory[0]; |
2666 const char *mandatoryVal = mandatory[0]; |
1681 const char *systemupgrade = systemUpgrade[0]; |
2667 const char *systemupgrade = systemUpgrade[0]; |
1682 |
2668 |
1683 swiStore.WriteGetSystemUpgrade(goodlabel,systemupgrade); |
2669 swiStore.WriteGetSystemUpgrade(goodlabel, systemupgrade, aTestCaseType, aTestIndex); |
1684 swiStore.WriteRetrieveCerts(goodlabel); |
2670 swiStore.WriteRetrieveCerts(goodlabel, aTestCaseType, aTestIndex); |
1685 swiStore.WriteGetApplications(goodlabel); |
2671 swiStore.WriteGetApplications(goodlabel, aTestCaseType, aTestIndex); |
1686 swiStore.WriteGetTrust(goodlabel,trust); |
2672 swiStore.WriteGetTrust(goodlabel, trust, aTestCaseType, aTestIndex); |
1687 swiStore.WriteGetCapabilities(goodlabel); |
2673 swiStore.WriteGetCapabilities(goodlabel, aTestCaseType, aTestIndex); |
1688 swiStore.WriteGetMandatoryFlag(goodlabel, mandatoryVal); |
2674 swiStore.WriteGetMandatoryFlag(goodlabel, mandatoryVal, aTestCaseType, aTestIndex); |
1689 } |
2675 } |
1690 } |
2676 } |
1691 |
2677 |
1692 //End of file |
2678 //End of file |
2679 |
|
2680 |