# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1283455307 -10800 # Node ID 7355aab40bca96b9155c589f30a64a9e7f3924eb # Parent a675745f8b2e9c29361c7f0d98106fc121381b29 Revision: 201035 Kit: 201035 diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/bwins/upspoliciesu.def --- a/authorisation/userpromptservice/bwins/upspoliciesu.def Wed Aug 18 11:33:05 2010 +0300 +++ b/authorisation/userpromptservice/bwins/upspoliciesu.def Thu Sep 02 22:21:47 2010 +0300 @@ -6,7 +6,7 @@ ??0TSidClasses@UserPromptService@@QAE@G@Z @ 5 NONAME ; UserPromptService::TSidClasses::TSidClasses(unsigned short) ??1CDialogCreator@UserPromptService@@UAE@XZ @ 6 NONAME ; UserPromptService::CDialogCreator::~CDialogCreator(void) ??1CPolicyEvaluator@UserPromptService@@UAE@XZ @ 7 NONAME ; UserPromptService::CPolicyEvaluator::~CPolicyEvaluator(void) - ??1CPromptRequest@UserPromptService@@UAE@XZ @ 8 NONAME ; UserPromptService::CPromptRequest::~CPromptRequest(void) + ??1CPromptRequest@UserPromptService@@UAE@XZ @ 8 NONAME ABSENT ; UserPromptService::CPromptRequest::~CPromptRequest(void) ??8TId@CPolicyList@UserPromptService@@QBEHABV012@@Z @ 9 NONAME ; int UserPromptService::CPolicyList::TId::operator==(class UserPromptService::CPolicyList::TId const &) const ?PromptRequired@CPolicy@UserPromptService@@QBEHXZ @ 10 NONAME ; int UserPromptService::CPolicy::PromptRequired(void) const ?AppendNameToPath@TId@CPolicyList@UserPromptService@@QBEXAAVTDes16@@@Z @ 11 NONAME ; void UserPromptService::CPolicyList::TId::AppendNameToPath(class TDes16 &) const @@ -59,7 +59,7 @@ ?OpaqueData@CPromptRequest@UserPromptService@@QBEABVTDesC8@@XZ @ 58 NONAME ; class TDesC8 const & UserPromptService::CPromptRequest::OpaqueData(void) const ?Options@CPolicy@UserPromptService@@QBE?AW4TOptions@12@XZ @ 59 NONAME ; enum UserPromptService::CPolicy::TOptions UserPromptService::CPolicy::Options(void) const ?PolicyEvaluator@CPolicy@UserPromptService@@QBEABVTUid@@XZ @ 60 NONAME ; class TUid const & UserPromptService::CPolicy::PolicyEvaluator(void) const - ?ReadPolicyL@CPolicyReader@UserPromptService@@AAEPAVCPolicy@2@XZ @ 61 NONAME ; class UserPromptService::CPolicy * UserPromptService::CPolicyReader::ReadPolicyL(void) + ?ReadPolicyL@CPolicyReader@UserPromptService@@AAEPAVCPolicy@2@XZ @ 61 NONAME ABSENT ; class UserPromptService::CPolicy * UserPromptService::CPolicyReader::ReadPolicyL(void) ?ReleasePlugin@CPluginManager@UserPromptService@@AAEXXZ @ 62 NONAME ; void UserPromptService::CPluginManager::ReleasePlugin(void) ?SecurityResult@CPromptRequest@UserPromptService@@QBEHXZ @ 63 NONAME ; int UserPromptService::CPromptRequest::SecurityResult(void) const ?ServerSid@CPromptRequest@UserPromptService@@QBEABVTSecureId@@XZ @ 64 NONAME ; class TSecureId const & UserPromptService::CPromptRequest::ServerSid(void) const diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/eabi/upspoliciesu.def --- a/authorisation/userpromptservice/eabi/upspoliciesu.def Wed Aug 18 11:33:05 2010 +0300 +++ b/authorisation/userpromptservice/eabi/upspoliciesu.def Thu Sep 02 22:21:47 2010 +0300 @@ -16,7 +16,7 @@ _ZN17UserPromptService13CClientEntity4NewLERK6TDesC8 @ 15 NONAME _ZN17UserPromptService13CClientEntity5NewLCERK6TDesC8 @ 16 NONAME _ZN17UserPromptService13CPolicyReader11NextPolicyLEv @ 17 NONAME - _ZN17UserPromptService13CPolicyReader11ReadPolicyLEv @ 18 NONAME + _ZN17UserPromptService13CPolicyReader11ReadPolicyLEv @ 18 NONAME ABSENT _ZN17UserPromptService13CPolicyReader14DefaultPolicyLEv @ 19 NONAME _ZN17UserPromptService13CPolicyReader4NewLER3RFsRK7TDesC16 @ 20 NONAME _ZN17UserPromptService13CPolicyReader5NewLCER3RFsRK7TDesC16 @ 21 NONAME @@ -34,9 +34,9 @@ _ZN17UserPromptService14CPluginManager6UnloadEv @ 33 NONAME _ZN17UserPromptService14CPromptRequest4NewLERK9TSecureIdRK9TVendorIdRK9TThreadIdR10TProcessIdS3_RK4TUidR6RBuf16R5RBuf8i @ 34 NONAME _ZN17UserPromptService14CPromptRequest5NewLCERK9TSecureIdRK9TVendorIdRK9TThreadIdR10TProcessIdS3_RK4TUidR6RBuf16R5RBuf8i @ 35 NONAME - _ZN17UserPromptService14CPromptRequestD0Ev @ 36 NONAME - _ZN17UserPromptService14CPromptRequestD1Ev @ 37 NONAME - _ZN17UserPromptService14CPromptRequestD2Ev @ 38 NONAME + _ZN17UserPromptService14CPromptRequestD0Ev @ 36 NONAME ABSENT + _ZN17UserPromptService14CPromptRequestD1Ev @ 37 NONAME ABSENT + _ZN17UserPromptService14CPromptRequestD2Ev @ 38 NONAME ABSENT _ZN17UserPromptService16CPolicyEvaluator10Extension_EjRPvS1_ @ 39 NONAME _ZN17UserPromptService16CPolicyEvaluator12ForcePromptLERKNS_15CDecisionRecordERj @ 40 NONAME _ZN17UserPromptService16CPolicyEvaluator12GetExtensionEjRPvS1_ @ 41 NONAME diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/inc/tups_integ.iby --- a/authorisation/userpromptservice/inc/tups_integ.iby Wed Aug 18 11:33:05 2010 +0300 +++ b/authorisation/userpromptservice/inc/tups_integ.iby Thu Sep 02 22:21:47 2010 +0300 @@ -133,20 +133,5 @@ data = ZDRIVE\tups\integ\corrupted_db_integ\ups_corrupted2.db \tups\integ\corrupted_db_integ\ups_corrupted2.db -REM Integration test sis files and related. -data = ZDRIVE\tups\integ\packages\uninstall.xml \tups\integ\packages\uninstall.xml -data = ZDRIVE\tups\integ\packages\simple.xml \tups\integ\packages\simple.xml -data = ZDRIVE\tups\integ\packages\tupsinteg_post1.sis \tups\integ\packages\tupsinteg_post1.sis -data = ZDRIVE\tups\integ\packages\tupsinteg_policies1.sis \tups\integ\packages\tupsinteg_policies1.sis -data = ZDRIVE\tups\integ\packages\tupsinteg_policies2.sis \tups\integ\packages\tupsinteg_policies2.sis -data = ZDRIVE\tups\integ\packages\tupsinteg_evaluator1.sis \tups\integ\packages\tupsinteg_evaluator1.sis -data = ZDRIVE\tups\integ\packages\tupsinteg_dialog1.sis \tups\integ\packages\tupsinteg_dialog1.sis -data = ZDRIVE\tups\integ\packages\tupsinteg_eclipse1.sis \tups\integ\packages\tupsinteg_eclipse1.sis -data = ZDRIVE\tups\integ\packages\tupsinteg_ca_not_instore.sis \tups\integ\packages\tupsinteg_ca_not_instore.sis -data = ZDRIVE\tups\integ\packages\tupsinteg_policies1_negative.sis \tups\integ\packages\tupsinteg_policies1_negative.sis - - -REM Integration test, file to simulate tamper attempt for backup and restore. -data = ZDRIVE\tups\integ\tampered_backup\backup10285777.1 \tups\integ\tampered_backup\backup10285777.1 #endif diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/policies/source/policyreader.cpp --- a/authorisation/userpromptservice/policies/source/policyreader.cpp Wed Aug 18 11:33:05 2010 +0300 +++ b/authorisation/userpromptservice/policies/source/policyreader.cpp Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -192,7 +192,7 @@ return p; } -EXPORT_C CPolicy* CPolicyReader::ReadPolicyL() +CPolicy* CPolicyReader::ReadPolicyL() /** Reads the next policy from the resource file. diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/policies/source/promptrequest.cpp --- a/authorisation/userpromptservice/policies/source/promptrequest.cpp Wed Aug 18 11:33:05 2010 +0300 +++ b/authorisation/userpromptservice/policies/source/promptrequest.cpp Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -204,7 +204,7 @@ return iSecurityResult; } -EXPORT_C CPromptRequest::~CPromptRequest() +CPromptRequest::~CPromptRequest() /** Destructor */ diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/group/bld.inf --- a/authorisation/userpromptservice/test/group/bld.inf Wed Aug 18 11:33:05 2010 +0300 +++ b/authorisation/userpromptservice/test/group/bld.inf Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -27,9 +27,6 @@ PRJ_TESTEXPORTS -#ifdef SYMBIAN_OLD_EXPORT_LOCATION -../include/tups_clientapi_sysserver.h /epoc32/include/test/tups_clientapi_sysserver.h -#endif //// test scripts //// ../tups/scripts/tups_properties.ini z:/tups/integ/scripts/tups_properties.ini @@ -46,13 +43,6 @@ ../tups/corrupted_db_integ/ups_corrupted1.db z:/tups/integ/corrupted_db_integ/ups_corrupted1.db ../tups/corrupted_db_integ/ups_corrupted2.db z:/tups/integ/corrupted_db_integ/ups_corrupted2.db -//// XML files to control sis files installations. -../tups/packages/uninstall.xml z:/tups/integ/packages/uninstall.xml -../tups/packages/simple.xml z:/tups/integ/packages/simple.xml - - -//// File to simulate tamper attempt for backup and restore. -../tups/tampered_backup/backup10285777.1 z:/tups/integ/tampered_backup/backup10285777.1 PRJ_TESTMMPFILES @@ -60,8 +50,6 @@ #ifndef TOOLS2 #ifndef GCCXML -tups_install.mmp -tups_backuprestore.mmp tupsinteg.mmp tupsinteg_unprotected.mmp tups_clientapi_sysserver.mmp @@ -85,9 +73,6 @@ tupsinteg_post1.mmp // target need to be deleted after sis creation -//// create SIS files for postmanufact -gnumakefile ../tups/packages/integ_buildsis.fil - gnumakefile ../tups/packages/testromstub.mak #endif diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/group/tups_dialogcreator_never.mmp --- a/authorisation/userpromptservice/test/group/tups_dialogcreator_never.mmp Wed Aug 18 11:33:05 2010 +0300 +++ b/authorisation/userpromptservice/test/group/tups_dialogcreator_never.mmp Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -36,8 +36,6 @@ macro DIALOG_NEVER OS_LAYER_SYSTEMINCLUDE_SYMBIAN -MW_LAYER_SYSTEMINCLUDE_SYMBIAN - sourcepath ../tups_dialogcreator/source source tups_dialogcreator_noprops.cpp @@ -46,14 +44,11 @@ target tups_dialogcreator_never.rsc end -library apgrfx.lib -library apparc.lib library ecom.lib library euser.lib library ipcstream.lib library estor.lib library hash.lib library upspolicies.lib -library sisregistryclient.lib library upsnotifierutil.lib SMPSAFE diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/group/tupsinteg.mmp --- a/authorisation/userpromptservice/test/group/tupsinteg.mmp Wed Aug 18 11:33:05 2010 +0300 +++ b/authorisation/userpromptservice/test/group/tupsinteg.mmp Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -44,7 +44,6 @@ USERINCLUDE ../include OS_LAYER_SYSTEMINCLUDE_SYMBIAN -MW_LAYER_SYSTEMINCLUDE_SYMBIAN //Please add your system include under here. diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/group/tupsinteg_post1.mmp --- a/authorisation/userpromptservice/test/group/tupsinteg_post1.mmp Wed Aug 18 11:33:05 2010 +0300 +++ b/authorisation/userpromptservice/test/group/tupsinteg_post1.mmp Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -46,7 +46,6 @@ USERINCLUDE ../include OS_LAYER_SYSTEMINCLUDE_SYMBIAN -MW_LAYER_SYSTEMINCLUDE_SYMBIAN //Please add your system include under here. diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/group/tupsinteg_unprotected.mmp --- a/authorisation/userpromptservice/test/group/tupsinteg_unprotected.mmp Wed Aug 18 11:33:05 2010 +0300 +++ b/authorisation/userpromptservice/test/group/tupsinteg_unprotected.mmp Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -39,7 +39,6 @@ USERINCLUDE ../include OS_LAYER_SYSTEMINCLUDE_SYMBIAN -MW_LAYER_SYSTEMINCLUDE_SYMBIAN //Please add your system include under here. diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/packages/copy.bat --- a/authorisation/userpromptservice/test/tups/packages/copy.bat Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of the License "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem - - -echo Copy pkg files to common location and change to that location -call mkdir %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\ -copy /y tupsinteg_post1.pkg %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\tupsinteg_post1.pkg -copy /y tupsinteg_policies1.pkg %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\tupsinteg_policies1.pkg -copy /y tupsinteg_policies2.pkg %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\tupsinteg_policies2.pkg -copy /y tupsinteg_evaluator1.pkg %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\tupsinteg_evaluator1.pkg -copy /y tupsinteg_eclipse1.pkg %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\tupsinteg_eclipse1.pkg -copy /y tupsinteg_dialog1.pkg %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\tupsinteg_dialog1.pkg -copy /y tupsinteg_ca_not_instore.pkg %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\tupsinteg_ca_not_instore.pkg -copy /y testupsromstub.pkg %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\testupsromstub.pkg -copy /y dummy.txt %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\dummy.txt - -copy /y %EPOCROOT%epoc32\release\%1\%2\tupsinteg_post1.exe %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\tupsinteg_post1.exe -copy /y %EPOCROOT%epoc32\release\%1\%2\tups_policyevaluator05.dll %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\tups_policyevaluator05.dll -copy /y %EPOCROOT%epoc32\data\z\resource\plugins\tups_policyevaluator05.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\tups_policyevaluator05.rsc -copy /y %EPOCROOT%epoc32\release\%1\%2\tups_dialogcreator07.dll %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\tups_dialogcreator07.dll -copy /y %EPOCROOT%epoc32\data\z\resource\plugins\tups_dialogcreator07.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\tups_dialogcreator07.rsc - -if "%1"=="WINSCW" goto WINSCW; -if "%1"=="ARMV5" goto ARMV5; - - -:WINSCW -copy /y %EPOCROOT%epoc32\release\%1\%2\Z\private\10283558\policies\t_ups_101f7f1f_ff000001_version1.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\t_ups_101f7f1f_ff000001_version1.rsc -copy /y %EPOCROOT%epoc32\release\%1\%2\Z\private\10283558\policies\t_ups_101f7f1f_ff000001_version2.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\t_ups_101f7f1f_ff000001_version2.rsc -copy /y %EPOCROOT%epoc32\release\%1\%2\Z\private\10283558\policies\t_ups_101f7f1f_0000aaa2_version1.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\t_ups_101f7f1f_0000aaa2_version1.rsc -copy /y %EPOCROOT%epoc32\release\%1\%2\Z\private\10283558\policies\eclipse_ups_101f7f1f_0000aaa3.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\eclipse_ups_101f7f1f_0000aaa3.rsc -copy /y %EPOCROOT%epoc32\release\%1\%2\Z\private\10283558\policies\t_ups_101f7f1f_0000aaa4.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\t_ups_101f7f1f_0000aaa4.rsc -copy /y %EPOCROOT%epoc32\release\%1\%2\Z\private\10283558\policies\t_ups_101f7f1f_ff000001_version1.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\t_ups_101f7f1f_ff000001_version1.rsc -copy /y %EPOCROOT%epoc32\release\%1\%2\Z\private\10283558\policies\t_ups_101f7f1f_ff000001_version2.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\t_ups_101f7f1f_ff000001_version2.rsc -goto EXIT; - -:ARMV5 -copy /y %EPOCROOT%epoc32\data\z\private\10283558\policies\t_ups_101f7f1f_ff000001_version1.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\t_ups_101f7f1f_ff000001_version1.rsc -copy /y %EPOCROOT%epoc32\data\z\private\10283558\policies\t_ups_101f7f1f_ff000001_version2.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\t_ups_101f7f1f_ff000001_version2.rsc -copy /y %EPOCROOT%epoc32\data\z\private\10283558\policies\t_ups_101f7f1f_0000aaa2_version1.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\t_ups_101f7f1f_0000aaa2_version1.rsc -copy /y %EPOCROOT%epoc32\data\z\private\10283558\policies\eclipse_ups_101f7f1f_0000aaa3.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\eclipse_ups_101f7f1f_0000aaa3.rsc -copy /y %EPOCROOT%epoc32\data\z\private\10283558\policies\t_ups_101f7f1f_0000aaa4.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\t_ups_101f7f1f_0000aaa4.rsc -copy /y %EPOCROOT%epoc32\data\z\private\10283558\policies\t_ups_101f7f1f_ff000001_version1.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\t_ups_101f7f1f_ff000001_version1.rsc -copy /y %EPOCROOT%epoc32\data\z\private\10283558\policies\t_ups_101f7f1f_ff000001_version2.rsc %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\t_ups_101f7f1f_ff000001_version2.rsc -goto EXIT; - -:EXIT diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/packages/create.bat --- a/authorisation/userpromptservice/test/tups/packages/create.bat Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of the License "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem - - - -echo makesis -cd %EPOCROOT%epoc32\WINSCW\c\tups\data\%2\ -makesis %3.pkg %4_unsigned.sis - -echo signsis -if "%5"=="ROOT5CA" signsis %4_unsigned.sis %4.sis "\common\generic\security\os\security\cryptomgmtlibs\securitytestfw\testcertificates\ups\test\root5ca\ca.pem" "\common\generic\security\os\security\cryptomgmtlibs\securitytestfw\testcertificates\ups\test\root5ca\ca.key.pem" -if "%5"=="ALL" signsis %4_unsigned.sis %4.sis "\common\generic\security\os\security\cryptomgmtlibs\securitytestfw\testcertificates\ups\test\symbiantestallcapabilitiesca\symbiantestallcapabilitiesca.pem" "\common\generic\security\os\security\cryptomgmtlibs\securitytestfw\testcertificates\ups\test\symbiantestallcapabilitiesca\cakey.pem" -if "%5"=="TESTROOT" signsis %4_unsigned.sis %4.sis "\common\generic\security\os\security\cryptomgmtlibs\securitytestfw\testcertificates\ups\test\symbiantestrootcadsa\ca.pem" "\common\generic\security\os\security\cryptomgmtlibs\securitytestfw\testcertificates\ups\test\symbiantestrootcadsa\ca.key.pem" -if "%5"=="SELF" signsis %4_unsigned.sis %4.sis "\common\generic\security\os\security\cryptomgmtlibs\securitytestfw\testcertificates\ups\test\certificatesnotinstore\selfsigned_cert.pem" "\common\generic\security\os\security\cryptomgmtlibs\securitytestfw\testcertificates\ups\test\certificatesnotinstore\selfsigned_key.pem" - -if "%1"=="WINSCW" goto COPYWINSCW; -if "%1"=="ARMV5" goto COPYARMV5; - -:COPYWINSCW - -echo Copy winscw sis to emulator drive or armv5 to data z tree -copy /y %4.sis %EPOCROOT%epoc32\release\%1\%2\z\tups\integ\packages\%4.sis -goto clean; - - -:COPYARMV5 -echo Copy winscw sis to emulator drive or armv5 to data z tree -copy /y %4.sis %EPOCROOT%epoc32\data\z\tups\integ\packages\%4.sis - - -goto clean; - -:clean -del /q %4_unsigned.sis -del /q %4.sis - -goto exit; - -:exit - diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/packages/dummy.txt --- a/authorisation/userpromptservice/test/tups/packages/dummy.txt Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -I'm a dummy file used to signal SIS file installation is finished. \ No newline at end of file diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/packages/integ_buildsis.fil --- a/authorisation/userpromptservice/test/tups/packages/integ_buildsis.fil Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -ifeq "$(PLATFORM)" "WINSCW" -ACTION=doaction -endif - -ifeq "$(PLATFORM)" "ARMV5" -ACTION=doaction -endif - - -# -# The targets invoked by abld... -# - -MAKMAKE : DO_NOTHING -FREEZE : DO_NOTHING -LIB : DO_NOTHING -RESOURCE : DO_NOTHING -CLEANLIB : DO_NOTHING -BLD : DO_NOTHING -RELEASABLES : DO_NOTHING - -SAVESPACE : BLD - -FINAL : MAKEDATA - - -DO_NOTHING: - - -ifndef ACTION -# -# Not supported on this target so nothing to do -# -MAKEDATA : - @echo ---------------- - @echo Do nothing ... - @echo ---------------- - -CLEAN: - -RELEASABLES: - -else -# -# WINSCW or ARM -# -MAKEDATA : - @cd - @echo -------------------------------------------------------------- - @echo Copying required input datas - @echo -------------------------------------------------------------- - - call copy.bat $(PLATFORM) $(CFG) - - @echo -------------------------------------------------------------- - @echo Building SIS file to install removable test client - @echo -------------------------------------------------------------- - - call create.bat $(PLATFORM) $(CFG) tupsinteg_post1 tupsinteg_post1 ROOT5CA - - - @echo -------------------------------------------------------------- - @echo Building SIS to install policy files post manufacture. - @echo -------------------------------------------------------------- - - call create.bat $(PLATFORM) $(CFG) tupsinteg_policies1 tupsinteg_policies1 ROOT5CA - - @echo -------------------------------------------------------------- - @echo Building SIS to install policy files post manufacture. - @echo -------------------------------------------------------------- - - call create.bat $(PLATFORM) $(CFG) tupsinteg_policies2 tupsinteg_policies2 ROOT5CA - - @echo -------------------------------------------------------------- - @echo Building SIS file to install a policy evaluator via SWI - @echo -------------------------------------------------------------- - - call create.bat $(PLATFORM) $(CFG) tupsinteg_evaluator1 tupsinteg_evaluator1 ALL - - @echo --------------------------------------------------------------------------- - @echo Building SIS file to install a policy evaluator and dialog creator via SWI - @echo --------------------------------------------------------------------------- - - call create.bat $(PLATFORM) $(CFG) tupsinteg_dialog1 tupsinteg_dialog1 ALL - - @echo -------------------------------------- - @echo Building SIS to eclipse policy files. - @echo -------------------------------------- - - call create.bat $(PLATFORM) $(CFG) tupsinteg_eclipse1 tupsinteg_eclipse1 ROOT5CA - - @echo -------------------------------------------------------------------------- - @echo Building SIS to (attempt to) install policy files (incorrect cert used) - @echo -------------------------------------------------------------------------- - - call create.bat $(PLATFORM) $(CFG) tupsinteg_policies1 tupsinteg_policies1_negative TESTROOT - - @echo ----------------------------------------------------------------------- - @echo Building SIS to install policy files signed with CA cert not in store - @echo ----------------------------------------------------------------------- - - call create.bat $(PLATFORM) $(CFG) tupsinteg_ca_not_instore tupsinteg_ca_not_instore SELF - - @echo - - -CLEAN : - if exist %EPOCROOT%epoc32\release\"$(PLATFORM)"\"$(CFG)"\z\tups\integ\packages\tupsinteg_post1.sis del /q %EPOCROOT%epoc32\release\"$(PLATFORM)"\"$(CFG)"\z\tups\integ\packages\tupsinteg_post1.sis - if exist %EPOCROOT%epoc32\release\"$(PLATFORM)"\"$(CFG)"\z\tups\integ\packages\tupsinteg_policies1.sis del /q %EPOCROOT%epoc32\release\"$(PLATFORM)"\"$(CFG)"\z\tups\integ\packages\tupsinteg_policies1.sis - if exist %EPOCROOT%epoc32\release\"$(PLATFORM)"\"$(CFG)"\z\tups\integ\packages\tupsinteg_policies2.sis del /q %EPOCROOT%epoc32\release\"$(PLATFORM)"\"$(CFG)"\z\tups\integ\packages\tupsinteg_policies2.sis - -endif diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/packages/simple.xml --- a/authorisation/userpromptservice/test/tups/packages/simple.xml Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ - - - diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/packages/tupsinteg_ca_not_instore.pkg --- a/authorisation/userpromptservice/test/tups/packages/tupsinteg_ca_not_instore.pkg Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -; -; Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of the License "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; - -; Tests the installation of UPS policies files - -&EN - -#{"integ UPS policy update Ca cert not stored"}, (0x10285777), 1, 0, 2, TYPE=SP -%{"UPS integration test"} -:"UPS integration test" - -; The VERIFY option is used to flag the files as non-modifiable so that SWI -; checks the hashes during restore. - -;Supports Series 60 v 5.2 -[0x20022E6D], 0, 0, 0, {"Series60ProductID"} - -"t_ups_101f7f1f_ff000001_version2.rsc"-"!:\private\10283558\policies\ups_101f7f1f_ff000001.rsc", VERIFY -"dummy.txt"-"C:\tups\integ\ca_no_instore_was_installed.txt" \ No newline at end of file diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/packages/tupsinteg_dialog1.pkg --- a/authorisation/userpromptservice/test/tups/packages/tupsinteg_dialog1.pkg Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -; -; Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of the License "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; - -; Tests the installation of UPS policies files - -&EN - -#{"integration UPS new dialog creator"}, (0x10285777), 1, 0, 2, TYPE=SP -%{"UPS integration test"} -:"UPS integration test" - -; The VERIFY option is used to flag the files as non-modifiable so that SWI -; checks the hashes during restore. - -;Supports Series 60 v 5.2 -[0x20022E6D], 0, 0, 0, {"Series60ProductID"} - -"t_ups_101f7f1f_0000aaa2_version1.rsc"-"!:\private\10283558\policies\ups_101f7f1f_0000aaa2.rsc", VERIFY -"tups_dialogcreator07.rsc"-"!:\resource\plugins\tups_dialogcreator07.rsc" -"tups_dialogcreator07.dll"-"!:\sys\bin\tups_dialogcreator07.dll" -"dummy.txt"-"C:\tups\integ\dialog1pkg_was_installed.txt" \ No newline at end of file diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/packages/tupsinteg_eclipse1.pkg --- a/authorisation/userpromptservice/test/tups/packages/tupsinteg_eclipse1.pkg Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -; -; Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of the License "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; - -; Tests the installation of UPS policies files - -&EN - -#{"integration UPS test policy eclipsing"}, (0x10285777), 1, 0, 0, TYPE=SP -%{"Symbian Software Ltd"} -:"Symbian Software Ltd" - -; The VERIFY option is used to flag the files as non-modifiable so that SWI -; checks the hashes during restore. - -;Supports Series 60 v 5.2 -[0x20022E6D], 0, 0, 0, {"Series60ProductID"} - -"eclipse_ups_101f7f1f_0000aaa3.rsc"-"!:\private\10283558\policies\ups_101f7f1f_0000aaa3.rsc", VERIFY -"t_ups_101f7f1f_0000aaa4.rsc"-"!:\private\10283558\policies\ups_101f7f1f_0000aaa4.rsc", VERIFY -"dummy.txt"-"C:\tups\integ\eclipse1pkg_was_installed.txt" diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/packages/tupsinteg_evaluator1.pkg --- a/authorisation/userpromptservice/test/tups/packages/tupsinteg_evaluator1.pkg Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -; -; Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of the License "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; - -; Tests the installation of UPS policies files - -&EN - -#{"integration UPS test policy evaluator install"}, (0xE1111E50), 1, 0, 0, TYPE=SA -%{"Symbian Software Ltd"} -:"Symbian Software Ltd" - -;Supports Series 60 v 5.2 -[0x20022E6D], 0, 0, 0, {"Series60ProductID"} - -; installs a new policy evaluator to be used for ups integration tests. -"tups_policyevaluator05.rsc"-"!:\resource\plugins\tups_policyevaluator05.rsc" -"tups_policyevaluator05.dll"-"!:\sys\bin\tups_policyevaluator05.dll" -"dummy.txt"-"C:\tups\integ\evaluator1pkg_was_installed.txt" diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/packages/tupsinteg_policies1.pkg --- a/authorisation/userpromptservice/test/tups/packages/tupsinteg_policies1.pkg Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -; -; Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of the License "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; - -; Tests the installation of UPS policies files - -&EN - -#{"integration UPS test policy update"}, (0x10285777), 1, 0, 0, TYPE=SP -%{"Symbian Software Ltd"} -:"Symbian Software Ltd" - -; The VERIFY option is used to flag the files as non-modifiable so that SWI -; checks the hashes during restore. - -;Supports Series 60 v 5.2 -[0x20022E6D], 0, 0, 0, {"Series60ProductID"} - -"t_ups_101f7f1f_ff000001_version1.rsc"-"!:\private\10283558\policies\ups_101f7f1f_ff000001.rsc", VERIFY diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/packages/tupsinteg_policies2.pkg --- a/authorisation/userpromptservice/test/tups/packages/tupsinteg_policies2.pkg Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -; -; Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of the License "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; - -; Tests the installation of UPS policies files - -&EN - -#{"integration UPS test policy update"}, (0x10285777), 1, 0, 2, TYPE=SP -%{"UPS integration test"} -:"UPS integration test" - -; The VERIFY option is used to flag the files as non-modifiable so that SWI -; checks the hashes during restore. - -;Supports Series 60 v 5.2 -[0x20022E6D], 0, 0, 0, {"Series60ProductID"} - -"t_ups_101f7f1f_ff000001_version2.rsc"-"!:\private\10283558\policies\ups_101f7f1f_ff000001.rsc", VERIFY -"dummy.txt"-"C:\tups\integ\policies2pkg_was_installed.txt" \ No newline at end of file diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/packages/tupsinteg_post1.pkg --- a/authorisation/userpromptservice/test/tups/packages/tupsinteg_post1.pkg Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of the License "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -&EN - -;Header -#{"TUPS: used for Post manufacture tests"}, (0x80003141), 1, 2, 3, TYPE=SA - -%{"Vendor"} -:"ups integration test" - -;Supports Series 60 v 5.2 -[0x20022E6D], 0, 0, 0, {"Series60ProductID"} - -; Do not be scare about this strange manouvre, this runs in conjuction with a .fil file. -"tupsinteg_post1.exe"-"!:\sys\bin\tupsinteg_post1.exe" - - diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/packages/uninstall.xml --- a/authorisation/userpromptservice/test/tups/packages/uninstall.xml Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ - - \ No newline at end of file diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/scripts/tups_integ.script --- a/authorisation/userpromptservice/test/tups/scripts/tups_integ.script Wed Aug 18 11:33:05 2010 +0300 +++ b/authorisation/userpromptservice/test/tups/scripts/tups_integ.script Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ // -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of the License "Eclipse Public License v1.0" @@ -1168,323 +1168,6 @@ END_TESTCASE SEC-UPS-D004 -//! @SYMTestCaseID SEC-INTEG-UPS-D006 -//! @SYMTestCaseDesc Removal of decision from DB by uninstalling client. -//! (client_removal) -//! -//! @SYMPREQ PREQ1262 -//! @SYMREQ REQ7387 -//! @SYMTestPriority Critical -//! @SYMTestStatus Implemented -//! @SYMTestActions Preconditions: -//! • For each of the services There is an appropriate policy, policy evaluator and dialog -//! creator that matches the UID of the service offered by the “system server”. -//! • The test clients used for this test case were installed with a SIS file that did not -//! install the policy or policy evaluator mapped to these test clients. -//! • There is more than one decision stored for test applications. -//! -//! Test Actions: -//! • Populate decision DB for 3 test clients (A, B, C) with “Always” decisions for 3 Clients. -//! • Uninstall test client B. -//! • Launch test clients (A & C), these two Clients should have normal access to test service -//! without need for security dialog prompt. -//! -//! @SYMTestExpectedResults • Decision for test client B was removed from decision DB. Decisions for test clients -//! A & C are still present in DB with value “always” -//! • Test client A & C are granted access to test service. -//! -//! @SYMTestType CIT - -START_TESTCASE SEC-INTEG-UPS-D006 - -RUN_TEST_STEP 100 TUPSInteg_1 UtilsCloseUps -RUN_UTILS DeleteFile c:\private\10283558\database\ups.db - -// populate decision database with some inital values. -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -// Installs new client via swi (tupsinteg_post1) -RUN_TEST_STEP !Heap=0x150000 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini install_post1 -LOAD_SUITE tupsinteg_post1 - -// creates decision for new installed client. -// This odd jump to another script is indispensable in this situation. -RUN_SCRIPT z:\tups\integ\scripts\tups_integ_post1.script - -CONCURRENT -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -// Unsinstall new client via swi (tupsinteg_post1) -RUN_TEST_STEP 100 tups_install UninstallStep z:\tups\integ\scripts\tups_integ.ini uninstall_post1 -CONSECUTIVE - -// Need to reinstall client to be able to check decisions -RUN_TEST_STEP !Heap=0x150000 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini install_post1 - -// creates decision for new installed client. -// This odd jump to another script is indispensable in this situation. -RUN_SCRIPT z:\tups\integ\scripts\tups_integ_post1.script - -// decisions for other clients are expected to be unchanged. -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -// Last Unsinstall of new client via swi (tupsinteg_post1) (clean up) -RUN_TEST_STEP 100 tups_install UninstallStep z:\tups\integ\scripts\tups_integ.ini uninstall_post1 - -END_TESTCASE SEC-INTEG-UPS-D006 - - -//! @SYMTestCaseID SEC-INTEG-UPS-D007 -//! @SYMTestCaseDesc Removal of decision from DB by upgrading client. -//! (client_update) -//! -//! @SYMPREQ PREQ1262 -//! @SYMREQ REQ7387 REQ7470 -//! @SYMTestPriority Critical -//! @SYMTestStatus Implemented -//! @SYMTestActions Preconditions: -//! • For each of the services There is an appropriate policy, policy evaluator -//! and dialog creator that matches the UID of the service offered by the “system server”. -//! • The test clients used for this test case were installed with a SIS file that did not -//! install the policy or policy evaluator mapped to these test clients. -//! • More than 1 decision is associated to test client. -//! Test Actions: -//! • Populate decision DB for 3 test clients (A, B, C) with “Always” decisions for 3 Clients. -//! • Upgrade test client B by using SIS file. This SIS file should replace EXE file associated -//! to test client B. -//! • Launch test clients (A, B, C), A & C should have normal access to test service without -//! need for security dialog prompt. UPS should display security dialog for Client B, select “Never”. -//! -//! @SYMTestExpectedResults • Decision for test client B was changed in the decision DB from “Always” to “Never”. -//! Decisions for test clients A & C are still present in DB with value “always” -//! • Test client A & C are granted access to test service. -//! -//! @SYMTestType CIT - -START_TESTCASE SEC-INTEG-UPS-D007 - -RUN_TEST_STEP 100 TUPSInteg_1 UtilsCloseUps -RUN_UTILS DeleteFile c:\private\10283558\database\ups.db - -// populate decision database with some inital values. -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -// Installs new client via swi (tupsinteg_post1) -RUN_TEST_STEP !Heap=0x150000 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini install_post1 - -// creates decision for new installed client. -// This odd jump to another script is indispensable in this situation. -RUN_SCRIPT z:\tups\integ\scripts\tups_integ_post1.script - -CONCURRENT -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -// Reinstall client via swi, this counts as an upgrate (tupsinteg_post1) -RUN_TEST_STEP !Heap=0x150000 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini install_post1 -CONSECUTIVE - -// creates decision for new installed client. -// This odd jump to another script is indispensable in this situation. -RUN_SCRIPT z:\tups\integ\scripts\tups_integ_post1_check.script - -// decisions for other clients are expected to be unchanged. -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -// Last Unsinstall of new client via swi (tupsinteg_post1) (clean up) -RUN_TEST_STEP 100 tups_install UninstallStep z:\tups\integ\scripts\tups_integ.ini uninstall_post1 - -END_TESTCASE SEC-INTEG-UPS-D007 - -//! @SYMTestCaseID SEC-INTEG-UPS-D009 -//! @SYMTestCaseDesc Removal of decision from DB by uninstalling policy file -//! (policy_removal) -//! -//! @SYMPREQ PREQ1262 -//! @SYMREQ REQ7397 REQ7399 REQ7400 -//! @SYMTestPriority Critical -//! @SYMTestStatus Implemented -//! @SYMTestActions -//! Preconditions: -//! • For each of the services there is an appropriate policy, policy evaluator and dialog creator -//! that matches the UID of the service offered by the “system server”. -//! • The SIS file used to install test policy did NOT install any executable client that could be -//! mapped to this policy. -//! Test Actions: -//! • Populate decision DB for 3 test clients (A, B, C) with “Always” decisions for 3 Clients. -//! • Uninstall policy mapped to Client B. -//! • Launch test clients (A, B, C). Clients A & C should have normal access test service. -//! • For Client B, test system server should receive a KErrUpsMissingPolicyFile form UPS. -//! • Check that Client A & C can access test service. -//! -//! @SYMTestExpectedResults • Decision DB contains only “Always” decision stored for Clients A & C, Client B -//! should not have any decision associated to it. -//! • Test client A & C are granted access to test service. -//! • Test client B is granted not granted service. -//! • KErrUpsMissingPolicyFile issued to system server when request security dialog for client B. -//! -//! @SYMTestType CIT -START_TESTCASE SEC-INTEG-UPS-D009 - -RUN_TEST_STEP 100 TUPSInteg_1 UtilsCloseUps -RUN_UTILS DeleteFile c:\private\10283558\database\ups.db - -// populate decision database with some inital values. -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -// installs policy file version 1 -RUN_TEST_STEP 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini install_policies1v1 - - -// populates decisions related to policy just installed -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini policies1v1_populate -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini policies1v1_check - -RUN_TEST_STEP 100 TUPSInteg_1 UPSDbManagementStep z:\tups\integ\scripts\tups_integ.ini count_29 - -// uninstall policy file. -RUN_TEST_STEP 100 tups_install UninstallAugStep z:\tups\integ\scripts\tups_integ.ini un_install_policies1v1 - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSDbManagementStep z:\tups\integ\scripts\tups_integ.ini count_27 - -END_TESTCASE SEC-INTEG-UPS-D009 - -//! @SYMTestCaseID SEC-INTEG-UPS-D010 -//! @SYMTestCaseDesc Removal of decision from DB by upgrading policy file -//! (policy_update) -//! -//! @SYMPREQ PREQ1262 -//! @SYMREQ REQ7397 REQ7399 REQ7400 -//! @SYMTestPriority Critical -//! @SYMTestStatus Implemented -//! @SYMTestActions Preconditions: -//! Preconditions: -//! • For each of the services There is an appropriate policy, policy evaluator and -//! dialog creator that matches the UID of the service offered by the “system server”. -//! • The SIS file used to install test policy did NOT install any executable client that -//! could be mapped to this policy. -//! Test Actions: -//! • Populate decision DB for 3 test clients (A, B, C) with “Always” decisions for 3 Clients. -//! • Upgrade policy mapped to Client B via SWI. -//! • Launch test clients (A, B, C). Clients A & C should have normal access test service (no -//! prompting). For Client B, UPS should prompt again for user permission, select “never” option. -//! • Check that Client A & C can access test service. -//! @SYMTestExpectedResults • Decision DB contains only “Always” decision stored for Clients A & C, for Client -//! B the decision stored now is “never”. -//! • Test client A & C are granted access to test service. -//! • Policy files were installed in private directory -//! -//! @SYMTestType CIT -START_TESTCASE SEC-INTEG-UPS-D010 - -RUN_TEST_STEP 100 TUPSInteg_1 UtilsCloseUps -RUN_UTILS DeleteFile c:\private\10283558\database\ups.db - -// populate decision database with some inital values. -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -// installs policy file version 1 -RUN_TEST_STEP 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini install_policies1v1 - - -// populates decisions related to policy just installed -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini policies1v1_populate -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini policies1v1_check - -RUN_TEST_STEP 100 TUPSInteg_1 UPSDbManagementStep z:\tups\integ\scripts\tups_integ.ini count_29 - -// installs policy file version 2, this should cause decisions to be deleted -CONCURRENT -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini install_policies1v2 -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini policies1v2_inflight_change -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -CONSECUTIVE - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSDbManagementStep z:\tups\integ\scripts\tups_integ.ini count_29 - -// Cleanup -RUN_TEST_STEP 100 tups_install UninstallAugStep z:\tups\integ\scripts\tups_integ.ini un_install_policies1v2 - -//////////// repeats same test sequence but without concurrency ///////////////////////// -RUN_TEST_STEP 100 TUPSInteg_1 UtilsCloseUps -RUN_UTILS DeleteFile c:\private\10283558\database\ups.db - -// populate decision database with some inital values. -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -// installs policy file version 1 -RUN_TEST_STEP 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini install_policies1v1 - -// populates decisions related to policy just installed -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini policies1v1_populate -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini policies1v1_check - -RUN_TEST_STEP 100 TUPSInteg_1 UPSDbManagementStep z:\tups\integ\scripts\tups_integ.ini count_29 - -// installs policy file version 2, this should cause decisions to be deleted. -RUN_TEST_STEP 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini install_policies1v2 - -// populates decisions that are expected to be deleted. -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini policies1v2_populate -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini policies1v2_check - - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSDbManagementStep z:\tups\integ\scripts\tups_integ.ini count_29 - -// Cleanup -RUN_TEST_STEP 100 tups_install UninstallAugStep z:\tups\integ\scripts\tups_integ.ini un_install_policies1v2 - - - -END_TESTCASE SEC-INTEG-UPS-D010 - - //********************** SEC-UPS-E : SECURITY POLICIES AND POLICY EVALUATOR PLUG-INS ********************** //! @SYMTestCaseID SEC-UPS-INTEG-E001 //! @SYMTestCaseDesc To ensure that when a single bit is set in the “options” no security @@ -1732,133 +1415,6 @@ RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini question_mark_card END_TESTCASE SEC-UPS-INTEG-E009 -//! @SYMTestCaseID SEC-INTEG-UPS-E017 -//! @SYMTestCaseDesc Post manufacture install of Policy Evaluator -//! (policy_evaluator_install) -//! -//! @SYMPREQ PREQ1262 -//! @SYMREQ REQ7408 -//! @SYMTestPriority Critical -//! @SYMTestStatus Implemented -//! @SYMTestActions -//! Preconditions: -//! • There a policy file associated to test service, however the policy evaluator specified -//! in the “Policy evaluator field” is not present in the phone -//! Test Actions: -//! • Using SIS file install new policy evaluator that is listed in policy file (This SIS file -//! only installs policy evaluator plug-in, it does NOT install policy file). -//! • Launch test client which uses policy file that invokes use of new policy evaluator, verify -//! that UPS invokes the new policy evaluator, use test client to store new “never” and “always” -//! decisions. -//! • Uninstall the policy evaluator that was just previously installed, re-install again the same -//! policy evaluator; as decisions are not expected to be deleted verify that the decisions are -//! still there in database. -//! • Run the previous test sequence concurrently with other clients using decisions stored in DB not -//! related to new policy evaluator, check that these decisions are not affected by installation -//! and removal of policy evaluator. -//! -//! @SYMTestExpectedResults • Newly installed policy evaluator is used after installation by SIS file. -//! • Decisions in DB are not affected by installation/removal of policy evaluator. -//! @SYMTestType CIT - -START_TESTCASE SEC-INTEG-UPS-E017 - -RUN_TEST_STEP 100 TUPSInteg_1 UtilsCloseUps -RUN_UTILS DeleteFile c:\private\10283558\database\ups.db - -// populate decision database with some inital values. -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -// installs new policy evaluator -RUN_TEST_STEP !Heap=0x150000 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini install_evaluator5 - -// Delay added to alow new plugin to be scaned by some magic entity in the phone -DELAY 8000 - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini newevaluator5 - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -// uninstall policy file. -RUN_TEST_STEP 100 tups_install UninstallStep z:\tups\integ\scripts\tups_integ.ini uninstall_evaluator5 - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSDbManagementStep z:\tups\integ\scripts\tups_integ.ini count_30 - -END_TESTCASE SEC-INTEG-UPS-E017 - - -//! @SYMTestCaseID SEC-INTEG-UPS-E018 -//! @SYMTestCaseDesc Post manufacture install of dialog creator -//! (dialog_creator_install) -//! -//! @SYMPREQ PREQ1262 -//! @SYMREQ REQ7408 -//! @SYMTestPriority Critical -//! @SYMTestStatus Implemented -//! @SYMTestActions -//! Preconditions: -//! • Existence of SIS file that can install new dialog creator and policy file. -//! Test Actions: -//! • Using SIS file install new dialog creator and policy file. -//! • Request specific services to test system server that will invoke ups for -//! authorization and using the new dialog creator and policy file installed. Make -//! sure that an “always” and “never” decisions are stored in DB. -//! • Uninstall the SIS file, check the new decisions related to previously installed -//! dialog creator were removed for DB. -//! -//! @SYMTestExpectedResults -//! • Newly installed dialog and policy are used by UPS after installation by -//! SIS file. -//! • New decisions related to new dialog creator and policy file are stored correctly -//! into decision DB. -//! • Decisions related to policy file (installed by the same SIS file) are removed -//! from DB. -//! @SYMTestType CIT - -START_TESTCASE SEC-INTEG-UPS-E018 - -RUN_TEST_STEP 100 TUPSInteg_1 UtilsCloseUps -RUN_UTILS DeleteFile c:\private\10283558\database\ups.db - -// populate decision database with some inital values. -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -// installs new policy evaluator -RUN_TEST_STEP !Heap=0x150000 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini install_dialog7 -// Delay Allows new plugin to be scanned by ECOM -DELAY 8000 - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini newdialog7 - - -// uninstall policy file. -RUN_TEST_STEP 100 tups_install UninstallAugStep z:\tups\integ\scripts\tups_integ.ini uninstall_dialog7 - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSDbManagementStep z:\tups\integ\scripts\tups_integ.ini count_27 - -END_TESTCASE SEC-INTEG-UPS-E018 - - //! @SYMTestCaseID SEC-INTEG-UPS-E024 //! @SYMTestCaseDesc Security Policy Authorisation - EAlwaysCheck @@ -2600,109 +2156,6 @@ //********************** SEC-UPS-G : NEGATIVE TEST CASES ********************** -//! @SYMTestCaseID SEC-INTEG-UPS-G001 -//! @SYMTestCaseDesc Policy installation via SWI signed with CA certificate non present in certstore. -//! (policy_file_ca_not_in_store) -//! -//! @SYMPREQ PREQ1262 -//! @SYMREQ REQ7398 -//! @SYMTestPriority Critical -//! @SYMTestStatus Implemented -//! @SYMTestActions -//! Preconditions: -//! • Policy to be installed does not currently exist in phone -//! • The SIS file to attempt a policy file installation has been signed with -//! a CA certificate is not present in the SWI CA store. -//! Test Actions: -//! • Install sis that installs policy. -//! -//! @SYMTestExpectedResults -//! • SWI should reject SIS file for security reasons. -//! -//! @SYMTestType CIT - -START_TESTCASE SEC-INTEG-UPS-G001 - -RUN_TEST_STEP_RESULT -10254 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini ca_cert_no_stored - -END_TESTCASE SEC-INTEG-UPS-G001 - - - - - - - - -//! @SYMTestCaseID SEC-INTEG-UPS-G002 -//! @SYMTestCaseDesc Tamper attempt in policy files backup and restore -//! (tampered_policy_file_backup_restore) -//! -//! @SYMPREQ PREQ1262 -//! @SYMREQ REQ4701 -//! @SYMTestPriority Critical -//! @SYMTestStatus Implemented -//! @SYMTestActions -//! Preconditions: -//! • There is a set of static policies already present in phone. -//! • The policy files installed via SIS file to be used for test purpose was flagged -//! with “VERIFY” in the package file. -//! Test Actions: -//! • Install policy file flagged with “VERIFY”, populate decisions in database. -//! • Back up policy files. -//! • Delete policy file form private directory. -//! • Try to restore static policies from a backed up archive that is different that the -//! one obtained originally. -//! -//! -//! @SYMTestExpectedResults -//! • Restore operation should fail and tampered archive rejected. -//! -//! @SYMTestType CIT - -START_TESTCASE SEC-INTEG-UPS-G002 - -RUN_TEST_STEP 100 TUPSInteg_1 UtilsCloseUps -RUN_UTILS DeleteFile c:\private\10283558\database\ups.db -RUN_UTILS MakeReadWrite c:\tswi\tbackuprestore\backup10285777.1 -RUN_UTILS DeleteFile C:\tswi\tbackuprestore\backup10285777.1 - -// populate decision database with some inital values. -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - - -// installs policy file with VERIFY flag -RUN_TEST_STEP 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini install_policies1v2 - -// populates decisions related to policy just installed -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini policies1v2_populate -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini policies1v2_check - -// backs up policy file -RUN_TEST_STEP 100 tups_backuprestore BACKUP z:\tups\integ\scripts\tups_integ.ini backup_policy_file2 - -// deletes valid backup files -RUN_UTILS MakeReadWrite c:\tswi\tbackuprestore\backup10285777.1 -RUN_UTILS DeleteFile c:\tswi\tbackuprestore\backup10285777.1 - -//copies altered backup files to replace the valid ones. -RUN_UTILS CopyFile z:\tups\integ\tampered_backup\backup10285777.1 c:\tswi\tbackuprestore\backup10285777.1 -RUN_UTILS MakeReadWrite c:\tswi\tbackuprestore\backup10285777.1 - -//Deletes current policy file been used by -RUN_UTILS DeleteFile c:\private\10283558\policies\ups_101f7f1f_ff000001.rsc - -// restores policy file -RUN_TEST_STEP_RESULT -11 100 tups_backuprestore RESTORE z:\tups\integ\scripts\tups_integ.ini backup_policy_file2 - -// uninstall SIS files previously installed -RUN_TEST_STEP 100 tups_install UninstallAugStep z:\tups\integ\scripts\tups_integ.ini un_install_policies1v2 - -END_TESTCASE SEC-INTEG-UPS-G002 - - - //! @SYMTestCaseID SEC-UPS-INTEG-G004 //! @SYMTestCaseDesc Non ProtServ capability system server //! (no_protser_cap) @@ -2733,30 +2186,6 @@ RUN_TEST_STEP 100 TUPSInteg_1 NonProtServAuthorisation z:\tups\integ\scripts\tups_integ.ini no_protser_cap_b END_TESTCASE SEC-UPS-INTEG-G004 -//! @SYMTestCaseID SEC-UPS-INTEG-G006 -//! @SYMTestCaseDesc Non AllFiles capability CA -//! (no_allfiles_cap_ca) -//! -//! @SYMPREQ PREQ1262 -//! @SYMREQ REQ7398 -//! -//! @SYMTestPriority Critical -//! @SYMTestStatus Implemented -//! @SYMTestActions Preconditions: -//! • Policy to be installed does not currently exist in phone. -//! • The SIS file to attempt a policy file installation has been -//! signed with a CA certificate but this CA certificate has not Installation via SWI of policy file signed with a CA certificate with no All_files capabilities. -//! -//! Test Actions: -//! • Install non CA signed sis that installs policy. -//! -//! @SYMTestExpectedResults • System server receives a KErrSecurityError from SWI. -//! -//! @SYMTestType CIT - -START_TESTCASE SEC-UPS-INTEG-G006 -RUN_TEST_STEP_RESULT -10254 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini no_allfiles_ca -END_TESTCASE SEC-UPS-INTEG-G006 //! @SYMTestCaseID SEC-UPS-G007 //! @SYMTestCaseDesc Protected deletion and update of decisions. @@ -2965,162 +2394,6 @@ //********************** SEC-UPS-H : MISCELLANEOUS ********************** - -//! @SYMTestCaseID SEC-INTEG-UPS-H008 -//! @SYMTestCaseDesc Eclipsing of policy via SWI. -//! (policy_file_eclipse) -//! -//! @SYMPREQ PREQ1262 -//! @SYMREQ REQ7393 REQ7498 -//! @SYMTestPriority Critical -//! @SYMTestStatus Implemented -//! @SYMTestActions -//! Preconditions: -//! • There is a policy file in ROM that matches the UID of the service offered by -//! the “system server”. (uses policy evaluator A) -//! • The policy to be deployed via SWI to eclipse the policy above maps the policy to -//! a different policy evaluator. (uses policy evaluator B). New policy is written in -//! system drive. -//! • There are some decisions stored in DB related to policy file about to be eclipsed. -//! Test Actions: -//! • Launch “test client” which tries to use system servers. System server should invoke -//! UPS to display security dialog. -//! • Select “always” option on security dialog, make sure that “policy evaluator A” was -//! invoked, check that test client can access intended service. -//! • Deploy new policy using SIS file to eclipse existing ROM policy. -//! • Check that previous entries related to policy file were deleted from DB. -//! • Launch the same test client again, the security dialog should be displayed again as the -//! existing “always” decision stored in DB is expected to be deleted. -//! • Select “always” option on security dialog, make sure that “policy evaluator B” was -//! invoked, check that test client can access intended service. -//! -//! -//! @SYMTestExpectedResults -//! • After deployment of new policy a different policy evaluator is invoked for system -//! server. -//! • Related decisions were removed after eclipsing. -//! @SYMTestType CIT - -START_TESTCASE SEC-INTEG-UPS-H008 - -RUN_TEST_STEP 100 TUPSInteg_1 UtilsCloseUps -RUN_UTILS DeleteFile c:\private\10283558\database\ups.db - -// populate decision database with some inital values. -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini pre_eclipse -RUN_TEST_STEP 100 TUPSInteg_1 UPSDbManagementStep z:\tups\integ\scripts\tups_integ.ini count_30 - -// SIS file eclipses policy file from ROM -RUN_TEST_STEP 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini install_eclipse1 - -// Eclipsing of policy file is expected to remove some decisions -RUN_TEST_STEP 100 TUPSInteg_1 UPSDbManagementStep z:\tups\integ\scripts\tups_integ.ini count_27 - -// cheks new policy file (on C drive) -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini post_eclipse -RUN_TEST_STEP 100 TUPSInteg_1 UPSDbManagementStep z:\tups\integ\scripts\tups_integ.ini count_32 - -// uninstall last eclipse. -RUN_TEST_STEP 100 tups_install UninstallAugStep z:\tups\integ\scripts\tups_integ.ini uninstall_eclipse1 - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSDbManagementStep z:\tups\integ\scripts\tups_integ.ini count_27 - -END_TESTCASE SEC-INTEG-UPS-H008 - - -//! @SYMTestCaseID SEC-INTEG-UPS-H009 -//! @SYMTestCaseDesc Policy files backup and restore. -//! (policy_file_backup_restore) -//! -//! @SYMPREQ PREQ1262 -//! @SYMREQ REQ4701 -//! @SYMTestPriority Critical -//! @SYMTestStatus Implemented -//! @SYMTestActions -//! Preconditions: -//! • There is a set of static policies already present in phone. -//! • The policy files installed via SIS file to be used for test purpose was flagged -//! with “VERIFY” in the package file. -//! Test Actions: -//! • Install policy file flagged with “VERIFY”, populate decisions in database. -//! • Back up static policies. -//! • Uninstall the policy file. -//! • Try to restore static policies. -//! • Verify that policy files can be reused correctly, verify correctness of decision -//! database. -//! -//! -//! @SYMTestExpectedResults -//! • Restore operation does not show any problem in operation. -//! • Policy file restored is equal to policy file backed up. -//! @SYMTestType CIT - -START_TESTCASE SEC-INTEG-UPS-H009 - -RUN_TEST_STEP 100 TUPSInteg_1 UtilsCloseUps -RUN_UTILS DeleteFile c:\private\10283558\database\ups.db -RUN_UTILS MakeReadWrite c:\tswi\tbackuprestore\backup10285777.1 -RUN_UTILS DeleteFile C:\tswi\tbackuprestore\backup10285777.1 - -// populate decision database with some inital values. -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini populate_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -// installs policy file with VERIFY flag -RUN_TEST_STEP 100 tups_install InstallStep z:\tups\integ\scripts\tups_integ.ini install_policies1v2 - -// populates decisions related to policy just installed -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini policies1v2_populate -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini policies1v2_check - -RUN_TEST_STEP 100 TUPSInteg_1 UPSDbManagementStep z:\tups\integ\scripts\tups_integ.ini count_29 - -// backs up policy file -RUN_TEST_STEP 100 tups_backuprestore BACKUP z:\tups\integ\scripts\tups_integ.ini backup_policy_file2 - -RUN_TEST_STEP 100 TUPSInteg_1 UtilsCloseUps - -// uninstall the augmentation before trying to restore the policy file -RUN_TEST_STEP 100 tups_install UninstallAugStep z:\tups\integ\scripts\tups_integ.ini un_install_policies1v2 - -// restores policy file -RUN_TEST_STEP 100 tups_backuprestore RESTORE z:\tups\integ\scripts\tups_integ.ini backup_policy_file2 - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSDbManagementStep z:\tups\integ\scripts\tups_integ.ini count_27 - -// uninstall SIS files previously installed -RUN_TEST_STEP 100 tups_install UninstallAugStep z:\tups\integ\scripts\tups_integ.ini un_install_policies1v2 - -RUN_TEST_STEP 100 TUPSInteg_1 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_2 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample -RUN_TEST_STEP 100 TUPSInteg_3 UPSClientStep z:\tups\integ\scripts\tups_integ.ini check_sample - -RUN_TEST_STEP 100 TUPSInteg_1 UPSDbManagementStep z:\tups\integ\scripts\tups_integ.ini count_27 - -END_TESTCASE SEC-INTEG-UPS-H009 - - //! @SYMTestCaseID SEC-UPS-INTEG-H010 //! @SYMTestCaseDesc Simple request cancelation //! (simple_cancel) diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/src/tupsclientstep.cpp --- a/authorisation/userpromptservice/test/tups/src/tupsclientstep.cpp Wed Aug 18 11:33:05 2010 +0300 +++ b/authorisation/userpromptservice/test/tups/src/tupsclientstep.cpp Thu Sep 02 22:21:47 2010 +0300 @@ -406,13 +406,6 @@ INFO_PRINTF3(_L("%S :Closing session to server: %S"),&iTEFServerName, &iArraySersToRequest[index].iServerName ); CloseSessionL(iArraySersToRequest[index].iServerName); } - - // If it needs to wait for file installation (via swi) - if(iArraySersToRequest[index].iWaitUntilFileAppears.CompareF(_L(""))!=0) - { - WaitThatFileAppearsL(iArraySersToRequest[index].iWaitUntilFileAppears); - INFO_PRINTF3(_L("%S :File installed by SWI found: %S"),&iTEFServerName,&iArraySersToRequest[index].iWaitUntilFileAppears); - } } // End of second loop }// End of first loop @@ -857,45 +850,3 @@ return checkPassed; } // End of function. - - -void CUpsClientStep::WaitThatFileAppearsL(const TDesC& aFileName) - { - RFs aFs; - aFs.Connect(); - - RProperty checkSwiState; - - User::LeaveIfError(checkSwiState.Attach(KUidSystemCategory, Swi::KUidSoftwareInstallKey)); - CleanupClosePushL(checkSwiState); - - TRequestStatus swiStatus; - TInt swisState; - - while(ETrue) - { - checkSwiState.Subscribe(swiStatus); - checkSwiState.Get(KUidSystemCategory,Swi::KUidSoftwareInstallKey, swisState); - if(((swisState & Swi::KSwisOperationMask) == Swi::ESwisNone) && BaflUtils::FileExists(aFs,aFileName)) - { - checkSwiState.Cancel(); - break; - } - User::WaitForRequest(swiStatus); - } - - CleanupStack::PopAndDestroy(&checkSwiState); - - //Wait for swiobserver to shutdown - while(ETrue) - { - _LIT(KSWIObserverName,"swiobserver.exe*"); - TFindProcess finder(KSWIObserverName); - TFullName result; - if (KErrNone != finder.Next(result)) - { - break; - } - User::After(4000); - } - } // End of function. diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/src/tupsclientstep.h --- a/authorisation/userpromptservice/test/tups/src/tupsclientstep.h Wed Aug 18 11:33:05 2010 +0300 +++ b/authorisation/userpromptservice/test/tups/src/tupsclientstep.h Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -26,7 +26,6 @@ #define UPSQUERRY_STEP_H #include #include -#include #include "tupsintegstepbase.h" #include "tups_clientapi_sysserver.h" #include "tupsproperty.h" @@ -94,7 +93,6 @@ TBool CheckResultsL(TInt aIndex); TBool CheckDialogCreatorResultsL(TInt aIndex); TBool CheckPolicyEvaluatorResultsL(TInt aIndex); - void WaitThatFileAppearsL(const TDesC& aFileName); void HoldClientL(void); // Array containing pointers to open sessions diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/tampered_backup/backup10285777.1 Binary file authorisation/userpromptservice/test/tups/tampered_backup/backup10285777.1 has changed diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups/tampered_backup/howto_readme.txt --- a/authorisation/userpromptservice/test/tups/tampered_backup/howto_readme.txt Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -The metadata and backup file were obtained by using tbackuprestore test step. - - -Script file: - -LOAD_SUITE tuiscriptadaptors -LOAD_SUITE tbackuprestore - -// creates resource file via swi -RUN_TEST_STEP 100 tuiscriptadaptors InstallStep z:\tups\integ\scripts\tups_integ.ini install_policies1v1 - -//backup resource file -RUN_TEST_STEP 100 tbackuprestore BACKUP z:\tups\integ\scripts\tups_integ.ini backup_policy_file1 - -// uninstall SIS files previously installed -RUN_TEST_STEP 100 tuiscriptadaptors UninstallAugStep z:\tups\integ\scripts\tups_integ.ini un_install_policies1v1 - - -INI file: - - - - [backup_policy_file1] -FILE1.1 = C:\private\10283558\policies\ups_101f7f1f_ff000001.rsc -SIS1 = z:\tups\integ\packages\tupsinteg_policies1.sis -UID1 = 10285777 -INSTALLDRIVE1 = C - -[install_policies1v1] -sis=z:\tups\integ\packages\tupsinteg_policies1.sis -script=z:\tups\integ\packages\simple.xml - - diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_backuprestore/step_backup.cpp --- a/authorisation/userpromptservice/test/tups_backuprestore/step_backup.cpp Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include "tbackuprestorestep.h" -#include - -#include "swi/backuprestore.h" -#include "cleanuputils.h" - -CTStepBackup::CTStepBackup() - { - SetTestStepName(KTStepBackup); - } - -TVerdict CTStepBackup::doTestStepL() - { - if (TestStepResult() != EPass) - { - return TestStepResult(); - } - - RFs fs; - User::LeaveIfError(fs.Connect()); - CleanupClosePushL(fs); - - Swi::RBackupSession session; - User::LeaveIfError(session.Connect()); - CleanupClosePushL(session); - - while (NextPackage()) - { - TInt cellCountBefore = User::CountAllocCells(); - - RPointerArray files; - CleanupResetAndDestroyPushL(files); - HBufC8* metadata = session.GetMetaDataL(PackageUID(), files); - CleanupStack::PopAndDestroy(&files); // ignore this parameter - CleanupStack::PushL(metadata); - WriteMetaDataL(metadata); - CleanupStack::PopAndDestroy(metadata); - - TInt cellCountAfter = User::CountAllocCells(); - - if ( cellCountAfter - cellCountBefore ) - { - ERR_PRINTF2(_L("Memory Leak is Detected in TVerdict CTStepBackup::doTestStepL(): %d cell(s)"), - cellCountAfter - cellCountBefore); - SetTestStepResult(EFail); - CleanupStack::PopAndDestroy(2, &fs); // session; - return TestStepResult(); - } - - - while (NextFile()) - { - CopyFileL(InstalledFileName(), BackupFileName()); - if (ModifyFile()) - { - // write some note to the end of this file - RFile backup; - User::LeaveIfError(backup.Open(fs, BackupFileName(), EFileWrite)); - CleanupClosePushL(backup); - - _LIT8(KSomeSpuriousCrap, "ALL YOUR RESTORES ARE BELONG TO US"); - TInt pos = 0; - User::LeaveIfError(backup.Seek(ESeekEnd, pos)); - User::LeaveIfError(backup.Write(KSomeSpuriousCrap)); - - CleanupStack::PopAndDestroy(&backup); - } - } - } - - CleanupStack::PopAndDestroy(2, &fs); // session; - - return TestStepResult(); - } diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_backuprestore/step_base.cpp --- a/authorisation/userpromptservice/test/tups_backuprestore/step_base.cpp Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,324 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include "tbackuprestorestep.h" -#include - -#include - -_LIT(KMetaDataFileName, "\\tswi\\tbackuprestore\\metadata%x"); -_LIT(KBackupFileName, "\\tswi\\tbackuprestore\\backup%x.%u"); - -_LIT(KExpectedResultKeyFormat, "expectedresult%d"); -const TInt KResultKeyMaxLength = 16; -const TInt KResultKeyMaxNum = 99; - - -CTBackupRestoreStepBase::~CTBackupRestoreStepBase() - { - iFs.Close(); - } - -CTBackupRestoreStepBase::CTBackupRestoreStepBase() - { - } - -TVerdict CTBackupRestoreStepBase::doTestStepPreambleL() - { - User::LeaveIfError(iFs.Connect()); - SetTestStepResult(EPass); - return TestStepResult(); - } - -TVerdict CTBackupRestoreStepBase::doTestStepPostambleL() - { - return TestStepResult(); - } - -TBool CTBackupRestoreStepBase::Exists(TPtrC aFileName) - { - TEntry entry; - TInt err = iFs.Entry(aFileName, entry); - INFO_PRINTF3(_L("Entry of %S returned %d"), &aFileName, err); - return err == KErrNone; - } - -TBool CTBackupRestoreStepBase::ModifyFile() - { - TBuf<20> token; - token.Format(_L("MODIFY%d.%d"), iCurrentPackageNumber, iCurrentFileNumber); - TInt doIt = 0; - TBool found = GetIntFromConfig(ConfigSection(),token, doIt); - return (found && doIt != 0); - } - -void CTBackupRestoreStepBase::CopyFileL(TPtrC aSourceFileName, TPtrC aDestFileName) - { - INFO_PRINTF3(_L("Copy %S to %S"), &aSourceFileName, &aDestFileName); - RFile infile; - RFile outfile; - User::LeaveIfError(infile.Open(iFs,aSourceFileName,EFileRead)); - CleanupClosePushL(infile); - if (KErrNone != outfile.Create(iFs,aDestFileName,EFileWrite)) - { - User::LeaveIfError(outfile.Open(iFs, aDestFileName, EFileWrite)); - } - - CleanupClosePushL(outfile); - - HBufC8* buffer = HBufC8::NewLC(1024); - TPtr8 ptr = buffer->Des(); - - User::LeaveIfError(infile.Read(ptr)); - while(ptr.Length() != 0) - { - User::LeaveIfError(outfile.Write(*buffer)); - User::LeaveIfError(infile.Read(ptr)); - } - - CleanupStack::PopAndDestroy(3, &infile); // buffer, outfile - } - -TBool CTBackupRestoreStepBase::NextPackage() - { - iCurrentPackageNumber++; - iCurrentFileNumber=0; - iDataFileNumber=0; - if (PackageUID().iUid != 0) - { - INFO_PRINTF2(_L("Package %d"), iCurrentPackageNumber); - return ETrue; - } - return EFalse; - } - -TUid CTBackupRestoreStepBase::PackageUID() - { - TUid uid; - TInt tmp; - TBuf<20> token; - token.Format(_L("UID%d"), iCurrentPackageNumber); - if(GetHexFromConfig(ConfigSection(),token, tmp) == EFalse) - { - tmp = 0; - } - uid.iUid = tmp; - return uid; - } - -TBool CTBackupRestoreStepBase::NextFile() - { - iCurrentFileNumber++; - if (InstalledFileName().Length() != 0) - { - INFO_PRINTF2(_L("File %d"), iCurrentFileNumber); - return ETrue; - } - return EFalse; - } - -TBool CTBackupRestoreStepBase::NextDataFile() - { - iDataFileNumber++; - if (DataFileName().Length() != 0) - { - return ETrue; - } - return EFalse; - } - -TPtrC CTBackupRestoreStepBase::SISFileNameL() - { - TBuf<20> token; - token.Format(_L("SIS%d"), iCurrentPackageNumber); - TPtrC sisfile; - if (GetStringFromConfig(ConfigSection(),token, sisfile) == EFalse) - { - User::Leave(KErrNotFound); - } - return sisfile; - } - -TPtrC CTBackupRestoreStepBase::WrongInstalledFileName() - { - TBuf<20> token; - token.Format(_L("WrongFile%d.%d"), iCurrentPackageNumber, iCurrentFileNumber); - TPtrC filename; - GetStringFromConfig(ConfigSection(),token, filename); - return filename; - } - -TPtrC CTBackupRestoreStepBase::InstalledFileName() - { - TBuf<20> token; - token.Format(_L("FILE%d.%d"), iCurrentPackageNumber, iCurrentFileNumber); - TPtrC filename; - GetStringFromConfig(ConfigSection(),token, filename); - return filename; - } - -TPtrC CTBackupRestoreStepBase::DataFileName() - { - TBuf<20> token; - token.Format(_L("DATA%d.%d"), iCurrentPackageNumber, iDataFileNumber); - TPtrC filename; - GetStringFromConfig(ConfigSection(),token, filename); - return filename; - } - - - -TFileName CTBackupRestoreStepBase::BackupFileName() - { - TFileName backupFileName; - TDriveUnit sysDrive(RFs::GetSystemDrive()); - TBuf<128> fileName = sysDrive.Name(); - fileName.Append(KBackupFileName); - backupFileName.Format(fileName, PackageUID().iUid, iCurrentFileNumber); - return backupFileName; - } - -void CTBackupRestoreStepBase::TouchL(const TDesC& aFileName) - { - iFs.MkDirAll(aFileName); - RFile file; - TRAP_IGNORE(file.Replace(iFs, aFileName, EFileWrite)); - file.Close(); - } - -void CTBackupRestoreStepBase::WriteMetaDataL(HBufC8* aMetaData) - { - RFile metadatafile; - TBuf<256> metadataFileName; - TDriveUnit sysDrive(RFs::GetSystemDrive()); - TBuf<128> fileName = sysDrive.Name(); - fileName.Append(KMetaDataFileName); - metadataFileName.Format(fileName, PackageUID().iUid); - - User::LeaveIfError(metadatafile.Replace(iFs, metadataFileName, EFileWrite)); - - CleanupClosePushL(metadatafile); - User::LeaveIfError(metadatafile.Write(*aMetaData)); - CleanupStack::PopAndDestroy(&metadatafile); - } - -HBufC8* CTBackupRestoreStepBase::ReadMetaDataL(TInt aBytesToCrop) - { - RFile metadatafile; - TBuf<256> metadataFileName; - TDriveUnit sysDrive(RFs::GetSystemDrive()); - TBuf<128> fileName = sysDrive.Name(); - fileName.Append(KMetaDataFileName); - metadataFileName.Format(fileName, PackageUID().iUid); - - User::LeaveIfError(metadatafile.Open(iFs, metadataFileName, EFileRead)); - CleanupClosePushL(metadatafile); - - TInt length(0); - metadatafile.Seek(ESeekEnd,length); - length -= aBytesToCrop; - TInt dummy(0); - metadatafile.Seek(ESeekStart,dummy); - - HBufC8* metadata = HBufC8::NewL(length); - TPtr8 ptr = metadata->Des(); - TInt err = metadatafile.Read(ptr, length); - if (err != KErrNone) - { - delete metadata; - User::Leave(err); - } - CleanupStack::PopAndDestroy(&metadatafile); - return metadata; - } - -TInt CTBackupRestoreStepBase::MetaDataCropLength() - { - TInt cropLength(0); - TBuf<24> token; - token.Format(_L("METADATACROPBYTES%d"), iCurrentPackageNumber); - if(GetIntFromConfig(ConfigSection(),token, cropLength)) - { - INFO_PRINTF3(_L("Ignoring last %d bytes from metadata for package %d."), - cropLength, iCurrentPackageNumber); - } - return cropLength; - } - -TChar CTBackupRestoreStepBase::ExpectedDriveL() - { - TBuf<20> token; - token.Format(_L("INSTALLDRIVE%d"), iCurrentPackageNumber); - TPtrC driveString; - if (GetStringFromConfig(ConfigSection(),token, driveString) == EFalse) - { - User::Leave(KErrNotFound); - } - TChar sisDrive(0); - if (driveString.Length() > 0) - { - sisDrive = driveString[0]; - } - return sisDrive; - } - - -void CTBackupRestoreStepBase::CheckExpectedResultCodesL() - { - RArray expectedResultCodes; - CleanupClosePushL(expectedResultCodes); - TInt result = KErrNone; - TBuf resultKey; - TBool found = ETrue; - - for (TInt i = 1; i <= KResultKeyMaxNum && found; i++) - { - resultKey.Format(KExpectedResultKeyFormat, i); - found = GetIntFromConfig(ConfigSection(), resultKey, result); - if (found) - { - INFO_PRINTF2(_L("Acceptable result code %d"), result); - TInt err = expectedResultCodes.InsertInOrder(result); - if (err != KErrNone && err != KErrAlreadyExists) - { - User::Leave(err); - } - } - } - - if (expectedResultCodes.Count() > 0) - { - // A result code matching one of the possible expected results will - // be converted to EPass, otherwise the result will be EFail. - if (expectedResultCodes.FindInOrder(TestStepResult()) == KErrNotFound) - { - ERR_PRINTF2(_L("Result code %d is not expected"), TestStepResult()); - SetTestStepResult(EFail); - } - else - { - INFO_PRINTF2(_L("Result code %d is in accepted list"), TestStepResult()); - SetTestStepResult(EPass); - } - } - CleanupStack::PopAndDestroy(&expectedResultCodes); - } - - - - diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_backuprestore/step_install.cpp --- a/authorisation/userpromptservice/test/tups_backuprestore/step_install.cpp Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include "tbackuprestorestep.h" -#include - -#include - -#include -#include "tui.h" - -CTStepInstall::CTStepInstall() - { - SetTestStepName(KTStepInstall); - } - -TVerdict CTStepInstall::doTestStepL() - { - if (TestStepResult() != EPass) - { - return TestStepResult(); - } - - RFs fs; - User::LeaveIfError(fs.Connect()); - CleanupClosePushL(fs); - fs.ShareProtected(); - - CInstallPrefs* prefs = CInstallPrefs::NewLC(); - prefs->SetPerformRevocationCheck(EFalse); - - TInt expectedResult; - if (GetIntFromConfig(ConfigSection(),_L("InstallResult"), expectedResult) == EFalse) - { - expectedResult = KErrNone; - } - - while (NextPackage()) - { - TPtrC sisfilename(SISFileNameL()); - INFO_PRINTF2(_L("Installing %S"), &sisfilename); - - TUI ui; - RFile file; - User::LeaveIfError(file.Open(fs, sisfilename, EFileRead)); - - TInt err = Launcher::Install (ui, file, *prefs); - - if (err != expectedResult) - { - INFO_PRINTF3(_L("Expected %d, got %d"), expectedResult, err); - SetTestStepResult(EFail); - } - } - CleanupStack::PopAndDestroy(2, &fs); // prefs - - return TestStepResult(); - } - diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_backuprestore/step_restore.cpp --- a/authorisation/userpromptservice/test/tups_backuprestore/step_restore.cpp Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include "tbackuprestorestep.h" -#include - -#include "swi/backuprestore.h" -#include "swi/swispubsubdefs.h" - -CTStepRestore::CTStepRestore() - { - SetTestStepName(KTStepRestore); - } - -TVerdict CTStepRestore::doTestStepL() - { - if (TestStepResult() != EPass) - { - return TestStepResult(); - } - - TInt err = KErrNone; - TRAP(err, RestoreL()); - INFO_PRINTF2(_L("RestoreL returned %d"), err); - if (err != KErrNone) - { - // Can't set error to KErrServerBusy, or Testexecute will retry. - SetTestStepResult((err != KErrServerBusy)? static_cast(err) : EFail); - } - - CheckExpectedResultCodesL(); - return TestStepResult(); - } - -void CTStepRestore::RestoreL() - { - RFs fs; - User::LeaveIfError(fs.Connect()); - CleanupClosePushL(fs); - fs.ShareProtected(); - - Swi::RRestoreSession session; - User::LeaveIfError(session.Connect()); - CleanupClosePushL(session); - - while (NextPackage()) - { - HBufC8* metadata = ReadMetaDataL(MetaDataCropLength()); - CleanupStack::PushL(metadata); - session.StartPackageL(PackageUID(), *metadata); - while (NextFile()) - { - RFile sourcefile; - User::LeaveIfError(sourcefile.Open(fs, BackupFileName(), EFileRead)); - TPtrC destfilename = InstalledFileName(); - session.RestoreFileL(sourcefile, destfilename); - } - - // Create dummy files to simulate restore of data files - while (NextDataFile()) - { - TouchL(DataFileName()); - } - - session.CommitPackageL(); - CleanupStack::PopAndDestroy(metadata); - - TInt property; - User::LeaveIfError(RProperty::Get(KUidSystemCategory, Swi::KUidSoftwareInstallKey, property)); - - if (property != Swi::ESwisNone) - { - - // The Pub&Sub property should have been reset to none, - // Regardless of the actual result of the test. - SetTestStepResult(EFail); - User::Leave(KErrGeneral); - - } - - } - CleanupStack::PopAndDestroy(2, &fs); // session - } - - diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_backuprestore/step_uninstall.cpp --- a/authorisation/userpromptservice/test/tups_backuprestore/step_uninstall.cpp Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include "tbackuprestorestep.h" -#include - -#include -#include "tui.h" - -CTStepUninstall::CTStepUninstall() - { - SetTestStepName(KTStepUninstall); - } - -TVerdict CTStepUninstall::doTestStepL() - { - if (TestStepResult() != EPass) - { - return TestStepResult(); - } - - TInt expectedResult; - if (GetIntFromConfig(ConfigSection(),_L("UninstallResult"), expectedResult) == EFalse) - { - expectedResult = KErrNone; - } - - while (NextPackage()) - { - TUI ui; - TInt err = Launcher::Uninstall(ui, PackageUID()); - if (expectedResult == KErrNotFound) - { - if (err != KErrNone) - { - // Can't set error to KErrServerBusy, or Testexecute will retry. - SetTestStepResult((err != KErrServerBusy)? static_cast(err) : EFail); - } - CheckExpectedResultCodesL(); - err = expectedResult; - } - if (err != expectedResult) - { - INFO_PRINTF3(_L("Expected %d, got %d"), expectedResult, err); - SetTestStepResult(EFail); - SetTestStepError(err); - } - } - return TestStepResult(); - } diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_backuprestore/tbackuprestore.cpp --- a/authorisation/userpromptservice/test/tups_backuprestore/tbackuprestore.cpp Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include "tbackuprestore.h" -#include "tbackuprestorestep.h" - -_LIT(KServerName,"tups_backuprestore"); - -CTBackupRestoreServer* CTBackupRestoreServer::NewL() - { - CTBackupRestoreServer * server = new (ELeave) CTBackupRestoreServer(); - CleanupStack::PushL(server); - - // Either use a StartL or ConstructL, the latter will permit Server Logging. - - //server->StartL(KServerName); - server->ConstructL(KServerName); - CleanupStack::Pop(server); - return server; - } - -LOCAL_C void MainL() - { - // Leave the hooks in for platform security -#if (defined __DATA_CAGING__) - RProcess().DataCaging(RProcess::EDataCagingOn); - RProcess().SecureApi(RProcess::ESecureApiOn); -#endif - CActiveScheduler* sched=NULL; - sched=new(ELeave) CActiveScheduler; - CActiveScheduler::Install(sched); - CTBackupRestoreServer* server = NULL; - TRAPD(err,server = CTBackupRestoreServer::NewL()); - if(!err) - { - RProcess::Rendezvous(KErrNone); - sched->Start(); - } - delete server; - delete sched; - } - -GLDEF_C TInt E32Main() - { - CTrapCleanup* cleanup = CTrapCleanup::New(); - if(cleanup == NULL) - { - return KErrNoMemory; - } - TRAP_IGNORE(MainL()); - delete cleanup; - return KErrNone; - } - -CTestStep* CTBackupRestoreServer::CreateTestStep(const TDesC& aStepName) - { - CTestStep* testStep = NULL; - - if(aStepName == KTStepInstall) - { - testStep = new CTStepInstall(); - } - else if(aStepName == KTStepUninstall) - { - testStep = new CTStepUninstall(); - } - else if(aStepName == KTStepBackup) - { - testStep = new CTStepBackup(); - } - else if(aStepName == KTStepRestore) - { - testStep = new CTStepRestore(); - } - - return testStep; - } diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_backuprestore/tbackuprestore.h --- a/authorisation/userpromptservice/test/tups_backuprestore/tbackuprestore.h Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __T_BACKUP_RESTORE_H__ -#define __T_BACKUP_RESTORE_H__ -#include - -class CTBackupRestoreServer : public CTestServer - { -public: - static CTBackupRestoreServer* NewL(); - virtual CTestStep* CreateTestStep(const TDesC& aStepName); - inline RFs& Fs(); - -private: - RFs iFs; - }; - -inline RFs& CTBackupRestoreServer::Fs() - { - return iFs; - } -#endif /* __T_BACKUP_RESTORE_H__ */ diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_backuprestore/tbackuprestorestep.h --- a/authorisation/userpromptservice/test/tups_backuprestore/tbackuprestorestep.h Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -/* -* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __T_BACKUP_RESTORE_STEP_H__ -#define __T_BACKUP_RESTORE_STEP_H__ - -#include -#include "tbackuprestore.h" - -_LIT(KTStepInstall, "INSTALL"); -_LIT(KTStepUninstall, "UNINSTALL"); -_LIT(KTStepBackup, "BACKUP"); -_LIT(KTStepRestore, "RESTORE"); - - -class CTBackupRestoreStepBase : public CTestStep - { -protected: - CTBackupRestoreStepBase(); - ~CTBackupRestoreStepBase(); - virtual TVerdict doTestStepPreambleL(); - virtual TVerdict doTestStepPostambleL(); - // Iterates through SIS files within a step - TBool NextPackage(); - // The UID of the current SIS file - TUid PackageUID(); - // The filename of the current SIS file - TPtrC SISFileNameL(); - // The expected selected drive of the current package - TChar ExpectedDriveL(); - // Iterates through files within a SIS file - TBool NextFile(); - TBool NextDataFile(); - TFileName BackupFileName(); - // The location where the current file is [to be] installed - TPtrC InstalledFileName(); - TPtrC DataFileName(); - // The location where the current file is not [to be] installed - TPtrC WrongInstalledFileName(); - // Utility method - TBool Exists(TPtrC aFileName); - // Method for creating empty files - void TouchL(const TDesC& aFileName); - // Utility method - void CopyFileL(TPtrC aSourceFileName, TPtrC aDestFileName); - // Utility method for storing backup metadata - void WriteMetaDataL(HBufC8* aMetaData); - // Utility method for recovering backup metadata - HBufC8* ReadMetaDataL(TInt aBytesToCrop = 0); - - // test if we should write some garbage to the file, just test - // if we can/can not restore a file that would fail its hash check - TBool ModifyFile(); - - // Get the length in bytes to crop from the end of the metadata on restore. - TInt MetaDataCropLength(); - // utility method to Check current step result against list of expected result codes. - void CheckExpectedResultCodesL(); - -private: - TInt iCurrentPackageNumber; - TInt iCurrentFileNumber; - TInt iDataFileNumber; - RFs iFs; - }; - -class CTStepInstall : public CTBackupRestoreStepBase - { -public: - CTStepInstall(); - virtual TVerdict doTestStepL(); - }; - -class CTStepUninstall : public CTBackupRestoreStepBase - { -public: - CTStepUninstall(); - virtual TVerdict doTestStepL(); - }; - -class CTStepBackup : public CTBackupRestoreStepBase - { -public: - CTStepBackup(); - virtual TVerdict doTestStepL(); - }; - -class CTStepRestore : public CTBackupRestoreStepBase - { -public: - CTStepRestore(); - virtual TVerdict doTestStepL(); -private: - void RestoreL(); - }; - -#endif /* __T_BACKUP_RESTORE_STEP_H__ */ diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_backuprestore/tui.cpp --- a/authorisation/userpromptservice/test/tups_backuprestore/tui.cpp Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include "tui.h" - -TBool TUI::DisplayTextL(const CAppInfo&, TFileTextOption, const TDesC&) - { - return ETrue; - } - -void TUI::DisplayErrorL(const CAppInfo&, TErrorDialog, const TDesC&) - { - } - -TBool TUI::DisplayDependencyBreakL(const CAppInfo&, const RPointerArray&) - { - return ETrue; - } - -TBool TUI::DisplayApplicationsInUseL(const CAppInfo&, const RPointerArray&) - { - return ETrue; - } - -TBool TUI::DisplayQuestionL(const CAppInfo&, TQuestionDialog, const TDesC&) - { - return ETrue; - } - -TBool TUI::DisplayUninstallL(const CAppInfo&) - { - return ETrue; - } - -TBool TUI::DisplayInstallL(const CAppInfo&, const CApaMaskedBitmap*, const RPointerArray&) - { - return ETrue; - } - -TBool TUI::DisplayGrantCapabilitiesL(const CAppInfo&, const TCapabilitySet&) - { - return ETrue; - } - -TInt TUI::DisplayLanguageL(const CAppInfo&, const RArray&) - { - return 0; - } - -TInt TUI::DisplayDriveL(const CAppInfo&, TInt64, const RArray&, const RArray&) - { - return 0; - } - -TBool TUI::DisplayUpgradeL(const CAppInfo&, const CAppInfo&) - { - return ETrue; - } - -TBool TUI::DisplayOptionsL(const CAppInfo&, const RPointerArray&, RArray&) - { - return ETrue; - } - -TBool TUI::HandleInstallEventL(const CAppInfo&, TInstallEvent, TInt, const TDesC&) - { - return ETrue; - } - -void TUI::HandleCancellableInstallEventL(const CAppInfo&, TInstallCancellableEvent, MCancelHandler&, TInt, const TDesC&) - { - } - -TBool TUI::DisplaySecurityWarningL(const CAppInfo&, TSignatureValidationResult, RPointerArray&, RPointerArray&, TBool) - { - return ETrue; - } - -TBool TUI::DisplayOcspResultL(const CAppInfo&, TRevocationDialogMessage, RPointerArray&, RPointerArray&, TBool) - { - return ETrue; - } - -void TUI::DisplayCannotOverwriteFileL(const CAppInfo&, const CAppInfo&, const TDesC&) - { - } - -TBool TUI::DisplayMissingDependencyL( const CAppInfo&, const TDesC&, TVersion, TVersion, TVersion) - { - return ETrue; - } diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_backuprestore/tui.h --- a/authorisation/userpromptservice/test/tups_backuprestore/tui.h Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __T_BACKUP_RESTORE_UI_H__ -#define __T_BACKUP_RESTORE_UI_H__ - -#include - -using namespace Swi; - -class TUI : public Swi::MUiHandler - { -public: - // MCommonDialogs - TBool DisplayTextL(const CAppInfo& aAppInfo, TFileTextOption aOption, const TDesC& aText); - void DisplayErrorL(const CAppInfo& aAppInfo, TErrorDialog aType, const TDesC& aParam); - TBool DisplayDependencyBreakL(const CAppInfo& aAppInfo, const RPointerArray& aComponents); - TBool DisplayApplicationsInUseL(const CAppInfo& aAppInfo, const RPointerArray& aAppNames); - TBool DisplayQuestionL(const CAppInfo& aAppInfo, TQuestionDialog aQuestion, const TDesC& aDes); - // MUninstallerUiHandler - TBool DisplayUninstallL(const CAppInfo& aAppInfo); - // MInstallerUiHandler - TBool DisplayInstallL(const CAppInfo& aAppInfo, const CApaMaskedBitmap* aLogo, const RPointerArray& aCertificates); - TBool DisplayGrantCapabilitiesL(const CAppInfo& aAppInfo, const TCapabilitySet& aCapabilitySet); - TInt DisplayLanguageL(const CAppInfo& aAppInfo, const RArray& aLanguages); - TInt DisplayDriveL(const CAppInfo& aAppInfo, TInt64 aSize, const RArray& aDriveLetters, const RArray& aDriveSpaces); - TBool DisplayUpgradeL(const CAppInfo& aAppInfo, const CAppInfo& aExistingAppInfo); - TBool DisplayOptionsL(const CAppInfo& aAppInfo, const RPointerArray& aOptions, RArray& aSelections); - TBool HandleInstallEventL(const CAppInfo& aAppInfo, TInstallEvent aEvent, TInt aValue, const TDesC& aDes); - void HandleCancellableInstallEventL(const CAppInfo& aAppInfo, TInstallCancellableEvent aEvent, MCancelHandler& aCancelHandler, TInt aValue, const TDesC& aDes); - TBool DisplaySecurityWarningL(const CAppInfo& aAppInfo, TSignatureValidationResult aSigValidationResult, RPointerArray& aPkixResults, RPointerArray& aCertificates, TBool aInstallAnyway); - TBool DisplayOcspResultL(const CAppInfo& aAppInfo, TRevocationDialogMessage aMessage, RPointerArray& aOutcomes, RPointerArray& aCertificates, TBool aWarningOnly); - void DisplayCannotOverwriteFileL(const CAppInfo& aAppInfo, const CAppInfo& aInstalledAppInfo, const TDesC& aFileName); - TBool DisplayMissingDependencyL( const CAppInfo& aAppInfo, const TDesC& aDependencyName, TVersion aWantedVersionFrom, TVersion aWantedVersionTo, TVersion aInstalledVersion); - }; - -#endif /* __T_BACKUP_RESTORE_UI_H__ */ diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_dialogcreator/source/tups_dialogcreator.cpp --- a/authorisation/userpromptservice/test/tups_dialogcreator/source/tups_dialogcreator.cpp Wed Aug 18 11:33:05 2010 +0300 +++ b/authorisation/userpromptservice/test/tups_dialogcreator/source/tups_dialogcreator.cpp Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -21,11 +21,8 @@ #include "tups_dialogcreator_defs.h" #include "tupsintegdefs.h" #include -#include -#include +#include #include -#include -#include #include #include diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_dialogcreator/source/tups_dialogcreator_noprops.cpp --- a/authorisation/userpromptservice/test/tups_dialogcreator/source/tups_dialogcreator_noprops.cpp Wed Aug 18 11:33:05 2010 +0300 +++ b/authorisation/userpromptservice/test/tups_dialogcreator/source/tups_dialogcreator_noprops.cpp Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -19,11 +19,7 @@ #include "tups_dialogcreator_noprops.h" #include "tups_dialogcreator_defs.h" #include -#include -#include #include -#include -#include #include #include diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_install/languagetable.h --- a/authorisation/userpromptservice/test/tups_install/languagetable.h Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* -* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Table of languages -* -*/ - - - - -/** - @file -*/ - -#ifndef __LANGUAGETABLE_H__ -#define __LANGUAGETABLE_H__ - - -TPtrC KLanguageTable[100]= - { - _L("Test"), - _L("English"), - _L("French"), - _L("German"), - _L("Spanish"), - _L("Italian"), - _L("Swedish"), - _L("Danish"), - _L("Norwegian"), - _L("Finnish"), - _L("American"), - _L("SwissFrench"), - _L("SwissGerman"), - _L("Portuguese"), - _L("Turkish"), - _L("Icelandic"), - _L("Russian"), - _L("Hungarian"), - _L("Dutch"), - _L("BelgianFlemish"), - _L("Australian"), - _L("BelgianFrench"), - _L("Austrian"), - _L("NewZealand"), - _L("InternationalFrench"), - _L("Czech"), - _L("Slovak"), - _L("Polish"), - _L("Slovenian"), - _L("TaiwanChinese"), - _L("HongKongChinese"), - _L("PrcChinese"), - _L("Japanese"), - _L("Thai"), - _L("Afrikaans"), - _L("Albanian"), - _L("Amharic"), - _L("Arabic"), - _L("Armenian"), - _L("Tagalog"), - _L("Belarussian"), - _L("Bengali"), - _L("Bulgarian"), - _L("Burmese"), - _L("Catalan"), - _L("Croatian"), - _L("CanadianEnglish"), - _L("InternationalEnglish"), - _L("SouthAfricanEnglish"), - _L("Estonian"), - _L("Farsi"), - _L("CanadianFrench"), - _L("ScotsGaelic"), - _L("Georgian"), - _L("Greek"), - _L("CyprusGreek"), - _L("Gujarati"), - _L("Hebrew"), - _L("Hindi"), - _L("Indonesian"), - _L("Irish"), - _L("SwissItalian"), - _L("Kannada"), - _L("Kazakh"), - _L("Khmer"), - _L("Korean"), - _L("Lao"), - _L("Latvian"), - _L("Lithuanian"), - _L("Macedonian"), - _L("Malay"), - _L("Malayalam"), - _L("Marathi"), - _L("Moldavian"), - _L("Mongolian"), - _L("NorwegianNynorsk"), - _L("BrazilianPortuguese"), - _L("Punjabi"), - _L("Romanian"), - _L("Serbian"), - _L("Somali"), - _L("InternationalSpanish"), - _L("LatinAmericanSpanish"), - _L("Swahili"), - _L("Reserved1"), - _L("Tamil"), - _L("Telugu"), - _L("Tibetan"), - _L("Tigrinya"), - _L("CyprusTurkish"), - _L("Turkmen"), - _L("Ukrainian"), - _L("Urdu"), - _L("Reserved2"), - _L("Vietnamese"), - _L("Welsh"), - _L("Zulu"), - _L("Other") - }; - -#endif // __TSWISSERVER_H__ diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_install/tuiscriptadaptors.cpp --- a/authorisation/userpromptservice/test/tups_install/tuiscriptadaptors.cpp Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1741 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#define __INCLUDE_CAPABILITY_NAMES__ - -#include -#include -#include -#include "tuiscriptadaptors.h" -#include "languagetable.h" - -#include -#include -#include - -using namespace Swi; -using namespace Swi::Test; -using namespace Xml; - -_LIT8(KParserDataType, "text/xml"); -_LIT8(KTrueValue, "true"); -_LIT8(KFalseValue, "false"); -_LIT8(KIndexType, "item"); -_LIT8(KReturnType, "return"); -_LIT8(KDialogName, "dialog"); -_LIT8(KUpdateProgressReturn, "updateprogressreturn"); -_LIT8(KUpdateProgressFinalReturn, "updateprogressfinalreturn"); - - -enum TDialogs - { - KDisplayInstall1 = 1, - KDisplayLanguage1, - KDisplayDrive1, - KDisplayUpgrade1, - KDisplayOptions1, - KDisplaySecurityWarning1, - KDisplayOcspResult1, - KDisplayCannotOverwriteFile1, - KDisplayUninstall1, - KDisplayText1, - KDisplayError1, - KDisplayDependencyBreak1, - KDisplayApplicationsInUse1, - KDisplayQuestion1, - KDisplayMissingDependency1, - KInstallEvenDialogSetProgressBar, - KInstallEvenDialogUpdateProgressBar, - KInstallEvenDialogCompletedInstall, - KInstallEvenDialogOcspCheckEnd, - KInstallEvenDialogCompletedUnInstall, - KInstallEvenDevCert, - KCancelInstallRemoving, - KCancelInstallShuttingDown, - KCancelInstallCopyingFiles, - KCancelInstallOcspCheckStart - }; -/* Functions Literals */ -_LIT8(KDisplayInstall, "DisplayInstall"); -_LIT8(KDisplayGrantCapabilities, "DisplayGrantCapabilities"); -_LIT8(KDisplayLanguage, "DisplayLanguage"); -_LIT8(KDisplayDrive, "DisplayDrive"); -_LIT8(KDisplayUpgrade, "DisplayUpgrade"); -_LIT8(KDisplayOptions, "DisplayOptions"); -_LIT8(KHandleInstallEvent, "HandleInstallEvent"); -_LIT8(KHandleCancellableInstallEvent,"HandleCancellableInstallEvent"); -_LIT8(KDisplaySecurityWarning, "DisplaySecurityWarning"); -_LIT8(KDisplayOcspResult, "DisplayOcspResult"); -_LIT8(KDisplayCannotOverwriteFile, "DisplayCannotOverwriteFile"); -_LIT8(KDisplayUninstall, "DisplayUninstall"); -_LIT8(KDisplayText, "DisplayText"); -_LIT8(KDisplayError, "DisplayError"); -_LIT8(KDisplayDependencyBreak, "DisplayDependencyBreak"); -_LIT8(KDisplayApplicationsInUse, "DisplayApplicationsInUse"); -_LIT8(KDisplayQuestion, "DisplayQuestion"); -_LIT8(KDisplayMissingDependency, "DisplayMissingDependency"); -_LIT8(KDisplaySIDMismatch, "DisplaySIDMismatch"); - -#define KGenericBufferSize 100 - -// Init defaults which will be overridden by script data (or not) -TXmlFileData::TXmlFileData() - : InstallResult(ETrue) - , CapabilitiesResult(ETrue) - , LanguagesResult(0) - , DriveResult('c'-'a') // Default to installing to C: - , UpgradeResult(ETrue) - , OptionsResult(ETrue) - , WarningResult(ETrue) - , OcspResult(ETrue) - , UninstallResult(ETrue) - , TextResult(ETrue) - , DependencyResult(EFalse) - , ApplicationsInUseResult(ETrue) - , QuestionResult(EFalse) - , MissingDependencyResult(EFalse) - , DevCertsResult(ETrue) - , UpdateProgressBarResult(ETrue) - , ProgressBarFinalValueResult(ETrue) - { - } - -CUIScriptAdaptor::CUIScriptAdaptor(const TFileName& aXmlFileName, CTestExecuteLogger& aLogger, - RArray* aExpectedValue) - : - iXmlFileName(aXmlFileName), - iLogger(aLogger), - iExpectedValue(aExpectedValue), - iDelayDialogNumber(-1) - { - } - -CUIScriptAdaptor* CUIScriptAdaptor::NewLC(const TFileName& aXmlFileName, CTestExecuteLogger& aLogger, - RArray* aExpectedValue) - { - CUIScriptAdaptor* self = new(ELeave) CUIScriptAdaptor(aXmlFileName, aLogger, aExpectedValue); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -CUIScriptAdaptor* CUIScriptAdaptor::NewL(const TFileName& aXmlFileName, CTestExecuteLogger& aLogger, - RArray* aExpectedValue) - { - CUIScriptAdaptor* self = NewLC(aXmlFileName, aLogger, aExpectedValue); - CleanupStack::Pop(self); - return self; - } - -CUIScriptAdaptor::CUIScriptAdaptor(const TFileName& aXmlFileName, CTestExecuteLogger& aLogger, - TPtrC aExpectedText, - TPtrC aTextIsHash, - TInt aExpectedDailog, - TInt aKerrCode) - : - iXmlFileName(aXmlFileName), - iLogger(aLogger), - iExpectedDisplayText(aExpectedText), - iExpectedHash(aTextIsHash), - iExpectedDialog(aExpectedDailog), - iKerrCode(aKerrCode), - iDelayDialogNumber(-1), - iDisplayedTextActual(NULL) - { - } - -CUIScriptAdaptor* CUIScriptAdaptor::NewLC(const TFileName& aXmlFileName, CTestExecuteLogger& aLogger, - TPtrC aExpectedText, - TPtrC aTextIsHash, - TInt aExpectedDailog, - TInt aKerrCode - ) - { - CUIScriptAdaptor* self = new(ELeave) CUIScriptAdaptor(aXmlFileName, aLogger, aExpectedText, aTextIsHash, aExpectedDailog, aKerrCode); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -CUIScriptAdaptor* CUIScriptAdaptor::NewL(const TFileName& aXmlFileName, CTestExecuteLogger& aLogger, - TPtrC aExpectedText, - TPtrC aTextIsHash, - TInt aExpectedDailog, - TInt aKerrCode - ) - { - CUIScriptAdaptor* self = NewLC(aXmlFileName, aLogger, aExpectedText,aTextIsHash, aExpectedDailog, aKerrCode); - CleanupStack::Pop(self); - return self; - } -void CUIScriptAdaptor::ConstructL() - { - User::LeaveIfError(iFs.Connect()); - ScriptParseL(); - } - -CUIScriptAdaptor::~CUIScriptAdaptor() - { - iResult.OptionSelection.Close(); - iFs.Close(); - iObservedOcspOutcomes.ResetAndDestroy(); - delete iFileOwner; - delete iDisplayedTextActual; - } - -/** - * The function is called to parse the XML file. - */ -void CUIScriptAdaptor::ScriptParseL() - { - CRebuildingContentHandler* contentHandler = - CRebuildingContentHandler::NewLC(iLogger); - - // Open parser session - CParser* parser = CParser::NewLC(KParserDataType, *contentHandler); - - // Starts parser session and active scheduler. - INFO_PRINTF1(_L("Parsing XML...")); - ParseL(*parser, iFs, iXmlFileName); - - iResult = contentHandler->GetOptions(); - CleanupStack::PopAndDestroy(2, contentHandler); // parser, contentHandler - } - -/** - * Extracts the nPos command line argument. - */ - -HBufC* GetArgumentL(TInt nPos) - { - HBufC *argv = HBufC::NewLC(User::CommandLineLength()); - TPtr cmd(argv->Des()); - User::CommandLine(cmd); - - TLex arguments(cmd); - - // finds nth parameter - while(nPos && !arguments.Eos()) - { - TPtrC token = arguments.NextToken(); - if(token.Length() > 0) - { - nPos--; - } - } - - HBufC* result = NULL; - - if(!arguments.Eos()) - { - TPtrC testfile(arguments.NextToken()); - - if(testfile.Length() > 0) - { - result = testfile.AllocL(); - } - }; - - // no parameter found, but must return something so.. - if(!result) - { - result = HBufC::NewL(0); - } - - CleanupStack::PopAndDestroy(argv); - - return result; - } - -CRebuildingContentHandler* CRebuildingContentHandler::NewLC( - CTestExecuteLogger& aLogger) - { - CRebuildingContentHandler* self = new(ELeave) CRebuildingContentHandler( - aLogger); - CleanupStack::PushL(self); - return self; - } - -CRebuildingContentHandler* CRebuildingContentHandler::NewL( - CTestExecuteLogger& aLogger) - { - CRebuildingContentHandler* self = new(ELeave) CRebuildingContentHandler( - aLogger); - return self; - } - -CRebuildingContentHandler::CRebuildingContentHandler( - CTestExecuteLogger& aLogger) - : - iError(KErrNone), - iLogger(aLogger), - iLevel1(EScript) - { - } - -CRebuildingContentHandler::~CRebuildingContentHandler() - { - } - -void CRebuildingContentHandler::OnStartDocumentL(const RDocumentParameters& - /*aDocParam*/, TInt aErrorCode) - { - User::LeaveIfError(aErrorCode); - } - -void CRebuildingContentHandler::OnEndDocumentL(TInt aErrorCode) - { - User::LeaveIfError(aErrorCode); - } - -void CRebuildingContentHandler::OnStartElementL(const RTagInfo& aElement, - const RAttributeArray& aAttributes, TInt aErrorCode) - { - User::LeaveIfError(aErrorCode); - - TInt nAttributes = aAttributes.Count(); - for(TInt i=0; i text; - text.Format(_L8 ("\015\012The Selection Index of the DisplayOptionsL : ")); - iOutFile.Write(text); - iOutFile.Write(aData8); - */ - iResult.OptionSelection.Append(ETrue); - } - else if ( aData8.Compare(KFalseValue) == KErrNone ) - { - /* - TBuf8 text; - text.Format(_L8 ("\015\012The Selection Index of the DisplayOptionsL : ")); - iOutFile.Write(text); - iOutFile.Write(aData8); - */ - iResult.OptionSelection.Append(EFalse); - } - } - else if ( iLevel2 == EReturn ) - { - if ( aData8.Compare(KTrueValue) == KErrNone ) - { - /* - TBuf8 text; - text.Format(_L8 ("\015\012The Input value of the DisplayOptionsL : ")); - iOutFile.Write(text); - iOutFile.Write(aData8); - */ - iResult.OptionsResult = ETrue; - } - else if ( aData8.Compare(KFalseValue) == KErrNone ) - { - /* - TBuf8 text; - text.Format(_L8 ("\015\012The Input value of the DisplayOptionsL : ")); - iOutFile.Write(text); - iOutFile.Write(aData8); - */ - iResult.OptionsResult = EFalse; - } - } - break; - - case EHandleInstallEvent: - if (iLevel2 == EUpdateProgress) - { - if (aData8.Compare(KTrueValue) == KErrNone) - { - INFO_PRINTF1(_L("HandleInstallEvent-UpdateProgress will return ETrue")); - iResult.UpdateProgressBarResult = ETrue; - } - else if (aData8.Compare(KFalseValue) == KErrNone) - { - INFO_PRINTF1(_L("HandleInstallEvent-UpdateProgress will return EFalse")); - iResult.UpdateProgressBarResult = EFalse; - } - } - else if (iLevel2 == EUpdateProgressFinal) - { - if (aData8.Compare(KTrueValue) == KErrNone) - { - INFO_PRINTF1(_L("HandleInstallEvent-UpdateProgressFinal will return ETrue")); - iResult.ProgressBarFinalValueResult = ETrue; - } - else if (aData8.Compare(KFalseValue) == KErrNone) - { - INFO_PRINTF1(_L("HandleInstallEvent-UpdateProgressFinal will return EFalse")); - iResult.ProgressBarFinalValueResult = EFalse; - } - } - else if (iLevel2 == EReturn) - { - if (aData8.Compare(KTrueValue) == KErrNone) - { - INFO_PRINTF1(_L("HandleInstallEvent-DevCert will return ETrue")); - iResult.DevCertsResult = ETrue; - } - else if (aData8.Compare(KFalseValue) == KErrNone) - { - INFO_PRINTF1(_L("HandleInstallEvent-DevCert will return EFalse")); - iResult.DevCertsResult = EFalse; - } - } - break; - - case EHandleCancellableInstallEvent: - // No return values for these events. - break; - - case EDisplaySecurityWarning: - if (iLevel2 == EReturn) - { - TBool found=EFalse; - if (aData8.Compare(KTrueValue) == KErrNone) - { - iResult.WarningResult = ETrue; - found=ETrue; - } - else if (aData8.Compare(KFalseValue) == KErrNone) - { - iResult.WarningResult = EFalse; - found=ETrue; - } - - if (found && !iSecWarnLogged) - { - _LIT(KETrue, "ETrue"); - _LIT(KEFalse, "EFalse"); - INFO_PRINTF2( - _L("DisplaySecurityWarningL will return '%S'"), - iResult.WarningResult ? &KETrue : &KEFalse); - iSecWarnLogged=ETrue; - } - } - break; - - case EDisplayOcspResult: - if ( iLevel2 == EReturn ) - { - if ( aData8.Compare(KTrueValue) == KErrNone ) - iResult.OcspResult = ETrue; - else if ( aData8.Compare(KFalseValue) == KErrNone ) - iResult.OcspResult = EFalse; - _LIT(KETrue, "ETrue"); - _LIT(KEFalse, "EFalse"); - INFO_PRINTF2( - _L("DisplayOcspResultL will return '%S'"), - iResult.OcspResult ? &KETrue : &KEFalse); - } - break; - case EDisplayCannotOverwriteFile: - break; - - case EDisplayUninstall: - if ( iLevel2 == EReturn ) - { - if ( aData8.Compare(KTrueValue) == KErrNone ) - { - INFO_PRINTF1(_L("DisplayUninstallL will return ETrue")); - iResult.UninstallResult = ETrue; - } - else if ( aData8.Compare(KFalseValue) == KErrNone ) - { - INFO_PRINTF1(_L("DisplayUninstallL will return EFalse")); - iResult.UninstallResult = EFalse; - } - } - break; - - case EDisplayText: - if ( iLevel2 == EReturn ) - { - if ( aData8.Compare(KTrueValue) == KErrNone ) - { - /* - TBuf8 text; - text.Format(_L8 ("\015\012The Input value of the DisplayTextL : ")); - iOutFile.Write(text); - iOutFile.Write(aData8); - */ - iResult.TextResult = ETrue; - } - else if ( aData8.Compare(KFalseValue) == KErrNone ) - { - /* - TBuf8 text; - text.Format(_L8 ("\015\012The Input value of the DisplayTextL : ")); - iOutFile.Write(text); - iOutFile.Write(aData8); - */ - iResult.TextResult = EFalse; - } - } - break; - case EDisplayError: - break; - case EDisplayDependencyBreak: - if ( iLevel2 == EReturn ) - { - if ( aData8.Compare(KTrueValue) == KErrNone ) - { - /* - TBuf8 text; - text.Format(_L8 ("\015\012The Input value of the DisplayDependencyBreakL : ")); - iOutFile.Write(text); - iOutFile.Write(aData8); - */ - iResult.DependencyResult = ETrue; - } - else if ( aData8.Compare(KFalseValue) == KErrNone ) - { - /* - TBuf8 text; - text.Format(_L8 ("\015\012The Input value of the DisplayDependencyBreakL : ")); - iOutFile.Write(text); - iOutFile.Write(aData8); - */ - iResult.DependencyResult = EFalse; - } - } - break; - case EDisplayApplicationsInUse: - if ( iLevel2 == EReturn ) - { - if ( aData8.Compare(KTrueValue) == KErrNone ) - { - /* - TBuf8 text; - text.Format(_L8 ("\015\012The Input value of the DisplayApplicationsInUseL : ")); - iOutFile.Write(text); - iOutFile.Write(aData8); - */ - iResult.ApplicationsInUseResult = ETrue; - } - else if ( aData8.Compare(KFalseValue) == KErrNone ) - { - /* - TBuf8 text; - text.Format(_L8 ("\015\012The Input value of the DisplayApplicationsInUseL : ")); - iOutFile.Write(text); - iOutFile.Write(aData8); - */ - iResult.ApplicationsInUseResult = EFalse; - } - } - break; - case EDisplayQuestion: - if ( iLevel2 == EReturn ) - { - if ( aData8.Compare(KTrueValue) == KErrNone ) - { - /* - TBuf8 text; - text.Format(_L8 ("\015\012The Input value of the DisplayQuestionL : ")); - iOutFile.Write(text); - iOutFile.Write(aData8); - */ - iResult.QuestionResult = ETrue; - } - else if ( aData8.Compare(KFalseValue) == KErrNone ) - { - /* - TBuf8 text; - text.Format(_L8 ("\015\012The Input value of the DisplayQuestionL : ")); - iOutFile.Write(text); - iOutFile.Write(aData8); - */ - iResult.QuestionResult = EFalse; - } - } - break; - case EDisplayMissingDependency: - if (iLevel2 == EReturn) - { - if (aData8.Compare(KTrueValue)==KErrNone) - { - INFO_PRINTF1(_L("DisplayMissingDependencyL will return ETrue")); - iResult.MissingDependencyResult = ETrue; - } - else if ( aData8.Compare(KFalseValue) == KErrNone ) - { - INFO_PRINTF1(_L("DisplayMissingDependencyL will return EFalse")); - iResult.MissingDependencyResult = EFalse; - } - } - break; - default: - break; - } - } - -void CRebuildingContentHandler::OnStartPrefixMappingL(const RString& /*aPrefix*/, - const RString& /*aUri*/, TInt aErrorCode) - { - User::LeaveIfError(aErrorCode); - } - -void CRebuildingContentHandler::OnEndPrefixMappingL(const RString& /*aPrefix*/, - TInt aErrorCode) - { - User::LeaveIfError(aErrorCode); - } - -void CRebuildingContentHandler::OnIgnorableWhiteSpaceL(const TDesC8& /*aBytes*/, - TInt /*aErrorCode*/) - { - } - -void CRebuildingContentHandler::OnSkippedEntityL(const RString& /*aName*/, - TInt /*aErrorCode*/) - { - } - -void CRebuildingContentHandler::OnProcessingInstructionL(const TDesC8& /*aTarget8*/, - const TDesC8& /*aData8*/, TInt aErrorCode) - { - User::LeaveIfError(aErrorCode); - } - -void CRebuildingContentHandler::OnExtensionL(const RString& /*aData*/, - TInt /*aToken*/, TInt /*aErrorCode*/) - { - /* - _LIT(KUnsupportedFeature,"Illegal call to TRebuildingContentHandler:: \ - OnExtensionL - aborting\n"); - test.Panic(KErrNotSupported, KUnsupportedFeature); - */ - } - -void CRebuildingContentHandler::OnOutOfData() - { - //_LIT(KUnexpectedOutOfData,"Unexpected call to OnOutOfData - aborting\n"); - } - -void CRebuildingContentHandler::OnError(TInt aError) - { - iError = aError; -// test.Printf(_L("TRebuildingContentHandler::OnError - ERROR: code=%d - \ -// Aborting parsing process\n"), aError); - } - -TAny* CRebuildingContentHandler::GetExtendedInterface(const TInt32) - { - return NULL; - } - - -TXmlFileData& CRebuildingContentHandler::GetOptions() - { - return iResult; - } - -// CUISCriptAdaptor functions -void CUIScriptAdaptor::DialogReached() - { - - if ((iDialogDelay.Int() != 0) && - (iDelayDialogNumber < 0 || iDelayDialogNumber == iCurrentDialogNumber)) - { - // We need to make sure that (un)installation is not too quick, - // otherwise the async cancel tests will fail. - User::After(iDialogDelay); - } - - if ((iCurrentDialogNumber++ == iCancelDialogNumber) && - (iDialogCancelType == ECancelFromDialog || - iDialogCancelType == ECancelAfterDialog)) - { - iInstallationCancelled=ETrue; - // Cancel the installation - - if (iDialogCancelType == ECancelFromDialog) - { - if(iCancelHandler) - { - INFO_PRINTF1(_L("Canceling via CancellableInstallEvent callback")); - iCancelHandler->HandleCancel(); - } - else - { - INFO_PRINTF1(_L("Cancelling via static Cancel API")); - Launcher::Cancel(); - } - } - else - { - // Cancelling after a dialog is done for the async install - // and uninstall steps. Stopping the active scheduler will let - // CSwisAsyncStep::RunOperation start a cancel delay timer, and - // the cancel will actually be invoked when the timer expires. - // The install or uninstall will carry on until this happens. - INFO_PRINTF1(_L("Calling CActiveScheduler::Stop()")); - CActiveScheduler::Stop(); - } - } - - if (iCurrentDialogNumber > iCancelDialogNumber && - (iDialogCancelType == ECancelFromDialog || - iDialogCancelType == ECancelAfterDialog)) - { - ERR_PRINTF3(_L("Reached an unexpected dialog. Dialogs expected: %d, dialog reached: %d"), iCancelDialogNumber, iCurrentDialogNumber); - } - } - - -void CUIScriptAdaptor::DisplayAppInfo(const TDesC& aPreText, const CAppInfo& aAppInfo) - { - INFO_PRINTF7(_L("\t%S {\"%S\", \"%S\", V%u.%u.%u}"), - &aPreText, - &aAppInfo.AppName(), &aAppInfo.AppVendor(), - aAppInfo.AppVersion().iMajor, - aAppInfo.AppVersion().iMinor, - aAppInfo.AppVersion().iBuild); - } - -void CUIScriptAdaptor::DisplayBoolReturn(TBool aReturn) - { - _LIT(KTrue, "True"); - _LIT(KFalse, "False"); - INFO_PRINTF2(_L("\tReturning %S"), aReturn ? &KTrue : &KFalse); - } - -void CUIScriptAdaptor::DisplayIntReturn(TInt aReturn) - { - INFO_PRINTF2(_L("\tReturning %d"), aReturn); - } - -void CUIScriptAdaptor::CheckFinalProgressBarL() - { - if (iProgressBarCurrent != iProgressBarFinal) - { - INFO_PRINTF3(_L("\tProgress for installation not finished %d out of %d"), iProgressBarCurrent, iProgressBarFinal); - User::Leave(KErrAbort); - } - } - -void CUIScriptAdaptor::CheckExpectedAndCalculatedInstallSizesL(const TDesC& aAppInfoName, TInt64 aSize) - { - TInt i=0; - TBool foundExpectedInstallSize = EFalse; - - RArray arrayOfExpectedValues = *iExpectedValue; - - while ((!foundExpectedInstallSize) && (i& aCertificates) - { - INFO_PRINTF1(_L("DisplayInstallL():")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - TInt bootMode = 0; - User::LeaveIfError(RProperty::Get(KUidSystemCategory, KSystemStartupModeKey, bootMode)); - (void) aLogo; - if (aCertificates.Count()) - { - INFO_PRINTF2(_L("\tCertificate(s): %u"),aCertificates.Count()); - for (TInt i=0; iSubjectName(), - &aCertificates[i]->IssuerName()); - - TTime validFrom(aCertificates[i]->ValidFrom()); - TTime validTo(aCertificates[i]->ValidTo()); - TBuf validFromBuf, validToBuf; - validFrom.FormatL(validFromBuf, TLongDateFormatSpec()); - validTo.FormatL(validToBuf, TLongDateFormatSpec()); - INFO_PRINTF3(_L("\t ValidFrom: \"%S\", ValidTo: \"%S\""), - &validFromBuf, &validToBuf); - } - } - - LeaveError(KDisplayInstall1); - DialogReached(); - DisplayBoolReturn(iResult.InstallResult); - return iResult.InstallResult; - } - -TBool CUIScriptAdaptor::DisplayGrantCapabilitiesL(const CAppInfo& aAppInfo, - const TCapabilitySet& aCapabilitySet) - { - iGrantUserCapsDialogCalled=ETrue; - - INFO_PRINTF1(_L("DisplayGrantCapabilitiesL():")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - - // Build requested capabilities string. - const TInt KMaxBufSize=512; // should be enough for all capability names - const TInt KMaxCapName=64; // should be enough for one capability name - _LIT(KSpace," "); - HBufC* buf=HBufC::NewLC(KMaxBufSize); - TPtr p=buf->Des(); - TInt capsAppended=0; - TBuf8 capName8; - TBuf capName; - - for (TInt i=0; i(i))) - { - if (capsAppended) - p.Append(KSpace); - capName8=reinterpret_cast(CapabilityNames[i]); - capName.Copy(capName8); - p.Append(capName); - capsAppended++; - } - } - - INFO_PRINTF2(_L("\tRequesting capabilities: %S"),&p); - CleanupStack::PopAndDestroy(buf); - - DialogReached(); - DisplayBoolReturn(iResult.CapabilitiesResult); - return iResult.CapabilitiesResult; - } - - -TInt CUIScriptAdaptor::DisplayLanguageL(const CAppInfo& aAppInfo, - const RArray& aLanguages) - { - INFO_PRINTF1(_L("DisplayLanguageL():")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - - HBufC* languages=HBufC::NewLC(1024); - TPtr pLanguages(languages->Des()); - - for (TInt i=0; i < aLanguages.Count();) - { - pLanguages.AppendFormat(_L("%S"), &KLanguageTable[aLanguages[i]]); - if (++i >= aLanguages.Count()) - break; - pLanguages.Append(_L(", ")); - } - INFO_PRINTF2(_L("\tLanguages: %S"), &pLanguages); - CleanupStack::PopAndDestroy(languages); - - LeaveError(KDisplayLanguage1); - DialogReached(); - DisplayIntReturn(iResult.LanguagesResult); - return iResult.LanguagesResult; - } - - -TInt CUIScriptAdaptor::DisplayDriveL(const CAppInfo& aAppInfo, - TInt64 aSize,const RArray& aDriveLetters, - const RArray& aDriveSpaces) - { - iDisplayDriveDialogCalled = ETrue; - INFO_PRINTF1(_L("DisplayDriveL():")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - - HBufC* drives=HBufC::NewLC(1024); - TPtr pDrives(drives->Des()); - TInt letter; - for (TInt i=0; i < aDriveLetters.Count();) - { - letter = aDriveLetters[i]; - pDrives.AppendFormat(_L("%c"),letter); - pDrives.AppendFormat(_L(" (%U bytes)"), I64LOW(aDriveSpaces[i])); - if (++i >= aDriveLetters.Count()) - break; - pDrives.Append(_L(", ")); - } - INFO_PRINTF2(_L("\tDrives: %S"), &pDrives); - CleanupStack::PopAndDestroy(drives); - - // If the test case contains information about expected install sizes, - // then compare them against the calculated install size. Otherwise, - // just print out the calculated install size. - if (iExpectedValue != NULL) - { - CheckExpectedAndCalculatedInstallSizesL(aAppInfo.AppName(), aSize); - } - else - { - INFO_PRINTF2(_L("\tSize: %d"), I64LOW(aSize)); - } - - LeaveError(KDisplayDrive1); - DialogReached(); - - // Drive result is the drive we want to return so we need to go through the list - // looking for it - for (TInt i=0; i < aDriveLetters.Count() ; ++i) - { - if (TChar(iResult.DriveResult+'a') == TChar(aDriveLetters[i]).GetLowerCase()) - { - DisplayIntReturn(i); - return i; - } - } - - DisplayIntReturn(-1); - return -1; // Could not find drive we want, cancelling installation - } - - -TBool CUIScriptAdaptor::DisplayUpgradeL(const CAppInfo& aAppInfo, - const CAppInfo& aExistingAppInfo) - { - INFO_PRINTF1(_L("DisplayUpgradeL():")); - DisplayAppInfo(_L("From App:"), aExistingAppInfo); - DisplayAppInfo(_L("To App:"), aAppInfo); - LeaveError(KDisplayUpgrade1); - DialogReached(); - DisplayBoolReturn(iResult.UpgradeResult); - return iResult.UpgradeResult; - } - -TBool CUIScriptAdaptor::DisplayOptionsL(const CAppInfo& aAppInfo, - const RPointerArray& aOptions, - RArray& aSelections) - { - INFO_PRINTF1(_L("DisplayOptionsL():")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - - HBufC* options=HBufC::NewLC(4096); - TPtr pOptions(options->Des()); - - for (TInt i=0; i < aOptions.Count();) - { - pOptions.AppendFormat(_L("%S"), aOptions[i]); - - if (i >= iResult.OptionSelection.Count()) - { - pOptions.Append(_L(" (?)")); - } - else if (iResult.OptionSelection[i]) - { - pOptions.Append(_L(" (*)")); - } - else - { - pOptions.Append(_L(" ( )")); - } - - if (++i >= aOptions.Count()) - break; - pOptions.Append(_L(", ")); - } - INFO_PRINTF2(_L("\tOptions: %S"), &pOptions); - CleanupStack::PopAndDestroy(options); - - TInt count = iResult.OptionSelection.Count(); - for (TInt index=0; index < count; index++) - { - aSelections[index]=iResult.OptionSelection[index]; - } - LeaveError(KDisplayOptions1); - DialogReached(); - DisplayBoolReturn(iResult.OptionsResult); - return iResult.OptionsResult; - } - -TBool CUIScriptAdaptor::HandleInstallEventL( - const CAppInfo& aAppInfo, - TInstallEvent aEvent, - TInt aValue, - const TDesC& aDes) - { - INFO_PRINTF1(_L("HandleInstallEventL")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - - TBool ret(ETrue); - // update progress - // We shouldn't cancel on the last dialog, since installation/uninstallation has - // finished, and the tests will fail due to cancellation being flagged, but the - // installation/uninstallation completing with no error, as expected. - switch (aEvent) - { - case EEventSetProgressBarFinalValue: - INFO_PRINTF2(_L("\tEvent:\tEEventSetProgressBarFinalValue %d"), aValue); - - // Keep track of progress bar values - iProgressBarFinal=aValue; - iProgressBarCurrent=0; - LeaveError(KInstallEvenDialogSetProgressBar); - DialogReached(); - ret = iResult.ProgressBarFinalValueResult; - break; - - case EEventUpdateProgressBar: - // Keep track of progress bar values - iProgressBarCurrent+=aValue; - INFO_PRINTF4(_L("\tEvent:\tEEventUpdateProgressBar %d - %d/%d"), aValue, iProgressBarCurrent, iProgressBarFinal); - LeaveError(KInstallEvenDialogUpdateProgressBar); - DialogReached(); - ret = iResult.UpdateProgressBarResult; - break; - - case EEventAbortedInstall: - INFO_PRINTF1(_L("\tEvent:\tEEventAbortedInstall")); - break; - - case EEventCompletedInstall: - INFO_PRINTF1(_L("\tEvent:\tEEventCompletedInstall")); - LeaveError(KInstallEvenDialogCompletedInstall); - CheckFinalProgressBarL(); - break; - - case EEventOcspCheckEnd: - INFO_PRINTF1(_L("\tEvent:\tEEventOcspCheckEnd")); - LeaveError(KInstallEvenDialogOcspCheckEnd); - DialogReached(); - break; - - case EEventCompletedNoMessage: - INFO_PRINTF1(_L("\tEvent:\tEEventCompletedNoMessage")); - break; - - case EEventAbortedUnInstall: - INFO_PRINTF1(_L("\tEvent:\tEEventAbortedUnInstall")); - break; - - case EEventCompletedUnInstall: - INFO_PRINTF1(_L("\tEvent:\tEEventCompletedUnInstall")); - LeaveError(KInstallEvenDialogCompletedUnInstall); - CheckFinalProgressBarL(); - break; - - case EEventLeave: - INFO_PRINTF2(_L("\tEvent:\tEEventLeave %d"), aValue); - INFO_PRINTF1(_L("\tEvent:\tEEventCompletedUnInstall")); - DialogReached(); - break; - - case EEventDevCert: - INFO_PRINTF2(_L("\tEvent:\tEEventDevCert %S"), &aDes); - LeaveError(KInstallEvenDevCert); - DialogReached(); - ret=iResult.DevCertsResult; - break; - - default: - INFO_PRINTF4(_L("\tResult:\tUnknown (%d) Value: %d Des %S"), aEvent, aValue, &aDes); - ASSERT(false); - } - - return ret; - } - -void CUIScriptAdaptor::HandleCancellableInstallEventL( - const CAppInfo& aAppInfo, - TInstallCancellableEvent aEvent, - MCancelHandler& aCancelHandler, - TInt aValue, - const TDesC& aDes) - { - iCancelHandler = &aCancelHandler; - - INFO_PRINTF1(_L("HandleCancellableInstallEventL")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - - switch (aEvent) - { - case EEventRemovingFiles: - INFO_PRINTF1(_L("\tEvent:\tEEventRemovingFiles")); - LeaveError(KCancelInstallRemoving); - break; - case EEventShuttingDownApps: - INFO_PRINTF1(_L("\tEvent:\tEEventShuttingDownApps")); - LeaveError(KCancelInstallShuttingDown); - break; - case EEventCopyingFiles: - INFO_PRINTF1(_L("\tEvent:\tEEventCopyingFiles")); - LeaveError(KCancelInstallCopyingFiles); - break; - case EEventOcspCheckStart: - INFO_PRINTF1(_L("\tEvent:\tEEventOcspCheckStart")); - LeaveError(KCancelInstallOcspCheckStart); - break; - - default: - INFO_PRINTF4(_L("\tEvent:\tUnknown (%d) Value: %d Des %S"), aEvent, aValue, &aDes); - } - DialogReached(); - } - -TBool CUIScriptAdaptor::DisplaySecurityWarningL( - const CAppInfo& aAppInfo, - TSignatureValidationResult aSigValidationResult, - RPointerArray& /*aPkixResults*/, - RPointerArray& /*aCertificates*/, - TBool aInstallAnyway) - { - _LIT(KTrue, "True"); - _LIT(KFalse, "False"); - - INFO_PRINTF1(_L("DisplaySecurityWarningL():")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - - switch (aSigValidationResult) - { - case EValidationSucceeded: - INFO_PRINTF1(_L("\tResult:\tEValidationSucceeded")); - break; - case ESignatureSelfSigned: - INFO_PRINTF1(_L("\tResult:\tESignatureSelfSigned")); - break; - case ENoCertificate: - INFO_PRINTF1(_L("\tResult:\tENoCertificate")); - break; - case ECertificateValidationError: - INFO_PRINTF1(_L("\tResult:\tECertificateValidationError")); - break; - case ESignatureNotPresent: - INFO_PRINTF1(_L("\tResult:\tESignatureNotPresent")); - break; - case ESignatureCouldNotBeValidated: - INFO_PRINTF1(_L("\tResult:\tESignatureCouldNotBeValidated")); - break; - case ENoCodeSigningExtension: - INFO_PRINTF1(_L("\tResult:\tENoCodeSigningExtension")); - break; - case ENoSupportedPolicyExtension: - INFO_PRINTF1(_L("\tResult:\tENoSupportedPolicyExtension")); - break; - case EMandatorySignatureMissing: - INFO_PRINTF1(_L("\tResult:\tEMandatorySignatureMissing")); - break; - default: - INFO_PRINTF2(_L("\tResult:\tUnknown (%d)"), aSigValidationResult); - break; - }; - - LeaveError(KDisplaySecurityWarning1); - DialogReached(); - - ++iSecurityWarningDialogsInvoked; - - INFO_PRINTF3( - _L("\tReturning %S (override possible: %S)"), - iResult.WarningResult ? &KTrue : &KFalse, - aInstallAnyway ? &KTrue : &KFalse); - return iResult.WarningResult; - } - -TBool CUIScriptAdaptor::DisplayOcspResultL(const CAppInfo& aAppInfo, - TRevocationDialogMessage aMessage, - RPointerArray& aOutcomes, - RPointerArray& aCertificates, - TBool aWarningOnly) - { - INFO_PRINTF1(_L("DisplayOcspResultL():")); - INFO_PRINTF6(_L("\t App: { \"%S\" \"%S\" V%u.%u.%u }"),&aAppInfo.AppName(), - &aAppInfo.AppVendor(),aAppInfo.AppVersion().iMajor, - aAppInfo.AppVersion().iMinor,aAppInfo.AppVersion().iBuild); - INFO_PRINTF2(_L("\t Msg: %u"),aMessage); - TInt numCerts=aCertificates.Count(); - TInt numOutcomes=aOutcomes.Count(); - INFO_PRINTF3(_L("\tCerts: %u, outcomes: %u"),numCerts,numOutcomes); - - if (numCerts != numOutcomes) - { - ERR_PRINTF1(_L("\tMismatched certs and outcomes arrays!")); - User::Leave(KErrArgument); - } - - for (TInt i=0; iSubjectName()); - } - - iObservedOcspOutcomes.ResetAndDestroy(); - for (TInt i=0; iiStatus, - aOutcomes[i]->iResult); - TOCSPOutcome* outcome = new(ELeave) TOCSPOutcome(*aOutcomes[i]); - CleanupStack::PushL(outcome); - iObservedOcspOutcomes.AppendL(outcome); - CleanupStack::Pop(outcome); - } - - _LIT(KYes,"Yes"); - _LIT(KNo,"No"); - INFO_PRINTF2(_L("\tFatal: %S"), aWarningOnly ? &KNo : &KYes); - - if (! aWarningOnly) - { - iFatalOcspResponseEncountered = ETrue; - } - - LeaveError(KDisplayOcspResult1); - DialogReached(); - DisplayBoolReturn(iResult.OcspResult); - return iResult.OcspResult; - } - -void CUIScriptAdaptor::DisplayCannotOverwriteFileL(const CAppInfo& aAppInfo, - const CAppInfo& aInstalledAppInfo, - const TDesC& aFileName) - { - iCannotOverwriteFileDialogCalled = ETrue; - iFileOwner = aInstalledAppInfo.AppName().AllocL(); - INFO_PRINTF1(_L("DisplayCannotOverwriteFileL():")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - - INFO_PRINTF2(_L("\tFile : %S"), &aFileName); - LeaveError(KDisplayCannotOverwriteFile1); - DisplayAppInfo(_L("From App:"), aInstalledAppInfo); - DialogReached(); - } - -TBool CUIScriptAdaptor::DisplayUninstallL(const CAppInfo& aAppInfo) - { - INFO_PRINTF1(_L("DisplayUninstallL():")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - LeaveError(KDisplayUninstall1); - DialogReached(); - DisplayBoolReturn(iResult.UninstallResult); - return iResult.UninstallResult; - } - -TBool CUIScriptAdaptor::DisplayTextL(const CAppInfo& aAppInfo, - TFileTextOption aOption, const TDesC& aText) - { - INFO_PRINTF1(_L("DisplayTextL():")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - - switch (aOption) - { - case EInstFileTextOptionContinue: - INFO_PRINTF1(_L("\tOption:\tEInstFileTextOptionContinue")); - break; - case EInstFileTextOptionSkipOneIfNo: - INFO_PRINTF1(_L("\tOption:\tEInstFileTextOptionSkipOneIfNo")); - break; - case EInstFileTextOptionAbortIfNo: - INFO_PRINTF1(_L("\tOption:\tEInstFileTextOptionAbortIfNo")); - break; - case EInstFileTextOptionExitIfNo: - INFO_PRINTF1(_L("\tOption:\tEInstFileTextOptionExitIfNo")); - break; - - default: - INFO_PRINTF2(_L("Option: Unknown (%d)"), aOption); - } - - INFO_PRINTF2(_L("Text: \"%S\""), &aText); - - // Record the displayed text so it can be compared with the - // ExpectedDisplayText configuration value later - iDisplayedText = aText.Left(Min(KMaxDisplayText, aText.Length())); - iDisplayedText.TrimRight(); - - // Record the displayed text (unchanged) so it can be compared with the - // contents of a text file - iDisplayedTextActual = HBufC16::NewL(aText.Length()); - *iDisplayedTextActual = aText; - - LeaveError(KDisplayText1); - DialogReached(); - DisplayBoolReturn(iResult.TextResult); - return iResult.TextResult; - } - -void CUIScriptAdaptor::DisplayErrorL(const CAppInfo& aAppInfo, - TErrorDialog aType, const TDesC& aDes) - { - INFO_PRINTF1(_L("DisplayErrorL():")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - - switch (aType) - { - case EUiAlreadyInRom: - INFO_PRINTF2(_L("\tError:\tEUiAlreadyInRom file=%S"), &aDes); - break; - case EUiBlockingEclipsingFile: - INFO_PRINTF2(_L("\tError:\tEUiBlockingEclipsingFile %S"), &aDes); - break; - case EUiMissingDependency: - INFO_PRINTF1(_L("\tError:\tEUiMissingDependency")); - break; - case EUiRequireVer: - INFO_PRINTF1(_L("\tError:\tEUiRequireVer")); - break; - case EUiRequireVerOrGreater: - INFO_PRINTF1(_L("\tError:\tEUiRequireVerOrGreater")); - break; - case EUiFileCorrupt: - INFO_PRINTF1(_L("\tError:\tEUiFileCorrupt")); - break; - case EUiDiskNotPresent: - INFO_PRINTF1(_L("\tError:\tEUiDiskNotPresent")); - break; - case EUiCannotRead: - INFO_PRINTF1(_L("\tError:\tEUiCannotRead")); - break; - case EUiCannotDelete: - INFO_PRINTF1(_L("\tError:\tEUiCannotDelete")); - break; - case EUiInvalidFileName: - INFO_PRINTF1(_L("\tError:\tEUiInvalidFileName")); - break; - case EUiFileNotFound: - INFO_PRINTF1(_L("\tError:\tEUiFileNotFound")); - break; - case EUiInsufficientSpaceOnDrive: - INFO_PRINTF1(_L("\tError:\tEUiInsufficientSpaceOnDrive")); - break; - case EUiCapabilitiesCannotBeGranted: - INFO_PRINTF2(_L("\tError:\tEUiCapabilitiesCannotBeGranted %S"), &aDes); - break; - case EUiUnknownFile: - INFO_PRINTF1(_L("\tError:\tEUiUnknownFile")); - break; - case EUiMissingBasePackage: - INFO_PRINTF1(_L("\tError:\tEUiMissingBasePackage")); - break; - case EUiConstraintsExceeded: - INFO_PRINTF1(_L("\tError:\tEUiConstraintsExceeded")); - break; - case EUiSIDViolation: - INFO_PRINTF1(_L("\tError:\tEUiSIDViolation")); - break; - case EUiVIDViolation: - INFO_PRINTF1(_L("\tError:\tEUiVIDViolation")); - break; - case EUiUIDPackageViolation: - INFO_PRINTF1(_L("\tError:\tEUiUIDPackageViolation")); - break; - case EUiSIDMismatch: - INFO_PRINTF1(_L("\tError:\tEUiSIDMismatch")); - break; - default: - INFO_PRINTF3(_L("\tError:\tUnknown (%d) Des %S"), aType, &aDes); - }; - - LeaveError(KDisplayError1); - DialogReached(); - } - -TBool CUIScriptAdaptor::DisplayDependencyBreakL(const CAppInfo& aAppInfo, - const RPointerArray& aComponents) - { - INFO_PRINTF1(_L("DisplayDependencyBreakL():")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - - HBufC* components=HBufC::NewLC(1024); - TPtr pComponents(components->Des()); - - for (TInt i=0; i < aComponents.Count();) - { - pComponents.AppendFormat(_L("%S"), aComponents[i]); - if (++i >= aComponents.Count()) - break; - pComponents.Append(_L(", ")); - } - INFO_PRINTF2(_L("\tComponents: %S"), &pComponents); - CleanupStack::PopAndDestroy(components); - - LeaveError(KDisplayDependencyBreak1); - DialogReached(); - DisplayBoolReturn(iResult.DependencyResult); - return iResult.DependencyResult; - } - -TBool CUIScriptAdaptor::DisplayApplicationsInUseL(const CAppInfo& aAppInfo, - const RPointerArray& aAppNames) - { - INFO_PRINTF1(_L("DisplayApplicationsInUseL():")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - - HBufC* applications=HBufC::NewLC(1024); - TPtr pApplications(applications->Des()); - - for (TInt i=0; i < aAppNames.Count();) - { - pApplications.AppendFormat(_L("%S"), aAppNames[i]); - if (++i >= aAppNames.Count()) - break; - pApplications.Append(_L(", ")); - } - INFO_PRINTF2(_L("\tComponents: %S"), &pApplications); - CleanupStack::PopAndDestroy(applications); - - LeaveError(KDisplayApplicationsInUse1); - DialogReached(); - DisplayBoolReturn(iResult.ApplicationsInUseResult); - return iResult.ApplicationsInUseResult; - } - -TBool CUIScriptAdaptor::DisplayQuestionL(const CAppInfo& aAppInfo, - TQuestionDialog aQuestion, const TDesC& aDes) - { - INFO_PRINTF1(_L("DisplayQuestionL():")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - - switch (aQuestion) - { - case EQuestionIncompatible: - INFO_PRINTF1(_L("\tQuestion:\tEQuestionIncompatible")); - break; - - case EQuestionOverwriteFile: - INFO_PRINTF1(_L("\tQuestion:\tEQuestionOverwriteFile")); - INFO_PRINTF2(_L("\tFile Name:\t%S"), &aDes); - break; - - default: - INFO_PRINTF3(_L("\tQuestion:\tUnknown (%d) Des %S"), aQuestion, &aDes); - } - - LeaveError(KDisplayQuestion1); - DialogReached(); - DisplayBoolReturn(iResult.QuestionResult); - return iResult.QuestionResult; - } - - -TBool CUIScriptAdaptor::DisplayMissingDependencyL(const CAppInfo& aAppInfo, - const TDesC& aDependencyName,TVersion aWantedVersionFrom, - TVersion aWantedVersionTo,TVersion aInstalledVersion) - { - INFO_PRINTF1(_L("DisplayMissingDependencyL():")); - DisplayAppInfo(_L("AppInfo:"), aAppInfo); - - INFO_PRINTF2(_L("\tMissing dependency name: %S"),&aDependencyName); - INFO_PRINTF7(_L("\t Wanted version: %u.%u.%u - %u.%u.%u"), - aWantedVersionFrom.iMajor,aWantedVersionFrom.iMinor, - aWantedVersionFrom.iBuild, - aWantedVersionTo.iMajor,aWantedVersionTo.iMinor, - aWantedVersionTo.iBuild); - INFO_PRINTF4(_L("\t Existing version: %u.%u.%u"), - aInstalledVersion.iMajor,aInstalledVersion.iMinor, - aInstalledVersion.iBuild); - - LeaveError(KDisplayMissingDependency1); - DialogReached(); - DisplayBoolReturn(iResult.MissingDependencyResult); - return iResult.MissingDependencyResult; - } -void CUIScriptAdaptor::LeaveError(TInt aReason) - { - if (iExpectedDialog == aReason) - { - User::Leave(iKerrCode); - } - } diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_install/tuiscriptadaptors.h --- a/authorisation/userpromptservice/test/tups_install/tuiscriptadaptors.h Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,448 +0,0 @@ -/* -* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __TUISCRIPTADAPATORS_H__ -#define __TUISCRIPTADAPATORS_H__ - -#include -#include -#include -#include -#include - - -class TTableOfInstallSizes - { -public: - TBuf<64> iPkgFileName; - TInt iInstallSize; - }; - -namespace Swi -{ -namespace Test -{ -const TInt KBufSize = 5; - -enum TFunctions{ - EScript = 0, - EDisplayInstall, - EDisplayGrantCapabilities, - EDisplayLanguage, - EDisplayDrive, - EDisplayUpgrade, - EDisplayOptions, - EHandleInstallEvent, - EHandleCancellableInstallEvent, - EDisplaySecurityWarning, - EDisplayOcspResult, - EDisplayCannotOverwriteFile, - EDisplayUninstall, - EDisplayText, - EDisplayError, - EDisplayDependencyBreak, - EDisplayApplicationsInUse, - EDisplayQuestion, - EDisplayMissingDependency, - EDisplaySIDMismatch, -}; - -enum TLeveltags{ - EItemIndex =1, - EReturn, - EUpdateProgress, - EUpdateProgressFinal -}; - -enum TSwiCancelType{ - ENoCancel, - ECancelTimerFromStart, - ECancelFromDialog, - ECancelAfterDialog -}; - - -/** - * Structure to hold the parsed value of the XML file. - */ -struct TXmlFileData { - TBool InstallResult; - TBool CapabilitiesResult; - TInt LanguagesResult; - TInt DriveResult; - TBool UpgradeResult; - TBool OptionsResult; - RArray< TBool > OptionSelection; - TBool WarningResult; - TBool OcspResult; - TBool UninstallResult; - TBool TextResult; - TBool DependencyResult; - TBool ApplicationsInUseResult; - TBool QuestionResult; - TBool MissingDependencyResult; - TBool DevCertsResult; - TBool UpdateProgressBarResult; - TBool ProgressBarFinalValueResult; - - TXmlFileData(); -}; - -/** - * This class defines the interface required by a client of the xml framework. - * It allows a client to be placed in a chain with other clients, i.e. a Parser, - * a Validator, or a User, and therefore allows the flow of information between - * these links. - */ -class CRebuildingContentHandler : public CBase, public Xml::MContentHandler - { -public: - static CRebuildingContentHandler* NewL(CTestExecuteLogger& aLogger); - static CRebuildingContentHandler* NewLC(CTestExecuteLogger& aLogger); - ~CRebuildingContentHandler(); - void OnStartDocumentL(const Xml::RDocumentParameters& aDocParam, TInt aErrorCode); - void OnEndDocumentL(TInt aErrorCode); - void OnStartElementL(const Xml::RTagInfo& aElement, const Xml::RAttributeArray& aAttributes, TInt aErrorCode); - void OnEndElementL(const Xml::RTagInfo& aElement, TInt aErrorCode); - void OnContentL(const TDesC8& aBytes, TInt aErrorCode); - void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri, TInt aErrorCode); - void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode); - void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode); - void OnSkippedEntityL(const RString& aName, TInt aErrorCode) ; - void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData, TInt aErrorCode); - void OnExtensionL(const RString& aData, TInt aToken, TInt aErrorCode); - void OnOutOfData(); - void OnError(TInt aErrorCode); - TAny* GetExtendedInterface(const TInt32 aUid); - TXmlFileData& GetOptions(); - -public: - TInt iError; - -private: - CRebuildingContentHandler(CTestExecuteLogger& aLogger); - - CTestExecuteLogger& Logger(); - TXmlFileData iResult; - CTestExecuteLogger& iLogger; - TInt iLevel1; - TInt iLevel2; - TInt iLevel3; - TBool iLangLogged; ///< Has language dialog result been logged? - TBool iDriveLogged; ///< Has drive dialog result been logged? - TBool iSecWarnLogged; ///< Has security warning result been logged? - }; - -inline CTestExecuteLogger& CRebuildingContentHandler::Logger() - { - return iLogger; - } - -/** - When the FT option is used to display a dialog, up to this - many characters are recorded from the displayed string. They - can be compared with the text specified in ExpectedDisplayText - if it is in the ini file. - */ -const TInt KMaxDisplayText = 32; - -class CUIScriptAdaptor : public CBase, public MUiHandler - { -public: - ~CUIScriptAdaptor(); - static CUIScriptAdaptor* NewL(const TFileName& aXmlFileName, - CTestExecuteLogger& aLogger, RArray* aExpectedValue = NULL); - static CUIScriptAdaptor* NewLC(const TFileName& aXmlFileName, - CTestExecuteLogger& aLogger, RArray* aExpectedValue = NULL); - static CUIScriptAdaptor* NewL(const TFileName& aXmlFileName, - CTestExecuteLogger& aLogger, TPtrC aExpectedText,TPtrC aTextIsHash, TInt aExpectedDialog, TInt aKerrCode); - static CUIScriptAdaptor* NewLC(const TFileName& aXmlFileName, - CTestExecuteLogger& aLogger, TPtrC aExpectedText,TPtrC aTextIsHash, TInt aExpectedDialog, TInt aKerrCode); - - /// Displays install dialog, logging all incoming information. - TBool DisplayInstallL(const CAppInfo& aAppInfo, - const CApaMaskedBitmap* aLogo, - const RPointerArray& aCertificates); - - TBool DisplayGrantCapabilitiesL(const CAppInfo& aAppInfo, - const TCapabilitySet& aCapabilitySet); - - TInt DisplayLanguageL(const CAppInfo& aAppInfo, - const RArray& aLanguages); - - TInt DisplayDriveL(const CAppInfo& aAppInfo,TInt64 aSize, - const RArray& aDriveLetters, - const RArray& aDriveSpaces); - - TBool DisplayUpgradeL(const CAppInfo& aAppInfo, - const CAppInfo& aExistingAppInfo); - - TBool DisplayOptionsL(const CAppInfo& aAppInfo, - const RPointerArray& aOptions, - RArray& aSelections); - - TBool HandleInstallEventL(const CAppInfo& aAppInfo, - TInstallEvent aEvent, TInt aValue=0, - const TDesC& aDes=KNullDesC); - - void HandleCancellableInstallEventL(const CAppInfo& aAppInfo, - TInstallCancellableEvent aEvent, - MCancelHandler& aCancelHandler,TInt aValue=0, - const TDesC& aDes=KNullDesC); - - TBool DisplaySecurityWarningL(const CAppInfo& aAppInfo, - TSignatureValidationResult aSigValidationResult, - RPointerArray& aPkixResults, - RPointerArray& aCertificates, - TBool aInstallAnyway); - - TBool DisplayOcspResultL(const CAppInfo& aAppInfo, - TRevocationDialogMessage aMessage, - RPointerArray& aOutcomes, - RPointerArray& aCertificates, - TBool aWarningOnly); - - void DisplayCannotOverwriteFileL(const CAppInfo& aAppInfo, - const CAppInfo& aInstalledAppInfo, - const TDesC& aFileName); - - TBool DisplayUninstallL(const CAppInfo& aAppInfo); - - TBool DisplayTextL(const CAppInfo& aAppInfo, - TFileTextOption aOption, - const TDesC& aText); - - void DisplayErrorL(const CAppInfo& aAppInfo, - TErrorDialog aType, - const TDesC& aParam); - - TBool DisplayDependencyBreakL(const CAppInfo& aAppInfo, - const RPointerArray& aComponents); - - TBool DisplayApplicationsInUseL(const CAppInfo& aAppInfo, - const RPointerArray& aAppNames); - - TBool DisplayQuestionL(const CAppInfo& aAppInfo, - TQuestionDialog aQuestion, const TDesC& aDes=KNullDesC); - - TBool DisplayMissingDependencyL(const CAppInfo& aAppInfo, - const TDesC& aDependencyName,TVersion aWantedVersionFrom, - TVersion aWantedVersionTo,TVersion aInstalledVersion); - - // functions to handle displaying info to file - void DisplayAppInfo(const TDesC& aPreText, const CAppInfo& aAppInfo); - void DisplayBoolReturn(TBool aReturn); - void DisplayIntReturn(TInt aReturn); - - // function to check progress bar - void CheckFinalProgressBarL(); - - // Function that aborts a test case when the expected - // installation size does not match the calculated size. - void CheckExpectedAndCalculatedInstallSizesL(const TDesC& aAppInfoName, TInt64 aSize); - - // function to check if the "Display Drive" dialog have been called - TBool DisplayDriveDialogCalled() const; - - // function to check the "Grant Capabilities" dialog has been called - TBool GrantUserCapsDialogCalled() const; - - // function to check the "CannotOverwrite" dialog has been called - TBool CannotOverwriteFileDialogCalled() const; - - // function to check the "file owner" name in the CannotOverwrite dialog. - const TDesC& FileOwner() const; - - // function to check whether a fatal OCSP response was encountered - TBool FatalOcspResponseEncountered() const; - - //Function to check the expected Ocsp Outcomes - const RPointerArray& ObservedOcspOutcomes() const; - - /// Use to enable and disable cancel testing inside dialogs - void SetCancelDialogTesting(TSwiCancelType aCancelType); - - // Set the dialog number to cancel on - void SetCancelDialogNumber(TInt aDialogNumber); - - /// Use to enable and disable dialog delays - void SetDialogDelay(TTimeIntervalMicroSeconds32 aUsec); - - // Set specific dialog number to delay at (default is all dialogs if dialog delay > 0) - void SetDelayDialogNumber(TInt aDialog); - - // Reset the current dialog number, and set iInstallationCancelled to False - void ResetCurrentDialogNumber(TInt aDialogNumber = 0); - TBool InstallationCancelled() const; - - inline const TDesC& DisplayedText() const; - inline const TDesC& DisplayedTextActual() const; - - //Leave with error code - void LeaveError(TInt aReason); - - inline TInt NumberOfSecurityDialogsInvoked() const; - -private: - /** - * Constructor - * @param aXmlFileName Name of the XML file containing dialog parameters - * @param aLogger TestExecute logger - * @param aExpectedValue Array of install sizes, if present. - */ - CUIScriptAdaptor(const TFileName& aXmlFileName, CTestExecuteLogger& aLogger, - RArray* aExpectedValue = NULL); - CUIScriptAdaptor(const TFileName& aXmlFileName, CTestExecuteLogger& aLogger, - TPtrC aExpectedText, - TPtrC aTextIsHash, - TInt aExpectedDailog, - TInt aKerrcode - ); - - void ConstructL(); - void ScriptParseL(); - CTestExecuteLogger& Logger(); - - // Called whenever a dialog is reached - void DialogReached(); - - TXmlFileData iResult; - TFileName iXmlFileName; - RFs iFs; - CTestExecuteLogger& iLogger; - - TInt iProgressBarFinal; ///< Progress bar final value. - TInt iProgressBarCurrent; ///< Progress bar current value. - TPtrC iExpectedDisplayText; - TPtrC iExpectedHash; - TInt iExpectedDialog; - TInt iKerrCode; - RArray* iExpectedValue; - - TBool iDialogCancelType; ///< Controls whether we do cancel testing - TInt iCancelDialogNumber; ///< The dialog to cancel at - TInt iCurrentDialogNumber; ///< The currentDialogNumber. - TBool iInstallationCancelled; ///< Whether we've cancelled the install yet - MCancelHandler *iCancelHandler; ///< Current CancellableInstallEvent cancel callback - - // TBools for whether certain dialogs have been called - TBool iDisplayDriveDialogCalled; - TBool iGrantUserCapsDialogCalled; - TBool iCannotOverwriteFileDialogCalled; - HBufC* iFileOwner; - TTimeIntervalMicroSeconds32 iDialogDelay; // For async cancel testing - TInt iDelayDialogNumber; - TBool iFatalOcspResponseEncountered; - /** Possibly truncated text which was displayed with FT. */ - TBuf iDisplayedText; - HBufC *iDisplayedTextActual; - TInt iSecurityWarningDialogsInvoked; - // Array of observed ocsp outcomes for comparison to expected values. - RPointerArray iObservedOcspOutcomes; - }; - -inline TBool CUIScriptAdaptor::DisplayDriveDialogCalled() const - { - return iDisplayDriveDialogCalled; - } - -inline TBool CUIScriptAdaptor::GrantUserCapsDialogCalled() const - { - return iGrantUserCapsDialogCalled; - } - -inline TBool CUIScriptAdaptor::FatalOcspResponseEncountered() const - { - return iFatalOcspResponseEncountered; - } - -inline const RPointerArray& CUIScriptAdaptor::ObservedOcspOutcomes() const - { - return iObservedOcspOutcomes; - } - -inline CTestExecuteLogger& CUIScriptAdaptor::Logger() - { - return iLogger; - } - -inline void CUIScriptAdaptor::SetCancelDialogTesting(TSwiCancelType aCancelType) - { - iDialogCancelType = aCancelType; - } - -inline void CUIScriptAdaptor::SetCancelDialogNumber(TInt aDialogNumber) - { - iCancelDialogNumber = aDialogNumber; - } - -inline void CUIScriptAdaptor::ResetCurrentDialogNumber(TInt aDialogNumber) - { - iCurrentDialogNumber = aDialogNumber; - iInstallationCancelled = EFalse; - if(aDialogNumber == 0) iCancelHandler = 0; - } - -inline TBool CUIScriptAdaptor::InstallationCancelled() const - { - return iInstallationCancelled; - } - -inline void CUIScriptAdaptor::SetDialogDelay(TTimeIntervalMicroSeconds32 aDialogDelay) - { - iDialogDelay = aDialogDelay; - } - -inline void CUIScriptAdaptor::SetDelayDialogNumber(TInt aDialog) - { - iDelayDialogNumber = aDialog; - } - -inline const TDesC& CUIScriptAdaptor::DisplayedText() const -/** - Returns text displayed with FT. - - @return Text displayed with FT. - */ - { - return iDisplayedText; - } - -inline const TDesC& CUIScriptAdaptor::DisplayedTextActual() const - { - return *iDisplayedTextActual; // Unchanged text - } - -inline TBool CUIScriptAdaptor::CannotOverwriteFileDialogCalled() const - { - return iCannotOverwriteFileDialogCalled; - } - -inline const TDesC& CUIScriptAdaptor::FileOwner() const - { - return *iFileOwner; - } - -inline TInt CUIScriptAdaptor::NumberOfSecurityDialogsInvoked() const - { - return iSecurityWarningDialogsInvoked; - } - -}//swi -}//test -#endif // TUISCRIPTADAPATORS_H diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_install/tupsserver.cpp --- a/authorisation/userpromptservice/test/tups_install/tupsserver.cpp Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* tups_installserver.cpp -* -*/ - - -/** - * @file - * - * SWIS test server implementation - */ - -#include "tupsserver.h" -#include "tupsstep.h" - -_LIT(KServerName, "tups_install"); - -/** - * Called inside the MainL() function to create and start the CTestServer - * derived server. - * @return Instance of the test server - */ -CUpsTestServer* CUpsTestServer::NewL() - { - CUpsTestServer *server = new(ELeave) CUpsTestServer(); - CleanupStack::PushL(server); - server->ConstructL(KServerName); - CleanupStack::Pop(server); - return server; - } - - -LOCAL_C void MainL() - { - // Leave the hooks in for platform security -#if (defined __DATA_CAGING__) - RProcess().DataCaging(RProcess::EDataCagingOn); - RProcess().SecureApi(RProcess::ESecureApiOn); -#endif - - CActiveScheduler* sched=NULL; - sched=new(ELeave) CActiveScheduler; - CActiveScheduler::Install(sched); - CUpsTestServer* server = NULL; - // Create the CTestServer derived server - TRAPD(err, server = CUpsTestServer::NewL()); - if(!err) - { - // Sync with the client and enter the active scheduler - RProcess::Rendezvous(KErrNone); - sched->Start(); - } - delete server; - delete sched; - } - -/** - * Server entry point - * @return Standard Epoc error code on exit - */ -GLDEF_C TInt E32Main() - { - __UHEAP_MARK; - CTrapCleanup* cleanup = CTrapCleanup::New(); - if(cleanup == NULL) - { - return KErrNoMemory; - } - TRAP_IGNORE(MainL()); - delete cleanup; - __UHEAP_MARKEND; - return KErrNone; - } - -/** - * Implementation of CTestServer pure virtual - * @return A CTestStep derived instance - */ -CTestStep* CUpsTestServer::CreateTestStep(const TDesC& aStepName) - { - CTestStep* testStep = NULL; - - // This server creates just one step but create as many as you want - // They are created "just in time" when the worker thread is created - // install steps - if (aStepName == KUpsInstallStep) // Install with file name - testStep = new CUpsInstallStep(CUpsInstallStep::EUseFileName); -// Uninstall - else if (aStepName == KUpsUnInstallStep) - testStep = new CUpsUninstallStep(CUpsUninstallStep::EByUid); - else if (aStepName == KUpsUnInstallAugStep) - testStep = new CUpsUninstallStep(CUpsUninstallStep::EByPackage); - - return testStep; - - } diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_install/tupsserver.h --- a/authorisation/userpromptservice/test/tups_install/tupsserver.h Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* tswisserver.h -* SWIS test server -* -*/ - - - - -/** - @file -*/ - -#ifndef __TUPSSERVER_H__ -#define __TUPSSERVER_H__ - -#include -#include - -class CUpsTestServer : public CTestServer - { -public: - static CUpsTestServer* NewL(); - virtual CTestStep* CreateTestStep(const TDesC& aStepName); - RFs& Fs() {return iFs;} - -private: - RFs iFs; - }; - -#endif // __TUPSSERVER_H__ diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_install/tupsstep.cpp --- a/authorisation/userpromptservice/test/tups_install/tupsstep.cpp Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,342 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* tswisstep.cpp -* UPS test step implementation -* -*/ - - - - -/** - @file -*/ - - -#include -#include "tupsstep.h" -#include "testutilclient.h" -#include -#include -#include "swi/sisregistryentry.h" -#include "swi/sisregistrysession.h" -#include "swi/sisregistrypackage.h" -#include "cleanuputils.h" - -using namespace Swi; -using namespace Swi::Test; - -// -// CUpsInstallStep -// - -CUpsInstallStep::~CUpsInstallStep() - { - delete iUi; - } - - -CUpsInstallStep::CUpsInstallStep(TInstallType aInstallType) - : iInstallType(aInstallType) - { - // Call base class method to set up the human readable name for logging - SetTestStepName(KUpsInstallStep); - } - -/** - * Override of base class virtual. Prepares for the test run of SWIS - * @return TVerdict code - */ -TVerdict CUpsInstallStep::doTestStepPreambleL() - { - // get step parameters - TPtrC str; - if (!GetStringFromConfig(ConfigSection(), _L("sis"), str)) - { - ERR_PRINTF1(_L("Missing SIS file name")); - SetTestStepResult(EFail); - } - else - { - iSisFileName.Copy(str); - if (!GetStringFromConfig(ConfigSection(), _L("script"), str)) - { - ERR_PRINTF1(_L("Missing XML file name")); - SetTestStepResult(EFail); - } - else - { - iXmlFileName.Copy(str); - INFO_PRINTF3(_L("Installing '%S' using script '%S'"), - &iSisFileName, &iXmlFileName); - // create UI handler with default entries - iUi = CUIScriptAdaptor::NewL(iXmlFileName, Logger()); - } - } - - return TestStepResult(); - } - -/** - * Override of base class pure virtual - * Demonstrates reading configuration parameters fom an ini file section - * @return TVerdict code - */ -TVerdict CUpsInstallStep::doTestStepL() - { - INFO_PRINTF1(KUpsInstallStep); - - // launch the installation - CInstallPrefs* prefs = CInstallPrefs::NewLC(); - - TInt err = DoInstallL(*prefs); - INFO_PRINTF2(_L("DoInstallL returned %d"), err); - if (err != KErrNone) - { - // Can't set error to KErrServerBusy, or Testexecute will retry. - SetTestStepResult((err != KErrServerBusy)? static_cast(err) : EFail); - } - CleanupStack::PopAndDestroy(prefs); - return TestStepResult(); - } - -TInt CUpsInstallStep::DoInstallL(CInstallPrefs& aInstallPrefs) - { - switch (iInstallType) - { - case EUseFileName: - return Launcher::Install(*iUi, iSisFileName, aInstallPrefs); - } - - // Shouldn't get here - return KErrGeneral; - } - -/** - * Override of base class virtual - * @return TVerdict code - */ -TVerdict CUpsInstallStep::doTestStepPostambleL() - { -/* if((TestStepResult() == EPass)) - { - RSisRegistrySession registrySession; - User::LeaveIfError(registrySession.Connect()); - CleanupClosePushL(registrySession); - - RSisRegistryEntry registryEntry; - TInt error=registryEntry.Open(registrySession, iUid); - if(error != KErrNone) - { - ERR_PRINTF2(_L("RSisRegistrySession::Open failed error=%d\n"), error); - SetTestStepResult(EFail); - } - else - { - CleanupClosePushL(registryEntry); - - TInt userDrive =0; - TRAP(error, userDrive = registryEntry.SelectedDriveL()); - if((error != KErrNone) || (userDrive != iExpectedUserDrive)) - { - ERR_PRINTF4(_L("SelectedDriveL err=%d, userDrive expected %d got %d\n"), - error, iExpectedUserDrive, userDrive); - SetTestStepResult(EFail); - } - else - { - INFO_PRINTF2(_L("SelectedDriveL userDrive = %d OK\n"), userDrive); - } - - CleanupStack::PopAndDestroy(®istryEntry); - } - CleanupStack::PopAndDestroy(®istrySession); - }*/ - - return TestStepResult(); - } - -// -// CSwisUninstallStep -// - -CUpsUninstallStep::~CUpsUninstallStep() - { - delete iUi; - } - -CUpsUninstallStep::CUpsUninstallStep(TUninstallType aType) - : iType(aType) - { - // Call base class method to set up the human readable name for logging - SetTestStepName(KUpsUnInstallStep); - } - - - - -/** - * Override of base class virtual. Prepares for the test run of SWIS - * @return TVerdict code - */ -TVerdict CUpsUninstallStep::doTestStepPreambleL() - { - INFO_PRINTF1(_L("CUpsUninstallStep::doTestStepPreambleL")); - // get step parameters - - TPtrC str; - if (!GetStringFromConfig(ConfigSection(), _L("script"), str)) - { - ERR_PRINTF1(_L("Missing XML file name")); - SetTestStepResult(EFail); - return EFail; - } - iXmlFileName.Copy(str); - TInt uid=0; - - if (!GetHexFromConfig(ConfigSection(), _L("uid"), uid)) - { - ERR_PRINTF1(_L("Missing uid")); - SetTestStepResult(EFail); - return EFail; - } - - iUid.iUid=uid; - - if (iType == EByPackage) - { - TPtrC vendorName; - if (!GetStringFromConfig(ConfigSection(), _L("vendorName"), vendorName)) - { - ERR_PRINTF1(_L("Missing Vendor Name")); - SetTestStepResult(EFail); - return EFail; - } - iVendorName.Set(vendorName); - - TPtrC packageName; - if (!GetStringFromConfig(ConfigSection(), _L("packageName"), packageName)) - { - ERR_PRINTF1(_L("Missing Package Name")); - SetTestStepResult(EFail); - return EFail; - } - iPackageName.Set(packageName); - - - INFO_PRINTF5(_L("Uninstalling %D, %S, %S using script '%S'"), - iUid.iUid, &iPackageName, &iVendorName, &iXmlFileName); - // create UI handler with default entries - iUi = CUIScriptAdaptor::NewL(iXmlFileName, Logger()); - } - else if (iType== EByUid) - { - INFO_PRINTF3(_L("Uninstalling '%D' using script '%S'"), - iUid.iUid, &iXmlFileName); - // create UI handler with default entries - iUi = CUIScriptAdaptor::NewL(iXmlFileName, Logger()); - } - - return TestStepResult(); - } - -/** - * Override of base class pure virtual - * Demonstrates reading configuration parameters fom an ini file section - * @return TVerdict code - */ - -TInt CUpsUninstallStep::DoUninstallL() - { - TInt error = KErrNotFound; - - if (iType == EByUid) - { - // launch the installation - return Launcher::Uninstall(*iUi, iUid); - } - else if (iType == EByPackage) - { - - TInt err = KErrNotFound; - // Go through list of packages from base package to get augmentations. - CSisRegistryPackage* uninstallPackage=CSisRegistryPackage::NewLC(iUid, iPackageName, iVendorName); - - RSisRegistrySession registrySession; - User::LeaveIfError(registrySession.Connect()); - CleanupClosePushL(registrySession); - - RSisRegistryEntry registryEntry; - - User::LeaveIfError(registryEntry.Open(registrySession, iUid)); - CleanupClosePushL(registryEntry); - - CSisRegistryPackage* package=registryEntry.PackageL(); - CleanupStack::PushL(package); - - if (*package == *uninstallPackage) - { - err = -1; - err=Launcher::Uninstall(*iUi, *package); - } - else - { - // check augmenations - RPointerArray augmentationPackages; - CleanupResetAndDestroy >::PushL(augmentationPackages); - - registryEntry.AugmentationsL(augmentationPackages); - for (TInt i=0; i < augmentationPackages.Count(); ++i) - { - if (*augmentationPackages[i] == *uninstallPackage) - { - err=User::LeaveIfError(Launcher::Uninstall(*iUi, *augmentationPackages[i])); - break; - } - } - CleanupStack::PopAndDestroy(&augmentationPackages); - } - - CleanupStack::PopAndDestroy(3, ®istrySession); - CleanupStack::PopAndDestroy(uninstallPackage); - error = err; - } - return error; - } - -TVerdict CUpsUninstallStep::doTestStepL() - { - INFO_PRINTF1(KUpsUnInstallStep); - - TInt err = DoUninstallL(); - INFO_PRINTF2(_L("DoUninstallL returned %d"), err); - if (err != KErrNone) - { - // Can't set error to KErrServerBusy, or Testexecute will retry. - SetTestStepResult((err != KErrServerBusy)? static_cast(err) : EFail); - } - return TestStepResult(); - } - -/** - * Override of base class virtual - * @return TVerdict code - */ -TVerdict CUpsUninstallStep::doTestStepPostambleL() - { - return TestStepResult(); - } - -// End of file diff -r a675745f8b2e -r 7355aab40bca authorisation/userpromptservice/test/tups_install/tupsstep.h --- a/authorisation/userpromptservice/test/tups_install/tupsstep.h Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,277 +0,0 @@ -/* -* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* tswisstep.h -* SWIS test step declaration -* -*/ - - - - -/** - @file -*/ - -#ifndef __TSWISSTEP_H__ -#define __TSWISSTEP_H__ - -#include -#include "../../testutil/client/testutilclient.h" -#include "tupsserver.h" -#include "tuiscriptadaptors.h" - -#include "e32base.h" - -namespace Swi - { - class CInstallPrefs; - } - -/** - * Base test step class containing handy functions - * @test - * @internalComponent - */ -class CUpsTestStep : public CTestStep - { -protected: - - enum TReadType - { - ESimpleType, //to read "numexist" and "numnonexist" value from INI. - ECancelType, //to read "numexistcancel" and "numnonexistcancel" value from INI. - ERegisteredType //to read "numregistered" value from INI. - }; - - /** - * Get the file names for checking if present or missing. - * The test step's INI file must contain entry "numexistcancel=" and one or more entries - * "existcancel=". - * The test step's INI file must contain entry "numnonexistcancel=" and one or more entries - * "nonexistcancel=". - * The test step's INI file must contain entry "numexist=" and one or more entries - * "exist=". - * The test step's INI file must contain entry "numnonexist=" and one or more entries - * "nonexist=". - * - * @param aFileNumExist this array contains the name of the files which must exist after - * installation/un-installation/cancellation. - * @param aFileNumNonExist this array contains the name of the files which must not exist after - * installation/un-installation/cancellation. - * @param aDoCancelTest Used to make decision for reading from the INI file. - * ETrue Cancel Testing is enabled, so read entries "numexistcancel" and "numnonexistcancel". - * EFalse Read entries "numexist" and "numnonexist". - */ - void GetFileNamesForCheck(RArray& aFileNumExist,RArray& aFileNumNonExist, TReadType aReadType); - - /** - * Extract the file names from the INI file. - * @param aEntries Number of file name entries. - * @param aEntryBase Base name of the keys specifying names of files to - * check; an index (0..n-1) is appended to the base - * name to get the actual key name. - * @param aFileArray Contains all the file names to check for missing or present. - */ - void ExtractFileName(TInt aEntries, const TDesC& aEntryBase, RArray& aFileArray); - - /** - * Checks for files that should exist if the installation was successful, - * and which shouldn't exist if the installation was cancelled. - * @param aCheckExist Controls the kind of testing done - * ETrue Files must exist - * EFalse Files must not exist - * @param aFileArray Contains all the file names to check for missing or present depending - * on the aCheckExist. If ETrue, this contains the names of files that must exist - * else if EFalse contains the names of files that must not be present. - * @param aTestUtil Contains reference to the testutilserver session. - * @param aMsecTimeout Timeout to wait for file to be created, if not already existing - */ - void CheckIfFilesExist(TBool aCheckExist, const RArray& aFileArray, RTestUtilSession& aTestUtil, TInt aMsecTimeout=0); - - /** - * Checks whether certain files do or do not exist by checking the registry entry and - * sets test step result accordingly. - * @param aFileArray Contains all the file names to check for missing/present. - */ - void CheckRegistryEntry(RArray& aFileArray); - - /** - * Checks that the correct dialogs have been called during the installation. - */ - void CheckDialogsCalled(const Swi::Test::CUIScriptAdaptor& ui); - - /** - * Checks whether a fatal OCSP response was encountered during the installation. - */ - void CheckFatalOcspResponse(const Swi::Test::CUIScriptAdaptor& ui); - - /** - * Checks whether the values of ocsp outcomes in the ini file matches with that of - * the DisplayOcspResultL function. - */ - void CheckExpectedOcspOutcomes(const Swi::Test::CUIScriptAdaptor& ui); - - /** - * Copy files from one place to another. - * - * @param aNumEntries Name of the key that specifies number of file name - * entries - * @param aFrom Base name of the keys specifying names of files to - * copy from; an index (0..n-1) is appended to the base - * name to get the actual key name - * @param aTo Base name of the keys specifying names of files to - * copy to; an index (0..n-1) is appended to the base - * name to get the actual key name - */ - void CopyFilesL(const TDesC& aNumEntries, const TDesC& aFrom, const TDesC& aTo); - - /** - * Delete files. - * - * @param aNumEntries Name of the key that specifies number of file name - * entries - * @param aDeleteKeyBase Base name of the keys specifying names of files - * to delete; an index (0..n-1) is appended to the - * base name to get the actual key name - */ - void DeleteFilesL(const TDesC& aNumEntries, const TDesC& aDeleteKeyBase); - - /** - * Stores all the values of expected install sizes as indicated in the test - * step's INI file. - * @param aNumExpectedSizeEntries Name of key that specifies the number of - * expected install sizes. - * @param aExpectedInstallSize A reference to the array of install sizes. - */ - void StoreExpectedInstallSizesL(TInt aNumExpectedSizeEntries, RArray& aExpectedValue); - - /** Verify the Pub and Sub value of the current installation/uninstallation */ - void CheckPubSubStatus(TDesC& aPubSubStatus); - - /** - * Check that the pub and sub status returns to KErrNone after a test. - * This check should typically be last, whereas the previous method should - * be done ASAP after an install/uninstall since there's a race condition. - */ - void CheckPubSubStatusIdle(); - - /** - * Set or clear read only bit on files. - * - * @param aNumEntries Name of the key that specifies number of file name - * entries - * @param aFileKeyBase Base name of the keys specifying names of files - * to set; an index (0..n-1) is appended to the - * base name to get the actual key name - * @param aFileKeyBase Base name of the keys specifying operation on files - * ; an index (0..n-1) is appended to the - * base name to get the actual key name. - */ - void SetClearReadOnlyFilesL(const TDesC& aNumEntries, - const TDesC& aFileKeyBase, - const TDesC& aSetClearOpBase); - - /** - * Check current step result against list of expected result codes. - */ - void CheckExpectedResultCodesL(); - - /** - * Compares hashes for pairs of files read from config section, sets the - * test step result to fail if any pair does not match or if there is an - * error attempting to get a hash. - */ - void CompareFilesL(); - - /** - * Compares file contents with buffer. Sets test step result to fail if - * the contents do not match or there is an error in performing the - * operation. - */ - void CompareFileWithBufferL(const Swi::Test::CUIScriptAdaptor& ui); - }; - -/** - * Installation test step class - * @test - * @internalComponent - */ -class CUpsInstallStep : public CUpsTestStep - { -public: - enum TInstallType { EUseFileName }; - - CUpsInstallStep(TInstallType aInstallType); - ~CUpsInstallStep(); - virtual TVerdict doTestStepPreambleL(); - virtual TVerdict doTestStepPostambleL(); - virtual TVerdict doTestStepL(); -private: - TInt DoInstallL(Swi::CInstallPrefs& aInstallPrefs); - void GetFilesToHoldOpenL(); - -private: - TFileName iSisFileName; // name of the file to install - TFileName iXmlFileName; // name of the file containing dialog data - Swi::Test::CUIScriptAdaptor* iUi; // XML script-based UI implementation - TInstallType iInstallType; // use file handle to install - RArray iExpectedValue; // array of expected install sizes - TBool iDoCancelTest; - TPtrC iExpectedHash; - TInt iExpectedDialog; - TInt iKErrCode; - TPtrC Outcomes;// outcomes as received from ini file - TUid iUid; - TInt iExpectedUserDrive; // -1 if not checked - TPtrC iPubSubStatus; - TBool iExpectFileChange; - }; - -/** - * Uninstallation test step class - * @test - * @internalComponent - */ -class CUpsUninstallStep : public CUpsTestStep - { -public: - enum TUninstallType { EByUid, EByPackage }; - - CUpsUninstallStep(TUninstallType aType); - ~CUpsUninstallStep(); - virtual TVerdict doTestStepPreambleL(); - virtual TVerdict doTestStepPostambleL(); - virtual TVerdict doTestStepL(); -private: - TInt DoUninstallL(); - -private: - TUid iUid; - TFileName iXmlFileName; // name of the file containing dialog data - TPtrC iVendorName; - TInt iKErrCode; - Swi::Test::CUIScriptAdaptor* iUi; // XML script-based UI implementation - TPtrC iPackageName; - TUninstallType iType; - }; - - -_LIT(KUpsInstallStep, "InstallStep"); - -_LIT(KUpsUnInstallAugStep, "UninstallAugStep"); - -_LIT(KUpsUnInstallStep, "UninstallStep"); - -#endif // __TSWISSTEP_H__ diff -r a675745f8b2e -r 7355aab40bca contentmgmt/contentaccessfwfordrm/source/reccaf/CafApaRecognizer.cpp --- a/contentmgmt/contentaccessfwfordrm/source/reccaf/CafApaRecognizer.cpp Wed Aug 18 11:33:05 2010 +0300 +++ b/contentmgmt/contentaccessfwfordrm/source/reccaf/CafApaRecognizer.cpp Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -227,36 +227,45 @@ else { RFile* fileHandle = CApaCafRecognizer::FilePassedByHandleL(); + + if( fileHandle == NULL ) + { + return; + } + TBuf fileName; User::LeaveIfError(fileHandle->Name(fileName)); isRecognized = iResolver->DoRecognizeL(fileName, aBuffer, FileMimeType, ContentMimeType); } - if (isRecognized) - { - // If there is no content type but the file is recognized it is assumed - // to be a file that can be processed through the supplier interface - - // dummy object for comparison in match function - CMimeTypeMapping* mimeTypeMapping = (ContentMimeType.Length() == 0) ? - CMimeTypeMapping::NewL(FileMimeType) : - CMimeTypeMapping::NewL(ContentMimeType); + if (isRecognized == EFalse) + { + return; + } - // check that the content mime type is one of the ones we - // told Apparc we can recognize in the beginning - // The mime type should always be found as the file has been recognised. - // If not it is because an agent, when recognising the file, has set a mime type not in its supplier list. - // Mime types are always forced to lower case therefore this match can be case sensitive. - TInt index = iContentTypes.Find(mimeTypeMapping, CMimeTypeMapping::ContentMimeTypeMatch); - if (index != KErrNotFound) - { - iDataType = TDataType(iContentTypes[index]->CafMimeType()); - iConfidence=ECertain; - } + // If there is no content type but the file is recognized it is assumed + // to be a file that can be processed through the supplier interface + + // dummy object for comparison in match function + CMimeTypeMapping* mimeTypeMapping = (ContentMimeType.Length() == 0) ? + CMimeTypeMapping::NewL(FileMimeType) : + CMimeTypeMapping::NewL(ContentMimeType); + - delete mimeTypeMapping; - } + // check that the content mime type is one of the ones we + // told Apparc we can recognize in the beginning + // The mime type should always be found as the file has been recognised. + // If not it is because an agent, when recognising the file, has set a mime type not in its supplier list. + // Mime types are always forced to lower case therefore this match can be case sensitive. + TInt index = iContentTypes.Find(mimeTypeMapping, CMimeTypeMapping::ContentMimeTypeMatch); + if (index != KErrNotFound) + { + iDataType = TDataType(iContentTypes[index]->CafMimeType()); + iConfidence=ECertain; + } + + delete mimeTypeMapping; } const TImplementationProxy ImplementationTable[] = diff -r a675745f8b2e -r 7355aab40bca crypto/weakcryptospi/source/spi/cryptospiutil.cpp --- a/crypto/weakcryptospi/source/spi/cryptospiutil.cpp Wed Aug 18 11:33:05 2010 +0300 +++ b/crypto/weakcryptospi/source/spi/cryptospiutil.cpp Thu Sep 02 22:21:47 2010 +0300 @@ -85,21 +85,25 @@ TInt CryptoSpiUtil::RetrieveCharacteristicsL(TInt32 aInterface, RDesReadStream& aStream, RBuf8& aBuf, TInt& aCount) { - TBuf8 buf; + // first we are only trying to retrieve the length of the buffer + TBuf8 buf; TInt testResult = RProperty::Get(KCryptoSpiPropertyCat, aInterface, buf); if (testResult==KErrNotFound) { //run the exe to Publish the properties RunCryptoSpiPropertySetupExe(); + // testresult would be checked outside the loop testResult = RProperty::Get(KCryptoSpiPropertyCat, aInterface, buf); - if (testResult==KErrNotFound) - { - //Error - User::Leave(testResult); - } } - //Try to read the length first + // overflow will occur as we are only retrieving the length first. + // any other error we should leave + if(testResult != KErrOverflow) + { + User::LeaveIfError(testResult); + } + + //read the length RDesReadStream rStream(buf); TInt32 len=rStream.ReadInt32L(); diff -r a675745f8b2e -r 7355aab40bca cryptomgmtlibs/securitytestfw/group/authorisation.pkg --- a/cryptomgmtlibs/securitytestfw/group/authorisation.pkg Wed Aug 18 11:33:05 2010 +0300 +++ b/cryptomgmtlibs/securitytestfw/group/authorisation.pkg Thu Sep 02 22:21:47 2010 +0300 @@ -22,7 +22,6 @@ :"ups integration test" "\common\generic\security\os\security\cryptomgmtlibs\securitytestfw\test\autotesting\hosts"-"c:\private\10000882\hosts" -"\common\generic\security\os\security\cryptomgmtlibs\securitytestfw\test\autotesting\copysecuritytestfiles.bat"-"c:\autotesting\copysecuritytestfiles.bat" "\common\generic\security\os\security\authorisation\userpromptservice\database\test\tupsdb\scripts\tupsdb.ini"-"c:\tups\tupsdb\scripts\tupsdb.ini" "\common\generic\security\os\security\authorisation\userpromptservice\database\test\tupsdb\scripts\tupsdb.script"-"c:\tups\tupsdb\scripts\tupsdb.script" "\common\generic\security\os\security\authorisation\userpromptservice\database\test\tupsdb\scripts\tupsdbperformance.ini"-"c:\tups\tupsdb\scripts\tupsdbperformance.ini" @@ -105,21 +104,6 @@ "\common\generic\security\os\security\authorisation\userpromptservice\test\tups\corrupted_db_integ\ups_corrupted2.db"-"c:\tups\integ\corrupted_db_integ\ups_corrupted2.db" -;REM Integration test sis files and related. -"\common\generic\security\os\security\authorisation\userpromptservice\test\tups\packages\uninstall.xml"-"c:\tups\integ\packages\uninstall.xml" -"\common\generic\security\os\security\authorisation\userpromptservice\test\tups\packages\simple.xml"-"c:\tups\integ\packages\simple.xml" -"\epoc32\data\z\tups\integ\packages\tupsinteg_post1.sis"-"c:\tups\integ\packages\tupsinteg_post1.sis" -"\epoc32\data\z\tups\integ\packages\tupsinteg_policies1.sis"-"c:\tups\integ\packages\tupsinteg_policies1.sis" -"\epoc32\data\z\tups\integ\packages\tupsinteg_policies2.sis"-"c:\tups\integ\packages\tupsinteg_policies2.sis" -"\epoc32\data\z\tups\integ\packages\tupsinteg_evaluator1.sis"-"c:\tups\integ\packages\tupsinteg_evaluator1.sis" -"\epoc32\data\z\tups\integ\packages\tupsinteg_dialog1.sis"-"c:\tups\integ\packages\tupsinteg_dialog1.sis" -"\epoc32\data\z\tups\integ\packages\tupsinteg_eclipse1.sis"-"c:\tups\integ\packages\tupsinteg_eclipse1.sis" -"\epoc32\data\z\tups\integ\packages\tupsinteg_ca_not_instore.sis"-"c:\tups\integ\packages\tupsinteg_ca_not_instore.sis" -"\epoc32\data\z\tups\integ\packages\tupsinteg_policies1_negative.sis"-"c:\tups\integ\packages\tupsinteg_policies1_negative.sis" - - -;REM Integration test, file to simulate tamper attempt for backup and restore. -"\epoc32\data\Z\tups\integ\tampered_backup\backup10285777.1"-"c:\tups\integ\tampered_backup\backup10285777.1" "\common\generic\security\os\security\authorisation\userpromptservice\policies\test\tupspolicies\scripts\tpolicycache.script"-"c:\tups\tpolicies\scripts\tpolicycache.script" "\common\generic\security\os\security\authorisation\userpromptservice\policies\test\tupspolicies\scripts\policyerrors.ini"-"c:\tups\tpolicies\scripts\policyerrors.ini" diff -r a675745f8b2e -r 7355aab40bca cryptomgmtlibs/securitytestfw/group/bld.inf --- a/cryptomgmtlibs/securitytestfw/group/bld.inf Wed Aug 18 11:33:05 2010 +0300 +++ b/cryptomgmtlibs/securitytestfw/group/bld.inf Thu Sep 02 22:21:47 2010 +0300 @@ -67,7 +67,6 @@ ../test/autotesting/testexecute.ini /epoc32/winscw/c/system/data/testexecute.ini // batch files for automated hardware testing - ../test/autotesting/copysecuritytestfiles.bat /epoc32/winscw/c/autohardware/copysecuritytestfiles.bat ../test/autotesting/hosts /epoc32/winscw/c/autohardware/hosts ../test/autotesting/testsecurity_sdp.bat /epoc32/winscw/c/autohardware/testsecurity_sdp.bat ../test/autotesting/testsecurity_sdp_auth.bat /epoc32/winscw/c/autohardware/testsecurity_sdp_auth.bat diff -r a675745f8b2e -r 7355aab40bca cryptomgmtlibs/securitytestfw/group/custom/postrun_custom.xml --- a/cryptomgmtlibs/securitytestfw/group/custom/postrun_custom.xml Wed Aug 18 11:33:05 2010 +0300 +++ b/cryptomgmtlibs/securitytestfw/group/custom/postrun_custom.xml Thu Sep 02 22:21:47 2010 +0300 @@ -5,6 +5,8 @@ + + @@ -14,6 +16,8 @@ + + @@ -23,6 +27,8 @@ + + @@ -32,6 +38,8 @@ + + @@ -43,6 +51,8 @@ + + @@ -53,6 +63,8 @@ + + @@ -63,6 +75,8 @@ + + @@ -73,6 +87,8 @@ + + @@ -83,6 +99,8 @@ + + @@ -93,6 +111,8 @@ + + @@ -103,6 +123,8 @@ + + @@ -113,6 +135,8 @@ + + @@ -123,6 +147,8 @@ + + @@ -133,6 +159,8 @@ + + @@ -143,6 +171,8 @@ + + @@ -153,6 +183,8 @@ + + @@ -163,6 +195,8 @@ + + @@ -173,6 +207,8 @@ + + @@ -183,6 +219,8 @@ + + @@ -193,6 +231,8 @@ + + @@ -203,6 +243,8 @@ + + @@ -213,6 +255,8 @@ + + @@ -223,6 +267,8 @@ + + @@ -233,6 +279,8 @@ + + @@ -243,6 +291,8 @@ + + @@ -253,6 +303,8 @@ + + @@ -263,6 +315,8 @@ + + @@ -273,6 +327,8 @@ + + @@ -283,6 +339,8 @@ + + @@ -293,6 +351,8 @@ + + @@ -303,6 +363,8 @@ + + @@ -313,6 +375,8 @@ + + @@ -323,6 +387,8 @@ + + @@ -333,6 +399,8 @@ + + @@ -343,6 +411,8 @@ + + @@ -353,6 +423,8 @@ + + @@ -363,6 +435,8 @@ + + @@ -373,6 +447,8 @@ + + @@ -382,6 +458,8 @@ + + @@ -392,6 +470,8 @@ + + @@ -402,6 +482,8 @@ + + @@ -412,6 +494,8 @@ + + @@ -422,6 +506,8 @@ + + @@ -432,6 +518,8 @@ + + @@ -442,6 +530,8 @@ + + @@ -452,6 +542,8 @@ + + @@ -462,6 +554,8 @@ + + @@ -472,6 +566,8 @@ + + @@ -482,6 +578,8 @@ + + @@ -492,6 +590,8 @@ + + @@ -502,6 +602,8 @@ + + @@ -512,6 +614,8 @@ + + @@ -522,6 +626,8 @@ + + @@ -532,6 +638,8 @@ + + @@ -542,6 +650,8 @@ + + @@ -552,6 +662,8 @@ + + @@ -562,6 +674,8 @@ + + @@ -572,6 +686,8 @@ + + @@ -582,6 +698,8 @@ + + @@ -592,6 +710,8 @@ + + @@ -602,6 +722,8 @@ + + @@ -612,6 +734,8 @@ + + @@ -622,6 +746,8 @@ + + @@ -632,6 +758,8 @@ + + @@ -642,6 +770,8 @@ + + @@ -652,6 +782,8 @@ + + @@ -662,6 +794,8 @@ + + @@ -671,30 +805,43 @@ + + + FileDownloadTask + + FileDownloadTask + + FileDownloadTask + + FileDownloadTask + + + + diff -r a675745f8b2e -r 7355aab40bca cryptomgmtlibs/securitytestfw/group/custom/prerun_custom.xml --- a/cryptomgmtlibs/securitytestfw/group/custom/prerun_custom.xml Wed Aug 18 11:33:05 2010 +0300 +++ b/cryptomgmtlibs/securitytestfw/group/custom/prerun_custom.xml Thu Sep 02 22:21:47 2010 +0300 @@ -16,12 +16,6 @@ - - CreateDirTask - - - - diff -r a675745f8b2e -r 7355aab40bca cryptomgmtlibs/securitytestfw/test/autotesting/copysecuritytestfiles.bat --- a/cryptomgmtlibs/securitytestfw/test/autotesting/copysecuritytestfiles.bat Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,360 +0,0 @@ -@rem -@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of the License "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem - -if "%1"=="init" goto init; -if "%1"=="auto" goto auto; -if "%1"=="cryptohash" goto cryptohash; -if "%1"=="cryptohashdel" goto cryptohashdel; -if "%1"=="tpadding" goto tpadding; -if "%1"=="tpaddingdel" goto tpaddingdel; -if "%1"=="tcryptospi" goto tcryptospi; -if "%1"=="tcryptospidel" goto tcryptospidel; -if "%1"=="tasymmetric" goto tasymmetric; -if "%1"=="tsymmetric" goto tsymmetric; -if "%1"=="tbigint" goto tbigint; -if "%1"=="tasymmetricdel" goto tasymmetricdel; -if "%1"=="tsymmetricdel" goto tsymmetricdel; -if "%1"=="tbigintdel" goto tbigintdel; -if "%1"=="tpkcs5kdf" goto tpkcs5kdf; -if "%1"=="tpkcs5kdfdel" goto tpkcs5kdfdel; -if "%1"=="tpbe" goto tpbe; -if "%1"=="tpbedel" goto tpbedel; -if "%1"=="trecog" goto trecog; -if "%1"=="trecogdel" goto trecogdel; -if "%1"=="tkeystore" goto tkeystore; -if "%1"=="tkeystoredel" goto tkeystoredel; -if "%1"=="tcertapps" goto tcertapps; -if "%1"=="tcertappsdel" goto tcertappsdel; -if "%1"=="t_keystore" goto t_keystore; -if "%1"=="t_keystoredel" goto t_keystoredel; -if "%1"=="tcaf" goto tcaf; -if "%1"=="tcafdel" goto tcafdel; -if "%1"=="rta" goto rta; -if "%1"=="rtadel" goto rtadel; -if "%1"=="tscaf" goto tscaf; -if "%1"=="tscafdel" goto tscafdel; -if "%1"=="mtputils" goto mtputils; -if "%1"=="mtputilsdel" goto mtputilsdel; -if "%1"=="tpkcs12intg" goto tpkcs12intg; -if "%1"=="tpkcs12intgdel" goto tpkcs12intgdel; -if "%1"=="tasnpkcs" goto tasnpkcs; -if "%1"=="tasnpkcsdel" goto tasnpkcsdel; -if "%1"=="tpkcs7" goto tpkcs7; -if "%1"=="tpkcs7del" goto tpkcs7del; -if "%1"=="certstore" goto certstore; -if "%1"=="cacertsdel" goto cacertsdel; -if "%1"=="certclientdel" goto certclientdel; -if "%1"=="certstoredel" goto certstoredel; -if "%1"=="tocsp" goto tocsp; -if "%1"=="tocspdel" goto tocspdel; -if "%1"=="tx509" goto tx509; -if "%1"=="tx509del" goto tx509del; -if "%1"=="tasn1" goto tasn1; -if "%1"=="tasn1del" goto tasn1del; -if "%1"=="twtlscert" goto twtlscert; -if "%1"=="twtlscertdel" goto twtlscertdel; -if "%1"=="tpkixcert" goto tpkixcert; -if "%1"=="tpkixcertdel" goto tpkixcertdel; -if "%1"=="tpkcs10" goto tpkcs10; -if "%1"=="tpkcs10del" goto tpkcs10del; -if "%1"=="tpkixcert_tef" goto tpkixcert_tef; -if "%1"=="tpkixcert_tefdel" goto tpkixcert_tefdel; -goto exit - - -:init -REM create testresults directory -md c:\testresults - -REM copy hosts file to redirect cam-ocspserver request to ban-ocspserver -md c:\private -md c:\private\10000882 -copy z:\hosts c:\private\10000882\hosts -goto exit; - -:auto -REM install automated commdb -copy z:\auto.cfg c:\auto.cfg -goto exit; - -:cryptohash -copy /s z:\thash\ c:\thash\ -goto exit; - -:cryptohashdel -del /s c:\thash\ -goto exit; - -:tpadding -copy /s z:\tpadding\ c:\tpadding\ -goto exit; - -:tpaddingdel -del /s c:\tpadding\ -goto exit; - -:tcryptospi -copy /s z:\testdata\tcryptospi\ c:\testdata\tcryptospi\ -goto exit; - -:tcryptospidel -del /s c:\testdata\tcryptospi\ -goto exit; - -:tasymmetric -md c:\tasymmetric -copy /s z:\tasymmetric\ c:\tasymmetric\ -goto exit; - -:tsymmetric -md c:\tsymmetric -copy /s z:\tsymmetric\ c:\tsymmetric\ -goto exit; - -:tbigint -md c:\tbigint -copy /s z:\tbigint\ c:\tbigint\ -goto exit; - -:tasymmetricdel -del /s c:\tasymmetric\ -goto exit; - -:tsymmetricdel -del c:\tsymmetric\ -goto exit; - -:tbigintdel -del c:\tbigint\ -goto exit; - -:tpkcs5kdf -md c:\tpkcs5kdf -copy z:\tpkcs12kdftests.script c:\tpkcs5kdf\tpkcs12kdftests.script -goto exit; - -:tpkcs5kdfdel -del /s c:\tpkcs5kdf\ -goto exit; - -:tpbe -md c:\tpbe -copy z:\tpbe\*.dat c:\tpbe -attrib c:\tpbe\strong.dat -r -attrib c:\tpbe\weak.dat -r -goto exit; - -:tpbedel -del /s c:\tpbe\ -goto exit; - -:trecog -md c:\trecog -copy /s z:\trecog\* c:\trecog -goto exit; - -:trecogdel -del c:\trecog\ -goto exit; - -:tkeystore -copy /s z:\tkeystore\ c:\tkeystore\ -copy /s z:\tcertstore\ c:\tcertstore\ -copy /s z:\ttesttools\ c:\ttesttools\ -copy /s z:\system\data\test1certstore.dat c:\system\data\test1certstore.dat -copy /s c:\ttesttools\data\certclients.dat c:\private\101f72a6\certclients.dat -goto exit; - -:tkeystoredel -del c:\private\101f72a6\certclients.dat -del c:\system\data\test1certstore.dat -del /s c:\ttesttools\ -del /s c:\tcertstore\ -del /s c:\tkeystore\ -goto exit; - -:tcertapps -copy /s z:\tcertapps\ c:\tcertapps\ -goto exit; - -:tcertappsdel -del /s c:\tcertapps\ -goto exit; - -:t_keystore -copy /s z:\tkeystore\ c:\tkeystore\ -goto exit; - -:t_keystoredel -del /s c:\tkeystore\ -goto exit; - -:tcaf -md c:\tcaf -copy /s z:\tcaf\* c:\tcaf -goto exit; - -:tcafdel -del c:\tcaf\*.* -goto exit; - -:rta -md c:\rta -copy /s z:\rta\* c:\rta -goto exit; - -:rtadel -del c:\rta\*.* -goto exit; - -:tscaf -md c:\tcaf -md c:\tcaf\tscaf -copy /s z:\tcaf\tscaf\* c:\tcaf\tscaf -goto exit; - -:tscafdel -del c:\tcaf\tscaf\*.* -goto exit; - -:mtputils -md c:\tcaf -md c:\tcaf\tmtputils -copy /s z:\tcaf\tmtputils\* c:\tcaf\tmtputils -goto exit; - -:mtputilsdel -del c:\tcaf\tmtputils\*.* -goto exit; - -:tpkcs12intg -copy /s z:\tpkcs12intg\ c:\tpkcs12intg\ -goto exit; - -:tpkcs12intgdel -del /s c:\tpkcs12intg -goto exit; - -:tasnpkcs -md c:\tkeystore -md c:\tkeystore\data -copy /s z:\tkeystore\data\ c:\tkeystore\data\ -copy z:\tasnpkcstests.script c:\tasnpkcstests.script -goto exit; - -:tasnpkcsdel -del c:\tasnpkcstests.script -del /s c:\tkeystore\data\ -goto exit; - -:tpkcs7 -md c:\tpkcs7 -copy /s z:\tpkcs7\ c:\tpkcs7\ -goto exit; - -:tpkcs7del -del /s c:\tpkcs7\ -goto exit; - -:certstore -copy /s z:\tcertstore\ c:\tcertstore\ -copy z:\certappmanager.txt c:\certappmanager.txt -copy /s z:\unifiedcertstore2\ c:\unifiedcertstore2\ -copy z:\tcertstore\data\TestKeyStore.txt c:\system\data\testkeystore.txt -goto exit; - -:cacertsdel -del c:\system\data\cacerts.dat -goto exit; - -:certclientdel -del c:\system\data\certclients.dat -goto exit; - -:certstoredel -rem deleting data on c: to save room and leave slots in root folder -del /s c:\unifiedcertstore2\ -del /s c:\tcertstore\ -del c:\certappmanager.txt -goto exit; - - -:tocsp -rem copy tocsp test data -md c:\system -md c:\system\tocsp -copy /s z:\system\tocsp\ c:\system\tocsp\ -goto exit; - -:tocspdel -del c:\system\tocsp\ -goto exit; - - -:tx509 -copy /s z:\tx509\ c:\tx509\ -goto exit; - -:tx509del -del /s c:\tx509\ -goto exit; - -:tasn1 -copy /s z:\tasn1\ c:\tasn1\ -goto exit; - -:tasn1del -del /s c:\tasn1\ -goto exit; - -:twtlscert -copy /s z:\twtlscert\ c:\twtlscert\ -goto exit; - -:twtlscertdel -del /s c:\twtlscert\ -goto exit; - -:tpkixcert -copy /s z:\tpkixcert\ c:\tpkixcert\ -copy /s z:\pkixtestdata\ c:\pkixtestdata\ -goto exit; - -:tpkixcertdel -del c:\pkixtestdata\*.* -goto exit; - -:tpkcs10 -copy /s z:\tpkcs10\ c:\tpkcs10\ -goto exit; - -:tpkcs10del -del /s c:\tpkcs10 -goto exit; - -:tpkixcert_tef -copy /s z:\tpkixcert_tef\ c:\tpkixcert_tef\ -goto exit; - -:tpkixcert_tefdel -del /s c:\tpkixcert_tef -goto exit; - - -:exit - - - diff -r a675745f8b2e -r 7355aab40bca cryptomgmtlibs/securitytestfw/test/autotesting/test_launcher.pl --- a/cryptomgmtlibs/securitytestfw/test/autotesting/test_launcher.pl Wed Aug 18 11:33:05 2010 +0300 +++ b/cryptomgmtlibs/securitytestfw/test/autotesting/test_launcher.pl Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +# Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # This component and the accompanying materials are made available # under the terms of the License "Eclipse Public License v1.0" @@ -25,7 +25,7 @@ # 6. Run or modify the relevant wrapper batch file for your component, which will be stored in the root of the test directory. # Components Summary # This script works fine with the following components: Asnpkcs, Caf2, Certman, Common, Crypto, Cryptospi, CryptoTokens, -# FileTokens, Sistools, Streamingcaf, Swi, Switools, Tlsprovider, Ups. Other components must be tested and therefore +# FileTokens, Sistools, Streamingcaf, Swi, Switools, Ups. Other components must be tested and therefore # further extensions may be needed. # diff -r a675745f8b2e -r 7355aab40bca cryptomgmtlibs/securitytestfw/test/autotesting/testsecurity_sdp_newrom.bat --- a/cryptomgmtlibs/securitytestfw/test/autotesting/testsecurity_sdp_newrom.bat Wed Aug 18 11:33:05 2010 +0300 +++ b/cryptomgmtlibs/securitytestfw/test/autotesting/testsecurity_sdp_newrom.bat Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ @rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). @rem All rights reserved. @rem This component and the accompanying materials are made available @rem under the terms of the License "Eclipse Public License v1.0" @@ -45,8 +45,6 @@ runcryptotokens.bat -runtlsprovider.bat - runcertman.bat diff -r a675745f8b2e -r 7355aab40bca cryptoservices/certificateandkeymgmt/pkixcertbase/Pkixchainbuilder.cpp --- a/cryptoservices/certificateandkeymgmt/pkixcertbase/Pkixchainbuilder.cpp Wed Aug 18 11:33:05 2010 +0300 +++ b/cryptoservices/certificateandkeymgmt/pkixcertbase/Pkixchainbuilder.cpp Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -150,6 +150,34 @@ } CleanupStack::PopAndDestroy();//aki } + + // If more then one subject matching candidates are found and they doesn't contain SKI/AKI, + // consider the most recently imported/added candidate as the issuer. + for(TInt index = count - 1; index >= 0; --index) + { + TTime currentTime; + // if secure time is not available then fall back to the insecure version. + if(currentTime.UniversalTimeSecure() == KErrNoSecureTime) + { + currentTime.UniversalTime(); + } + + CX509Certificate* cert = CX509Certificate::NewLC(*aCandidates[index]); + // SKI/AKI are optional in versions lower than 3. So, relax the candidate selection rules only for version 1 & 2 + // If the recent candidate is not valid enough(cert expired), consider it's previous valid candidate. + if((cert->Version() < 3) && (cert->ValidityPeriod().Valid(currentTime))) + { + aChain.AppendL(cert); + ++(*iNumberOfCertsAdded); + CleanupStack::Pop(cert); + return ETrue; + } + else + { + CleanupStack::PopAndDestroy(cert); + continue; + } + } return EFalse; } diff -r a675745f8b2e -r 7355aab40bca cryptoservices/certificateandkeymgmt/tx509/comparisontest.cpp --- a/cryptoservices/certificateandkeymgmt/tx509/comparisontest.cpp Wed Aug 18 11:33:05 2010 +0300 +++ b/cryptoservices/certificateandkeymgmt/tx509/comparisontest.cpp Thu Sep 02 22:21:47 2010 +0300 @@ -123,7 +123,7 @@ TInt size; User::LeaveIfError(file.Size(size)); RBuf8 buf; - buf.Create(size); + buf.CreateL(size); CleanupClosePushL(buf); User::LeaveIfError(file.Read(buf, size)); diff -r a675745f8b2e -r 7355aab40bca securityanddataprivacytools/securityconfig/tlsprovider/SWTLSTOKENTYPE.RLS --- a/securityanddataprivacytools/securityconfig/tlsprovider/SWTLSTOKENTYPE.RLS Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* @description The TLS backend token name -* @localize no -* -*/ - - -rls_string STRING_r_token_name "Sw TLS token" - -/*& -@description The TLS backend token version -@localize no -*/ -rls_string STRING_r_token_version "N/A" - -/*& -@description The TLS backend token serial number -@localize no -*/ -rls_string STRING_r_token_serial_no "N/A" - -/*& -@description The TLS backend token provider -@localize no -*/ -rls_string STRING_r_token_manufacturer "Symbian Ltd" diff -r a675745f8b2e -r 7355aab40bca securityanddataprivacytools/securityconfig/tlsprovider/SWTLSTOKENTYPE.RSS --- a/securityanddataprivacytools/securityconfig/tlsprovider/SWTLSTOKENTYPE.RSS Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -NAME SWTT -#include -#include "SWTLSTOKENTYPE.RLS" - -RESOURCE RSS_SIGNATURE { } - -RESOURCE ARRAY r_swtlst_strings - { - items= - { - LBUF { txt=STRING_r_token_name; }, - LBUF { txt=STRING_r_token_version; }, - LBUF { txt=STRING_r_token_serial_no; }, - LBUF { txt=STRING_r_token_manufacturer; } - }; - } diff -r a675745f8b2e -r 7355aab40bca securityanddataprivacytools/securityconfig/tlsprovider/tlscachetimeouts.rh --- a/securityanddataprivacytools/securityconfig/tlsprovider/tlscachetimeouts.rh Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - - -STRUCT TLS_CACHE_TIMEOUTS - { - WORD accepted; - WORD rejected; - } diff -r a675745f8b2e -r 7355aab40bca securityanddataprivacytools/securityconfig/tlsprovider/tlscachetimeouts.rss --- a/securityanddataprivacytools/securityconfig/tlsprovider/tlscachetimeouts.rss Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Timeouts for certificate acceptance/rejection in seconds -* -*/ - - -#include "tlscachetimeouts.rh" - -RESOURCE TLS_CACHE_TIMEOUTS r_tls_cache_timeouts - { - accepted = 120; - rejected = 10; - } diff -r a675745f8b2e -r 7355aab40bca securityanddataprivacytools/securityconfig/tlsprovider/tlsproviderconfig.iby --- a/securityanddataprivacytools/securityconfig/tlsprovider/tlsproviderconfig.iby Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __TLSPROVIDERCONFIG_IBY__ -#define __TLSPROVIDERCONFIG_IBY__ - - -data=ZRESOURCE\tlsproviderpolicy.ini \Resource\tlsproviderpolicy.ini -data=MULTI_LINGUIFY(RSC ZRESOURCE\swtlstokentype resource\swtlstokentype) -data=MULTI_LINGUIFY(RSC ZRESOURCE\tlscacheserver\tlscachetimeouts resource\tlscacheserver\tlscachetimeouts) - -#endif diff -r a675745f8b2e -r 7355aab40bca securityanddataprivacytools/securityconfig/tlsprovider/tlsproviderpolicy.ini --- a/securityanddataprivacytools/securityconfig/tlsprovider/tlsproviderpolicy.ini Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -ClientAuthDlgEnabled = true - diff -r a675745f8b2e -r 7355aab40bca securityanddataprivacytools/securityconfig/ups/romstub/bld.inf --- a/securityanddataprivacytools/securityconfig/ups/romstub/bld.inf Wed Aug 18 11:33:05 2010 +0300 +++ b/securityanddataprivacytools/securityconfig/ups/romstub/bld.inf Thu Sep 02 22:21:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -19,6 +19,10 @@ PRJ_EXPORTS ../ups_config.iby /epoc32/rom/include/ups_config.iby +// FLM interface and implementation +upsromstubsis.xml /epoc32/tools/makefile_templates/security/upsromstubsis.xml +upsromstubsis.flm /epoc32/tools/makefile_templates/security/upsromstubsis.flm + PRJ_TESTEXPORTS PRJ_MMPFILES @@ -26,7 +30,13 @@ #ifndef TOOLS #ifndef TOOLS2 -gnumakefile buildstub.mak +// FLM calls +PRJ_EXTENSIONS + +start extension security.upsromstubsis.export +option SISNAME upsserver +option SRCDIR . +end #endif #endif diff -r a675745f8b2e -r 7355aab40bca securityanddataprivacytools/securityconfig/ups/romstub/buildstub.mak --- a/securityanddataprivacytools/securityconfig/ups/romstub/buildstub.mak Wed Aug 18 11:33:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -ifeq "$(PLATFORM)" "WINSCW" -ZDIR:=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\z -SISFILE=$(ZDIR)\system\install\upsserver.sis -endif - -ifeq "$(PLATFORM)" "ARMV5" -ZDIR:=$(EPOCROOT)epoc32\data\z -SISFILE=$(ZDIR)\system\install\upsserver.sis -endif - -# -# The targets invoked by abld... -# - -MAKMAKE : DO_NOTHING -FREEZE : DO_NOTHING -LIB : DO_NOTHING -RESOURCE : DO_NOTHING -CLEANLIB : DO_NOTHING -FINAL : DO_NOTHING -SAVESPACE : BLD -BLD : MAKEDATA - -DO_NOTHING: - - -ifndef SISFILE -# -# Not supported on this target so nothing to do -# -MAKEDATA : - @echo ---------------- - @echo Do nothing ... - @echo ---------------- - -CLEAN: - -RELEASABLES: - -else -# -# WINSCW or ARM -# -MAKEDATA : $(SISFILE) - -$(SISFILE) : upsserver.pkg - @cd - @echo --------------------------- - @echo Building UPS ROM stub - @echo --------------------------- - @echo nb. The stub does not contain any exes, just mentions them. - makesis -s $< $@ - -DO_NOTHING: - rem do nothing - -CLEAN : - -@erase $(SISFILE) /f - -RELEASABLES : - @echo $(SISFILE) -endif diff -r a675745f8b2e -r 7355aab40bca securityanddataprivacytools/securityconfig/ups/romstub/upsromstubsis.flm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/securityanddataprivacytools/securityconfig/ups/romstub/upsromstubsis.flm Thu Sep 02 22:21:47 2010 +0300 @@ -0,0 +1,51 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of the License "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +# + +# FLM to build upsromstubsis libraries. + +## Outputs - upsserver.sis + +TARGETDIR:=$(EPOCROOT)/epoc32/data/z/system/install + +ifeq ($(PLATFORM),WINSCW) + TARGETDIR:=$(EPOCROOT)/epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/z/system/install +endif + +$(call makepath,$(TARGETDIR)) + +define SisFileCreation +$(SISFILE): $(EXTENSION_ROOT)/$(SRCDIR)/$(SISNAME).pkg + $(call startrule,stubsis) \ + $(EPOCROOT)/epoc32/tools/makesis$(DOTEXE) -s $$? $$@ \ + $(call endrule,stubsis) +endef + +# Build stub SIS file +SISFILE:= $(TARGETDIR)/$(SISNAME).sis + +GUARD:=done_$(call sanitise,$(SISFILE)) + +ifeq ($($(GUARD)),) +$(GUARD):=1 + +ALL:: $(SISFILE) +$(eval $(call SisFileCreation)) +$(eval $(call whatmacro,$(SISFILE))) +$(eval $(call GenerateStandardCleanTarget,$(SISFILE),$(TARGETDIR))) +endif + + diff -r a675745f8b2e -r 7355aab40bca securityanddataprivacytools/securityconfig/ups/romstub/upsromstubsis.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/securityanddataprivacytools/securityconfig/ups/romstub/upsromstubsis.xml Thu Sep 02 22:21:47 2010 +0300 @@ -0,0 +1,29 @@ + + + + + + + + + + +