authenticationservices/authenticationserver/test/tAuthSvr/scripts/tclientsidsupport.script
changeset 29 ece3df019add
child 34 5b5ca9f4f7b4
equal deleted inserted replaced
19:cd501b96611d 29:ece3df019add
       
     1 //
       
     2 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 // All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of the License "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 //
       
     9 // Initial Contributors:
       
    10 // Nokia Corporation - initial contribution.
       
    11 //
       
    12 // Contributors:
       
    13 //
       
    14 // Description: 
       
    15 //
       
    16 //
       
    17 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
    18 // All rights reserved.
       
    19 // This component and the accompanying materials are made available
       
    20 // under the terms of "Eclipse Public License v1.0"
       
    21 // which accompanies this distribution, and is available
       
    22 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    23 //
       
    24 // Initial Contributors:
       
    25 // Nokia Corporation - initial contribution.
       
    26 //
       
    27 // Contributors:
       
    28 //
       
    29 // Description:
       
    30 //
       
    31 
       
    32 RINT Client Sid support tests...
       
    33 
       
    34 // Prepare a clone of TAuthSvr to possess authserver's SID.
       
    35 // This is required for modifying the authserver's central repository file.
       
    36 // This clone must be deleted at the end of the test.
       
    37 
       
    38 RUN_PROGRAM 100 SETCAP tAuthSvr.exe 188b0 -SID 102740FC tAuthSvr_new.exe
       
    39 
       
    40 // Prepare a clone of TAuthSvr without ReadUserData capability.
       
    41 // This clone must be deleted at the end of the test.
       
    42 
       
    43 RUN_PROGRAM 100 SETCAP tAuthSvr.exe 108b0 tAuthSvr1.exe
       
    44 
       
    45 LOAD_SUITE tAuthSvr
       
    46 LOAD_SUITE tAuthSvr_new
       
    47 LOAD_SUITE tAuthSvr1
       
    48 
       
    49 // This test must be executed in order to set the default plugin, else authserver will never start.
       
    50 
       
    51 RUN_UTILS DeleteFile C:\pinplugin_inactive.txt
       
    52 RUN_TEST_STEP_RESULT 0 100	tAuthSvr_new 	INIT_CENREP c:\tauth\tAuthSvr\scripts\tauthsvr2.ini defaultplugin
       
    53 RUN_UTILS DeleteFile  C:\t_pinplugindlg_in.dat
       
    54 RUN_UTILS DeleteFile  C:\t_pinplugindlg_out.dat
       
    55 
       
    56 ////
       
    57 //! @SYMTestCaseID SEC-AUT-CLIENTSIDSUPPORT-0001
       
    58 //! @SYMTestCaseDesc 		When a client Sid is non-zero, the same must be used to generate the protection key 
       
    59 //!				of an identity.
       
    60 //! @SYMREQ 			REQ11236
       
    61 //! @SYMTestPriority 		Medium
       
    62 //! @SYMTestActions  		Have a default plugin defined, which is active, and a second one which is active as well
       
    63 //!				use a client that has ReadUserData capability to connect to the AuthServer.
       
    64 //! 
       
    65 //!				Successfully register a 2nd identity while using a specified PIN input
       
    66 //!				Authenticate using the same PIN input so that the identity to be trained is one
       
    67 //!				that has been previously trained.Store the Identity obtained as a result of authentication.
       
    68 //! 
       
    69 //!				Then call the Train() function, giving a different input. Attempt to authenticate,
       
    70 //!				giving the new input.Store the identity obtained as a result of authentication.
       
    71 //!			
       
    72 //!				Generate a protection key using the key of the identity resulting from the first 
       
    73 //!				authentication with the client sid and compare with the identity key obtained from 
       
    74 //!				second authentication.
       
    75 //!				
       
    76 //! @SYMTestExpectedResults 	The authentication, registration and retrain are successful. Protection key generated 
       
    77 //!				by the identity resulting from first authentication must be the same as the protection key 
       
    78 //!				of the identity resulting from second authentication.
       
    79 //! @SYMDevelopedForRelease 	Diran
       
    80 //!
       
    81 START_TESTCASE SEC-AUT-CLIENTSIDSUPPORT-0001
       
    82 RUN_TEST_STEP_RESULT 0 100	tAuthSvr 	REMOVE_DBS
       
    83 RUN_TEST_STEP_RESULT 0 100	tAuthSvr 	REG_IDENTITY	c:\tauth\tAuthSvr\scripts\tclientsidsupport.ini Test0001
       
    84 RUN_TEST_STEP_RESULT 0 100	tAuthSvr 	CLIENT_SID_CHECK	c:\tauth\tAuthSvr\scripts\tclientsidsupport.ini Test0002
       
    85 END_TESTCASE SEC-AUT-CLIENTSIDSUPPORT-0001
       
    86 
       
    87 
       
    88 ////
       
    89 //! @SYMTestCaseID SEC-AUT-CLIENTSIDSUPPORT-0002
       
    90 //! @SYMTestCaseDesc 		When a client Sid is zero, the calling application's sid must be used to generate the 
       
    91 //!				protection key of an identity.
       
    92 //! @SYMREQ 			REQ11236
       
    93 //! @SYMTestPriority 		Medium
       
    94 //! @SYMTestActions  		Have a default plugin defined, which is active, and a second one which is active as well
       
    95 //!				use a client that has ReadUserData capability to connect to the AuthServer.
       
    96 //! 
       
    97 //!				Successfully register a 2nd identity while using a specified PIN input
       
    98 //!				Authenticate using the same PIN input so that the identity to be trained is one
       
    99 //!				that has been previously trained.Store the Identity obtained as a result of authentication.
       
   100 //! 
       
   101 //!				Then call the Train() function, giving a different input. Attempt to authenticate,
       
   102 //!				giving the new input.Store the identity obtained as a result of authentication.
       
   103 //!			
       
   104 //!				Generate a protection key using the key of the identity resulting from the first 
       
   105 //!				authentication with the client sid of the calling application and compare with the 
       
   106 //!				identity key obtained from second authentication.
       
   107 //!				
       
   108 //! @SYMTestExpectedResults 	The authentication, registration and retrain are successful. Protection key generated 
       
   109 //!				by the identity resulting from first authentication must be the same as the protection key 
       
   110 //!				of the identity resulting from second authentication.
       
   111 //! @SYMDevelopedForRelease 	Diran
       
   112 //!
       
   113 START_TESTCASE SEC-AUT-CLIENTSIDSUPPORT-0002
       
   114 RUN_TEST_STEP_RESULT 0 100	tAuthSvr 	REMOVE_DBS
       
   115 RUN_TEST_STEP_RESULT 0 100	tAuthSvr 	REG_IDENTITY	c:\tauth\tAuthSvr\scripts\tclientsidsupport.ini Test0001
       
   116 RUN_TEST_STEP_RESULT 0 100	tAuthSvr 	CLIENT_SID_CHECK	c:\tauth\tAuthSvr\scripts\tclientsidsupport.ini Test0003
       
   117 END_TESTCASE SEC-AUT-CLIENTSIDSUPPORT-0002
       
   118 
       
   119 
       
   120 ////
       
   121 //! @SYMTestCaseID SEC-AUT-CLIENTSIDSUPPORT-0003
       
   122 //! @SYMTestCaseDesc 		When a client sid is non-zero and is not the same as the calling application's SID, 
       
   123 //!				a call to authenticate method fails if the calling application doesn't 
       
   124 //!				possess ReadUserData capability. 
       
   125 //! @SYMREQ 			REQ11236
       
   126 //! @SYMTestPriority 		Medium
       
   127 //! @SYMTestActions  		Have a default plugin defined, which is active, and a second one which is active as well
       
   128 //!				use a client that does not have ReadUserData capability to connect to the AuthServer.
       
   129 //! 
       
   130 //!				Successfully register a 2nd identity while using a specified PIN input
       
   131 //!				Authenticate using the same PIN input so that the identity to be trained is one
       
   132 //!				that has been previously trained.Authentication fails with KErrPermissionDenied,
       
   133 //!				since the calling appliction doesn't possess ReadUserData capability.
       
   134 //!				Authentication must fail with KErrPermissionDenied.
       
   135 //! @SYMDevelopedForRelease 	Diran
       
   136 //!
       
   137 START_TESTCASE SEC-AUT-CLIENTSIDSUPPORT-0003
       
   138 RUN_TEST_STEP_RESULT 0 100	tAuthSvr 	REMOVE_DBS
       
   139 RUN_TEST_STEP_RESULT 0 100	tAuthSvr 	REG_IDENTITY	c:\tauth\tAuthSvr\scripts\tclientsidsupport.ini Test0001
       
   140 RUN_TEST_STEP !Error=-46 100	tAuthSvr1 	CLIENT_SID_CHECK	c:\tauth\tAuthSvr\scripts\tclientsidsupport.ini Test0002
       
   141 END_TESTCASE SEC-AUT-CLIENTSIDSUPPORT-0003
       
   142 
       
   143 ////
       
   144 //! @SYMTestCaseID SEC-AUT-CLIENTSIDSUPPORT-0004
       
   145 //! @SYMTestCaseDesc 		When a client sid is zero, a call to authenticate method succeeds even if the calling 
       
   146 //!				application doesn't have ReadUserData capability.
       
   147 //! @SYMREQ 			REQ11236
       
   148 //! @SYMTestPriority 		Medium
       
   149 //! @SYMTestActions  		Have a default plugin defined, which is active, and a second one which is active as well
       
   150 //!				use a client that doesn't possess ReadUserData capability to connect to the AuthServer.
       
   151 //! 
       
   152 //!				Successfully register a 2nd identity while using a specified PIN input
       
   153 //!				Authenticate using the same PIN input so that the identity to be trained is one
       
   154 //!				that has been previously trained.Store the Identity obtained as a result of authentication.
       
   155 //! 
       
   156 //!				Then call the Train() function, giving a different input. Attempt to authenticate,
       
   157 //!				giving the new input.Store the identity obtained as a result of authentication.
       
   158 //!			
       
   159 //!				Generate a protection key using the key of the identity resulting from the first 
       
   160 //!				authentication with the client sid of the calling application and compare with the 
       
   161 //!				identity key obtained from second authentication.
       
   162 //!				
       
   163 //! @SYMTestExpectedResults 	The authentication, registration and retrain are successful. Protection key generated 
       
   164 //!				by the identity resulting from first authentication must be the same as the protection key 
       
   165 //!				of the identity resulting from second authentication.
       
   166 //! @SYMDevelopedForRelease 	Diran
       
   167 //!
       
   168 
       
   169 START_TESTCASE SEC-AUT-CLIENTSIDSUPPORT-0004
       
   170 RUN_TEST_STEP_RESULT 0 100	tAuthSvr 	REMOVE_DBS
       
   171 RUN_TEST_STEP_RESULT 0 100	tAuthSvr 	REG_IDENTITY	c:\tauth\tAuthSvr\scripts\tclientsidsupport.ini Test0001
       
   172 RUN_TEST_STEP_RESULT 0 100	tAuthSvr1 	CLIENT_SID_CHECK	c:\tauth\tAuthSvr\scripts\tclientsidsupport.ini Test0003
       
   173 END_TESTCASE SEC-AUT-CLIENTSIDSUPPORT-0004
       
   174 
       
   175 ////
       
   176 //! @SYMTestCaseID SEC-AUT-CLIENTSIDSUPPORT-0005
       
   177 //! @SYMTestCaseDesc 		When a client sid is non-zero and is the same as the calling application's sid,
       
   178 //!				, a call to authenticate method succeeds even if the calling application doesn't 
       
   179 //!				have ReadUserData capability.
       
   180 //! @SYMREQ 			REQ11236
       
   181 //! @SYMTestPriority 		Medium
       
   182 //! @SYMTestActions  		Have a default plugin defined, which is active, and a second one which is active as well
       
   183 //!				use a client that doesn't possess ReadUserData capability to connect to the AuthServer.
       
   184 //! 
       
   185 //!				Successfully register a 2nd identity while using a specified PIN input
       
   186 //!				Authenticate using the same PIN input so that the identity to be trained is one
       
   187 //!				that has been previously trained.Store the Identity obtained as a result of authentication.
       
   188 //! 
       
   189 //!				Then call the Train() function, giving a different input. Attempt to authenticate,
       
   190 //!				giving the new input.Store the identity obtained as a result of authentication.
       
   191 //!			
       
   192 //!				Generate a protection key using the key of the identity resulting from the first 
       
   193 //!				authentication with the client sid of the calling application and compare with the 
       
   194 //!				identity key obtained from second authentication.
       
   195 //!				
       
   196 //! @SYMTestExpectedResults 	The authentication, registration and retrain are successful. Protection key generated 
       
   197 //!				by the identity resulting from first authentication must be the same as the protection key 
       
   198 //!				of the identity resulting from second authentication.
       
   199 //! @SYMDevelopedForRelease 	Diran
       
   200 //!
       
   201 
       
   202 START_TESTCASE SEC-AUT-CLIENTSIDSUPPORT-0005
       
   203 RUN_TEST_STEP_RESULT 0 100	tAuthSvr 	REMOVE_DBS
       
   204 RUN_TEST_STEP_RESULT 0 100	tAuthSvr 	REG_IDENTITY	c:\tauth\tAuthSvr\scripts\tclientsidsupport.ini Test0001
       
   205 RUN_TEST_STEP_RESULT 0 100	tAuthSvr1 	CLIENT_SID_CHECK	c:\tauth\tAuthSvr\scripts\tclientsidsupport.ini Test0004
       
   206 END_TESTCASE SEC-AUT-CLIENTSIDSUPPORT-0005
       
   207 
       
   208 // This is to shut down the auth server
       
   209 DELAY 5000