//
// 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 "Symbian Foundation License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//
START_TESTCASE SEC-CERTMAN-RELOAD-0001
//! @SYMTestCaseID SEC-CERTMAN-RELOAD-0001
//! @SYMTestCaseDesc reload.txt
//!
//! Test that certs and cert meta data stay in the cert store after it is
//! reloaded.
//!
//! 0. Setup
//! @SYMTestActions 1) 0.1, Opening a CertificateAppInfoManager
//! 2) 0.2, Adding client A1
//! 3) 0.3, Adding client A2
//! 4) 0.4, Adding client A3
//! 5) 0.5, Deleting the CertificateAppInfoManager
//! 6) 0.6, Import a RSA key
//! 7) 0.7, Opening a certificate store manager
//! 8) 0.8, Deleting all certs
//! 9) 0.9, Add the certificate CAX1
//! 10) 0.10, Add certificate rsacert1
//! 11) 0.11, Get the list of CA certificates
//! 12) 0.12, Get the list of user certificates
//! 13) 0.13, Set applications to the CAX1 certificate
//! 14) 0.14, Get applications for CAX1
//! 15) 0.15, Set the trust for CAX1
//! 16) 0.16, Get the trust for CAX1
//! 17) 0.21, Deleting the writable certificate store manager
//! 18) 0.22, Sleep 5 seconds so server exits
RUN_TEST_STEP -1 CTestHandler initappmanager
RUN_TEST_STEP -1 CTestHandler addclient reload.ini SEC-CERTMAN-RELOAD-0001-002
RUN_TEST_STEP -1 CTestHandler addclient reload.ini SEC-CERTMAN-RELOAD-0001-003
RUN_TEST_STEP -1 CTestHandler addclient reload.ini SEC-CERTMAN-RELOAD-0001-004
RUN_TEST_STEP -1 CTestHandler deleteappmanager
RUN_TEST_STEP -1 CTestHandler importkey reload.ini SEC-CERTMAN-RELOAD-0001-006
RUN_TEST_STEP -1 CTestHandler init reload.ini SEC-CERTMAN-RELOAD-0001-007
RUN_TEST_STEP -1 CTestHandler deletecert reload.ini SEC-CERTMAN-RELOAD-0001-008
RUN_TEST_STEP -1 CTestHandler addcert reload.ini SEC-CERTMAN-RELOAD-0001-009
RUN_TEST_STEP -1 CTestHandler addcert reload.ini SEC-CERTMAN-RELOAD-0001-010
RUN_TEST_STEP -1 CTestHandler listcert reload.ini SEC-CERTMAN-RELOAD-0001-011
RUN_TEST_STEP -1 CTestHandler listcert reload.ini SEC-CERTMAN-RELOAD-0001-012
RUN_TEST_STEP -1 CTestHandler setapplications reload.ini SEC-CERTMAN-RELOAD-0001-013
RUN_TEST_STEP -1 CTestHandler getapplications reload.ini SEC-CERTMAN-RELOAD-0001-014
RUN_TEST_STEP -1 CTestHandler settrust reload.ini SEC-CERTMAN-RELOAD-0001-015
RUN_TEST_STEP -1 CTestHandler gettrusters reload.ini SEC-CERTMAN-RELOAD-0001-016
RUN_TEST_STEP -1 CTestHandler delete
RUN_TEST_STEP -1 CTestHandler sleep reload.ini SEC-CERTMAN-RELOAD-0001-018
END_TESTCASE SEC-CERTMAN-RELOAD-0001
START_TESTCASE SEC-CERTMAN-RELOAD-0002
//! @SYMTestCaseID SEC-CERTMAN-RELOAD-0002
//! @SYMTestCaseDesc 1. Test things are still as we left them when the server restarts
//! @SYMTestActions 1) 1.1, Opening a certificate store manager
//! 2) 1.2, Get the list of CA certificates
//! 3) 1.3, Get the list of user certificates
//! 4) 1.4, Get applications for CAX1
//! 5) 1.5, Get the trust for CAX1
RUN_TEST_STEP -1 CTestHandler init reload.ini SEC-CERTMAN-RELOAD-0002-001
RUN_TEST_STEP -1 CTestHandler listcert reload.ini SEC-CERTMAN-RELOAD-0002-002
RUN_TEST_STEP -1 CTestHandler listcert reload.ini SEC-CERTMAN-RELOAD-0002-003
RUN_TEST_STEP -1 CTestHandler getapplications reload.ini SEC-CERTMAN-RELOAD-0002-004
RUN_TEST_STEP -1 CTestHandler gettrusters reload.ini SEC-CERTMAN-RELOAD-0002-005
END_TESTCASE SEC-CERTMAN-RELOAD-0002
START_TESTCASE SEC-CERTMAN-RELOAD-0003
//! @SYMTestCaseID SEC-CERTMAN-RELOAD-0003
//! @SYMTestCaseDesc 2. Cleanup
//! @SYMTestActions 1) 2.0, Opening a CertificateAppInfoManager
//! 2) 2.1, Deleting the client A1
//! 3) 2.2, Deleting the client A2
//! 4) 2.3, Deleting the client A3
//! 5) 2.4, Deleting the CertificateAppInfoManager
RUN_TEST_STEP -1 CTestHandler initappmanager
RUN_TEST_STEP -1 CTestHandler removeclient reload.ini SEC-CERTMAN-RELOAD-0003-002
RUN_TEST_STEP -1 CTestHandler removeclient reload.ini SEC-CERTMAN-RELOAD-0003-003
RUN_TEST_STEP -1 CTestHandler removeclient reload.ini SEC-CERTMAN-RELOAD-0003-004
RUN_TEST_STEP -1 CTestHandler deleteappmanager
END_TESTCASE SEC-CERTMAN-RELOAD-0003