os/security/authorisation/userpromptservice/policies/test/tupspolicies/scripts/tserviceconfig.script
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/authorisation/userpromptservice/policies/test/tupspolicies/scripts/tserviceconfig.script Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,113 @@
1.4 +//
1.5 +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of the License "Eclipse Public License v1.0"
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +LOAD_SUITE tupspolicies
1.21 +PRINT ----------------------------------------------------------
1.22 +PRINT tupspolicies:
1.23 +PRINT User Prompt Service policy library - service config unit test
1.24 +PRINT ------------------------------------------------------------
1.25 +
1.26 +// Clean environment. Policy directory on system drive must not exist for the first tests
1.27 +// to allow us to check that the library works if the path doesn't exist.
1.28 +RUN_UTILS DELETEFILE c:\tups\tpolicies\policies\ups_01033000_01032001.rsc
1.29 +RUN_UTILS DELETEFILE c:\tups\tpolicies\policies\ups_01034000_01032001.rsc
1.30 +RUN_UTILS DELETEFILE c:\tups\tpolicies\policies\ups_01035000_01035001.rsc
1.31 +RUN_UTILS DELETEFILE c:\tups\tpolicies\policies\ups_01036000_01036001.rsc
1.32 +RUN_UTILS DELETEDIRECTORY c:\tups\tpolicies\policies\
1.33 +
1.34 +//! @SYMTestCaseID SEC-UPS-POLICIES-SERVICECONFIG-0001
1.35 +//! @SYMTestCaseDesc No policy files.
1.36 +//! @SYMTestPriority High
1.37 +//! @SYMTestActions Attempt to load a the service configuration data from a directory with no policy files.
1.38 +//! @SYMTestExpectedResults An empty set of configuration objects is returned.
1.39 +//! @SYMDevelopedForRelease Oghma
1.40 +START_TESTCASE SEC-UPS-POLICIES-SERVICECONFIG-0001
1.41 +RUN_TEST_STEP 100 tupspolicies serviceconfig z:\tups\tpolicies\scripts\tserviceconfig.ini nopolicies
1.42 +END_TESTCASE SEC-UPS-POLICIES-SERVICECONFIG-0001
1.43 +
1.44 +//! @SYMTestCaseID SEC-UPS-POLICIES-SERVICECONFIG-0002
1.45 +//! @SYMTestCaseDesc Ignore invalid policy filenames
1.46 +//! @SYMTestPriority High
1.47 +//! @SYMTestActions Load service configuration settings for system server 01032000
1.48 +//! @SYMTestExpectedResults A single service is configured. Similar but invalid policy filenames are ignored.
1.49 +//! @SYMDevelopedForRelease Oghma
1.50 +START_TESTCASE SEC-UPS-POLICIES-SERVICECONFIG-0002
1.51 +RUN_TEST_STEP 100 tupspolicies serviceconfig z:\tups\tpolicies\scripts\tserviceconfig.ini oneservice
1.52 +END_TESTCASE SEC-UPS-POLICIES-SERVICECONFIG-0002
1.53 +
1.54 +//! @SYMTestCaseID SEC-UPS-POLICIES-SERVICECONFIG-0003
1.55 +//! @SYMTestCaseDesc Load service config for the fake messaging server.
1.56 +//! @SYMTestPriority High
1.57 +//! @SYMTestActions Attempt to load service configuration for server 0x10310000
1.58 +//! @SYMTestExpectedResults Two service config objects are created.
1.59 +//! @SYMDevelopedForRelease Oghma
1.60 +START_TESTCASE SEC-UPS-POLICIES-SERVICECONFIG-0003
1.61 +RUN_TEST_STEP 100 tupspolicies serviceconfig z:\tups\tpolicies\scripts\tserviceconfig.ini twoservices
1.62 +END_TESTCASE SEC-UPS-POLICIES-SERVICECONFIG-0003
1.63 +
1.64 +// Setup policy files on the system drive
1.65 +RUN_UTILS MKDIR c:\tups\
1.66 +RUN_UTILS MKDIR c:\tups\tpolicies\
1.67 +RUN_UTILS MKDIR c:\tups\tpolicies\policies\
1.68 +RUN_UTILS COPYFILE z:\tups\tpolicies\eclipse\ups_01033000_01032001.rsc c:\tups\tpolicies\policies\ups_01033000_01032001.rsc
1.69 +RUN_UTILS COPYFILE z:\tups\tpolicies\eclipse\ups_01034000_01032001.rsc c:\tups\tpolicies\policies\ups_01034000_01032001.rsc
1.70 +RUN_UTILS COPYFILE z:\tups\tpolicies\eclipse\ups_01035000_01035001.rsc c:\tups\tpolicies\policies\ups_01035000_01035001.rsc
1.71 +
1.72 +//! @SYMTestCaseID SEC-UPS-POLICIES-SERVICECONFIG-0004
1.73 +//! @SYMTestCaseDesc Policy file on the Z drive is eclipsed a policy file on the system drive.
1.74 +//! @SYMTestPriority High
1.75 +//! @SYMTestActions Load service config
1.76 +//! @SYMTestExpectedResults Make sure the configuration is read from the UPS policy file on the system drive.
1.77 +//! @SYMDevelopedForRelease Oghma
1.78 +START_TESTCASE SEC-UPS-POLICIES-SERVICECONFIG-0004
1.79 +RUN_TEST_STEP 100 tupspolicies serviceconfig z:\tups\tpolicies\scripts\tserviceconfig.ini eclipsevalid
1.80 +END_TESTCASE SEC-UPS-POLICIES-SERVICECONFIG-0004
1.81 +
1.82 +//! @SYMTestCaseID SEC-UPS-POLICIES-SERVICECONFIG-0005
1.83 +//! @SYMTestCaseDesc Policy file only exists on the system drive.
1.84 +//! @SYMTestPriority High
1.85 +//! @SYMTestActions Load service config
1.86 +//! @SYMTestExpectedResults Service config should be read correctly.
1.87 +//! @SYMDevelopedForRelease Oghma
1.88 +START_TESTCASE SEC-UPS-POLICIES-SERVICECONFIG-0005
1.89 +RUN_TEST_STEP 100 tupspolicies serviceconfig z:\tups\tpolicies\scripts\tserviceconfig.ini systemdrive
1.90 +END_TESTCASE SEC-UPS-POLICIES-SERVICECONFIG-0005
1.91 +
1.92 +//! @SYMTestCaseID SEC-UPS-POLICIES-SERVICECONFIG-0006
1.93 +//! @SYMTestCaseDesc Ignore corrupt policies on system drive.
1.94 +//! @SYMTestPriority High
1.95 +//! @SYMTestActions Load service config.
1.96 +//! @SYMTestExpectedResults Corrupt policy file on system drive should be ignored.
1.97 +//! @SYMDevelopedForRelease Oghma
1.98 +START_TESTCASE SEC-UPS-POLICIES-SERVICECONFIG-0006
1.99 +RUN_TEST_STEP 100 tupspolicies serviceconfig z:\tups\tpolicies\scripts\tserviceconfig.ini eclipseinvalid
1.100 +END_TESTCASE SEC-UPS-POLICIES-SERVICECONFIG-0006
1.101 +
1.102 +//! @SYMTestCaseID SEC-UPS-POLICIES-SERVICECONFIG-0007
1.103 +//! @SYMTestCaseDesc Corrupt policies on the Z drive should panic the UPS
1.104 +//! @SYMTestPriority High
1.105 +//! @SYMTestActions Load service config for a corrupt policy that only exists on the Z drive.
1.106 +//! @SYMTestExpectedResults UPS should panic.
1.107 +//! @SYMDevelopedForRelease Oghma
1.108 +START_TESTCASE SEC-UPS-POLICIES-SERVICECONFIG-0007
1.109 +RUN_PANIC_STEP_RESULT 0 UPS-Policies 100 tupspolicies serviceconfig z:\tups\tpolicies\scripts\tserviceconfig.ini panic0
1.110 +END_TESTCASE SEC-UPS-POLICIES-SERVICECONFIG-0007
1.111 +
1.112 +// Cleanup
1.113 +RUN_UTILS DELETEFILE c:\tups\tpolicies\policies\ups_01033000_01032001.rsc
1.114 +RUN_UTILS DELETEFILE c:\tups\tpolicies\policies\ups_01034000_01032001.rsc
1.115 +RUN_UTILS DELETEFILE c:\tups\tpolicies\policies\ups_01035000_01035001.rsc
1.116 +RUN_UTILS DELETEFILE c:\upsrefnotifier.txt