sl@0: /* sl@0: * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #include sl@0: #include sl@0: #include "t_testhandler.h" sl@0: #include "t_certstoreactionsclient.h" sl@0: #include "t_certstoreactionslistcertificates.h" sl@0: #include "t_unifiedcertstorewritablecertstorecount.h" sl@0: #include "t_unifiedcertstorereadonlycertstorecount.h" sl@0: #include "t_unifiedcertstorecertstorecount.h" sl@0: #include "t_certstoredefs.h" sl@0: #include "t_certstoreactions.h" sl@0: #include "t_certstoreactionsfilecertstore.h" sl@0: #include "t_unifiedcertstoreadd.h" sl@0: #include "t_unifiedcertstoreremove.h" sl@0: #include "T_unifiedcertstoreapplications.h" sl@0: #include "t_unifiedcertstoreactiongetcert.h" sl@0: #include "t_ccttokentypeinfoattributes.h" sl@0: #include "t_certstoreactionshandle.h" sl@0: #include "t_retrieve.h" sl@0: #include "t_concurrentcertstore.h" sl@0: #include "t_certstoretests.h" sl@0: #include "t_testcertfordeletable.h" sl@0: #include "t_filetokens.h" sl@0: #include sl@0: sl@0: #include "tscriptandhardcoded.h" sl@0: #include "t_swicertstoreactions.h" sl@0: sl@0: START_SCRIPT_LIST sl@0: SCRIPT_ITEM(CCreateFileCertStore, KCreateFileCertStore), sl@0: SCRIPT_ITEM(CImportKey, KImportKey), sl@0: SCRIPT_ITEM(CAddCertificate, KAddCert), sl@0: SCRIPT_ITEM(CInitialiseCertStore, KInitStore), sl@0: SCRIPT_ITEM(COnlyCreateCertStore, KOnlyCreateStore), sl@0: SCRIPT_ITEM(CDeleteCertStore, KDeleteStore), sl@0: SCRIPT_ITEM(CDeleteCertificate, KDeleteCert), sl@0: SCRIPT_ITEM(CDeleteRetrieveCACertificate, KDeleteRetrieveCACert), sl@0: SCRIPT_ITEM(CDeleteRetrieveUserCertificate, KDeleteRetrieveUserCert), sl@0: SCRIPT_ITEM(CListCertificates, KListCert), sl@0: SCRIPT_ITEM(CRetrieveCertificate, KRetrieveCert), sl@0: SCRIPT_ITEM(CUnifiedCertStoreApplications, KGetApplications), sl@0: SCRIPT_ITEM(CSetApplications, KSetApplications), sl@0: SCRIPT_ITEM(CSetTrusters, KSetTruster), sl@0: SCRIPT_ITEM(CGetTrusters, KGetTrusters), sl@0: SCRIPT_ITEM(CInitCertificateAppInfoManager, KInitAppManager), sl@0: SCRIPT_ITEM(CDeleteCertificateAppInfoManager, KDeleteAppManager), sl@0: SCRIPT_ITEM(CAddClient, KAddClient), sl@0: SCRIPT_ITEM(CGetClients, KGetClients), sl@0: SCRIPT_ITEM(CRemoveClient, KRemoveClient), sl@0: SCRIPT_ITEM(CUnifiedCertStoreWritableCertStoreCount, KCUnifiedCertStoreWritableCertStoreCount), sl@0: SCRIPT_ITEM(CUnifiedCertStoreReadOnlyCertStoreCount, KCUnifiedCertStoreReadOnlyCertStoreCount), sl@0: SCRIPT_ITEM(CUnifiedCertStoreCertStoreCount, KCUnifiedCertStoreCertStoreCount), sl@0: SCRIPT_ITEM(CUnifiedCertStoreGetCert, KCUnifiedCertStoreGetCert), sl@0: SCRIPT_ITEM(CInitSWICertStoreAction, KInitSWICertStore), sl@0: SCRIPT_ITEM(CGetCapabilitiesAction, KGetCapabilities), sl@0: SCRIPT_ITEM(CGetMandatoryAction, KGetMandatory), sl@0: SCRIPT_ITEM(CGetSystemUpgradeAction, KGetSystemUpgrade), sl@0: SCRIPT_ITEM(CGetDeletionAction, KGetDeletable), sl@0: SCRIPT_ITEM(CCTTokenTypeInfoAttributes, KCCTTokenTypeInfoAttributes), sl@0: SCRIPT_ITEM(CCertStoreHandle, KCCTCertInfoHandle), sl@0: SCRIPT_ITEM(CTestConcurrentCertStore, KTestConcurrentCertStore), sl@0: SCRIPT_ITEM(CTestCertForDeletable, KCTestCertForDeletable), sl@0: SCRIPT_ITEM(CServerOOMTestStart, KServerOOMTestStart), sl@0: SCRIPT_ITEM(CServerOOMTestStop, KServerOOMTestStop), sl@0: SCRIPT_ITEM(CMultipleReadersAction, KMultipleReaders), sl@0: SCRIPT_ITEM(CCheckServerHeapError, KCheckServerHeapError) sl@0: END_SCRIPT_LIST sl@0: sl@0: void DeleteKeyStoreL() sl@0: { sl@0: RFs fs; sl@0: User::LeaveIfError(fs.Connect()); sl@0: CleanupClosePushL(fs); sl@0: sl@0: TDriveUnit sysDrive (RFs::GetSystemDrive()); sl@0: TBuf<64> datFile (sysDrive.Name()); sl@0: datFile.Append(_L("\\system\\data\\keys.dat")); sl@0: User::LeaveIfError(fs.Delete(datFile)); sl@0: CleanupStack::PopAndDestroy(&fs); sl@0: } sl@0: sl@0: void DoTests() sl@0: { sl@0: // Need to delete the keystore first sl@0: TRAP_IGNORE(DeleteKeyStoreL()); sl@0: sl@0: TDriveUnit sysDrive (RFs::GetSystemDrive()); sl@0: TBuf<64> scriptFile (sysDrive.Name()); sl@0: scriptFile.Append(_L("\\tcertstore\\scripts\\unifiedcertstore1-conf1.txt")); sl@0: sl@0: TBuf<24> logFile (sysDrive.Name()); sl@0: logFile.Append(_L("\\tcertstore.log")); sl@0: CScriptSetup::CreateAndRunTestsL(theTestTypes, scriptFile, logFile); sl@0: } sl@0: sl@0: void DoTests(const TDesC& aScriptFile, const TDesC& aLogFile, TBool isConcurrent) sl@0: { sl@0: TRAP_IGNORE(DeleteKeyStoreL()); sl@0: CNullConsole console; sl@0: CConsoleBase* consolePtr = (isConcurrent) ? &console : NULL; sl@0: CScriptSetup::CreateAndRunTestsL(theTestTypes, aScriptFile, aLogFile, EFalse, consolePtr); sl@0: }