//! oom3.txt
//! Oom tests for the certificate addition, deletion, trust&application setting with notification
//! to the client process.

// Note: The in-source test tag is only added to the new tests for PREQ226. The tests without test tag is the existing tests
// in the certstore component, which are used to set up the environment needed by the PREQ226 tests.

// Setup ///////////////////////////////////////////////////////////////////////

<action>
	<actionname>No Test,Opening a CertificateAppInfoManager</actionname>
	<actiontype>initappmanager</actiontype>
	<actionbody></actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>No Test,Adding client A1</actionname>
	<actiontype>addclient</actiontype>
	<actionbody>
		<name>A1</name>
		<uid>1</uid>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>No Test,Adding client A2</actionname>
	<actiontype>addclient</actiontype>
	<actionbody>
		<name>A2</name>
		<uid>2</uid>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>No Test,Adding client A3</actionname>
	<actiontype>addclient</actiontype>
	<actionbody>
		<name>A3</name>
		<uid>3</uid>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>No Test,Adding client A4</actionname>
	<actiontype>addclient</actiontype>
	<actionbody>
		<name>A4</name>
		<uid>4</uid>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>No Test,Deleting the CertificateAppInfoManager</actionname>
	<actiontype>deleteappmanager</actiontype>
	<actionbody></actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Opening a writable certificate store manager</actionname>
	<actiontype>init</actiontype>
	<actionbody>
		<mode>write</mode>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Deleting all certs</actionname>
	<actiontype>deletecert</actiontype>
	<actionbody>
		<label>*.*</label>
		<deleteallcerts>1</deleteallcerts>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Import a RSA key rsacertkey1</actionname>
	<actiontype>importkey</actiontype>
	<actionbody>
		<ImportData>rsacertkey1.txt</ImportData>
		<keyusage>AllUsagesButNR</keyusage>
		<keylabel>*IMPORTED* RSA key 1</keylabel>
		<keyaccesstype>Extractable</keyaccesstype>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Start OOM testing</actionname>
	<actiontype>startmemfailure</actiontype>
	<actionbody></actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

// Add certs ///////////////////////////////////////////////////////////////////
//! @file 
//! @SYMTestCaseID UCTSSEC-CT-WModeUCTAddCWNOOM1.1
//! @SYMTestCaseDesc The test is the OOM test of X509 CA certificate addition with notification.
//! @SYMPREQ 226
//! @SYMTestCasePriority High
//! @SYMTestExpectedResults KErrNone
<action>
	<actionname>1.1, OOM test of X509 CA certificate CAX1 addition with notification</actionname>
	<actiontype>addcert</actiontype>
	<actionbody>
		<format>X509</format>
		<label>CAX1</label>
		<issuerkey></issuerkey>
		<subjectkey></subjectkey>
		<certstore>0</certstore>
		<certfile>c:\unifiedcertstore2\CAX1.cer</certfile>
		<certowner>ca</certowner>
		<ChangeNotification>1</ChangeNotification>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

// Add certs ///////////////////////////////////////////////////////////////////
//! @file 
//! @SYMTestCaseID UCTSSEC-CT-WModeUCTAddCWNOOM1.2
//! @SYMTestCaseDesc The test is the OOM test of WTLS CA certificate addition with notification.
//! @SYMPREQ 226
//! @SYMTestCasePriority High
//! @SYMTestExpectedResults KErrNone
<action>
	<actionname>1.2, OOM test of WTLS CA certificate CAW1 addition with notification</actionname>
	<actiontype>addcert</actiontype>
	<actionbody>
		<format>WTLS</format>
		<label>CAW1</label>
		<issuerkey></issuerkey>
		<subjectkey></subjectkey>
		<certstore>0</certstore>
		<certfile>c:\unifiedcertstore2\CAW1.cer</certfile>
		<certowner>ca</certowner>
		<ChangeNotification>1</ChangeNotification>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>
// Add certs ///////////////////////////////////////////////////////////////////
//! @file 
//! @SYMTestCaseID UCTSSEC-CT-WModeUCTAddCWNOOM1.3
//! @SYMTestCaseDesc The test is the OOM test of X509 user certificate addition with notification.
//! @SYMPREQ 226
//! @SYMTestCasePriority High
//! @SYMTestExpectedResults KErrNone
<action>
	<actionname>1.3, OOM test of X509 user certificate rsacert1 addition with notification</actionname>
	<actiontype>addcert</actiontype>
	<actionbody>
		<format>X509</format>
		<label>rsacert1</label>
		<issuerkey></issuerkey>
		<subjectkey>4808f03892fe836e78d048bcefcca4a37913d886</subjectkey>
		<certstore>0</certstore>
		<certfile>c:\unifiedcertstore2\rsacert1.cer</certfile>
		<certowner>user</certowner>
		<ChangeNotification>1</ChangeNotification>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

// List certs //////////////////////////////////////////////////////////////////

<action>
	<actionname>List CA certificates</actionname>
	<actiontype>listcert</actiontype>
	<actionbody>
		<filter>
			<ownertype>ca</ownertype>
		</filter>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
		<CCTCertInfo><label>CAX1</label></CCTCertInfo>
		<CCTCertInfo><label>CAW1</label></CCTCertInfo>
	</actionresult>
</action>

<action>
	<actionname>List user certificates</actionname>
	<actiontype>listcert</actiontype>
	<actionbody>
		<filter>
			<ownertype>user</ownertype>
			<keyusagedescription>
				<keyusagescheme>pkcs15</keyusagescheme>
				<keytype>private</keytype>
				<keyusage>AllUsagesButNR</keyusage>
			</keyusagedescription>
		</filter>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
		<CCTCertInfo><label>rsacert1</label></CCTCertInfo>
	</actionresult>
</action>

<action>
	<actionname>List user certificates filtered by key usage</actionname>
	<actiontype>listcert</actiontype>
	<actionbody>
		<filter>
			<ownertype>user</ownertype>
			<keyusagedescription>
				<keyusagescheme>pkcs15</keyusagescheme>
				<keytype>private</keytype>
				<keyusage>Decrypt</keyusage>
			</keyusagedescription>
		</filter>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
		<CCTCertInfo><label>rsacert1</label></CCTCertInfo>
	</actionresult>
</action>

<action>
	<actionname>List user certificates filtered by key usage</actionname>
	<actiontype>listcert</actiontype>
	<actionbody>
		<filter>
			<ownertype>user</ownertype>
			<keyusagedescription>
				<keyusagescheme>pkcs15</keyusagescheme>
				<keyusage>NonRepudiation</keyusage>
			</keyusagedescription>
		</filter>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>List certificates filtered by Issuer DN</actionname>
	<actiontype>listcert</actiontype>
	<actionbody>
		<filter>
			<ownertype>ca</ownertype>
		</filter>
		<issuerdn>c:\unifiedcertstore2\CAX1.cer</issuerdn>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
		<CCTCertInfo><label>CAX1</label></CCTCertInfo>
	</actionresult>
</action>

<action>
	<actionname>List certificates filtered by Issuer DN</actionname>
	<actiontype>listcert</actiontype>
	<actionbody>
		<filter>
			<ownertype>ca</ownertype>
		</filter>
		<issuerdn>c:\unifiedcertstore2\CAX1.cer</issuerdn>
		<issuerdn>c:\unifiedcertstore2\CAX2.cer</issuerdn>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
		<CCTCertInfo><label>CAX1</label></CCTCertInfo>
	</actionresult>
</action>

<action>
	<actionname>List certificates filtered by Issuer DN</actionname>
	<actiontype>listcert</actiontype>
	<actionbody>
		<filter>
			<ownertype>user</ownertype>
		</filter>
		<issuerdn>c:\unifiedcertstore2\CAX2.cer</issuerdn>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

// Applications and trust //////////////////////////////////////////////////////

//! @file 
//! @SYMTestCaseID UCTSSEC-CT-WModeUCTSAppCWNOOM4.1
//! @SYMTestCaseDesc The test is the OOM test of setting X509 CA certificate with notification.
//! @SYMPREQ 226
//! @SYMTestCasePriority High
//! @SYMTestExpectedResults KErrNone
<action>
	<actionname>4.1, OOM test of applications setting to the CAX1 certificate with notification</actionname>
	<actiontype>setapplications</actiontype>
	<actionbody>
		<label>CAX1</label>
		<uid>1 2 3</uid>
		<ChangeNotification>1</ChangeNotification>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Get applications for CAX1</actionname>
	<actiontype>getapplications</actiontype>
	<actionbody>
		<label>CAX1</label>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
		<uid>1 2 3</uid>
	</actionresult>
</action>

//! @file 
//! @SYMTestCaseID UCTSSEC-CT-WModeUCTSTrustCWNOOM3.1
//! @SYMTestCaseDesc The test is the OOM test of setting X509 CA certificate with notification.
//! @SYMPREQ 226
//! @SYMTestCasePriority High
//! @SYMTestExpectedResults KErrNone
<action>
	<actionname>3.1 OOM test of the trust setting for CAX1 with notification</actionname>
	<actiontype>settrust</actiontype>
	<actionbody>
		<label>CAX1</label>
		<trust>1</trust>
		<ChangeNotification>1</ChangeNotification>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Get the trust for CAX1</actionname>
	<actiontype>gettrusters</actiontype>
	<actionbody>
		<label>CAX1</label>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
		<trust>1</trust>
	</actionresult>
</action>

// Delete certs ////////////////////////////////////////////////////////////////

//! @file 
//! @SYMTestCaseID UCTSSEC-CT-WModeUCTDelCWNOOM2.1
//! @SYMTestCaseDesc The test is the OOM test of the certificates deletion with notification. 
//! @SYMPREQ 226
//! @SYMTestCasePriority High
//! @SYMTestExpectedResults KErrNone
<action>
	<actionname>2.1, OOM test of all certs deletion with notification</actionname>
	<actiontype>deletecert</actiontype>
	<actionbody>
		<label>*.*</label>
		<deleteallcerts>1</deleteallcerts>
		<ChangeNotification>1</ChangeNotification>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

// Cleanup /////////////////////////////////////////////////////////////////////

<action>
	<actionname>None</actionname>
	<actiontype>stopmemfailure</actiontype>
	<actionbody></actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>Deleting the writable certificate store manager</actionname>
	<actiontype>delete</actiontype>
	<actionbody></actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>No Test,Opening a CertificateAppInfoManager</actionname>
	<actiontype>initappmanager</actiontype>
	<actionbody></actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>No Test,Deleting the client A1</actionname>
	<actiontype>removeclient</actiontype>
	<actionbody>
		<uid>1</uid>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>No Test,Deleting the client A2</actionname>
	<actiontype>removeclient</actiontype>
	<actionbody>
		<uid>2</uid>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>No Test,Deleting the client A3</actionname>
	<actiontype>removeclient</actiontype>
	<actionbody>
		<uid>3</uid>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>No Test,Deleting the client A4</actionname>
	<actiontype>removeclient</actiontype>
	<actionbody>
		<uid>4</uid>
	</actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>

<action>
	<actionname>No Test,Deleting the CertificateAppInfoManager</actionname>
	<actiontype>deleteappmanager</actiontype>
	<actionbody></actionbody>
	<actionresult>
		<return>KErrNone</return>
	</actionresult>
</action>
