telephonyserverplugins/common_tsy/test/integration/src/cctsyintegrationtestapncontrollist.cpp
changeset 0 3553901f7fa8
child 8 3f227a47ad75
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Test step definitions for the APNControlList functional unit.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @internalTechnology
       
    20 */
       
    21 
       
    22 #include "cctsyintegrationtestapncontrollist.h"
       
    23 
       
    24 #include <etelmmerr.h>
       
    25 #include "cctsyinidata.h"
       
    26 #include <pcktcs.h>
       
    27 
       
    28 _LIT(KPrompt, "This test requires USIM service table, Insert a 3G enabled SIM which has the APN control list service enabled");
       
    29 CCTSYIntegrationTestAPNControlListBase::CCTSYIntegrationTestAPNControlListBase(CEtelSessionMgr& aEtelSessionMgr)
       
    30 	: CCTSYIntegrationTestSuiteStepBase(aEtelSessionMgr), iPhoneTestHelper(*this), iNetworkTestHelper(*this),iSimTestHelper(*this), iPacketServiceHelper(*this)
       
    31 /**
       
    32  * Constructor
       
    33  */
       
    34 	{
       
    35 	}
       
    36 
       
    37 CCTSYIntegrationTestAPNControlListBase::~CCTSYIntegrationTestAPNControlListBase()
       
    38 /*
       
    39  * Destructor
       
    40  */
       
    41 	{
       
    42 	}
       
    43 
       
    44 void CCTSYIntegrationTestAPNControlListBase::EnsureApnListIsEmptyL(RMobilePhone &aMobilePhone)
       
    45 /*
       
    46  * This function ensures that Apn List is empty.
       
    47  *
       
    48  * @param aMobilePhone Reference to opened RMobilePhone subsession.
       
    49  * 
       
    50  */
       
    51 	{
       
    52 	TUint32 index= 0;
       
    53 	TExtEtelRequestStatus deleteAPNNameStatus(aMobilePhone, EMobilePhoneDeleteAPNName);
       
    54 	CleanupStack::PushL(deleteAPNNameStatus);
       
    55 	TExtEtelRequestStatus enumerateAPNEntriesStatus(aMobilePhone, EMobilePhoneEnumerateAPNEntries);
       
    56 	CleanupStack::PushL(enumerateAPNEntriesStatus);
       
    57 	aMobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, index);
       
    58 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
    59 	CHECK_EQUALS_L(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
    60 	while(index!=0)
       
    61 		{
       
    62 		aMobilePhone.DeleteAPNName(deleteAPNNameStatus, index-1);
       
    63 		CHECK_EQUALS_L(WaitForRequestWithTimeOut(deleteAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::DeleteAPNName timed out"));
       
    64 		CHECK_EQUALS_L(deleteAPNNameStatus.Int(), KErrNone, _L("RMobilePhone::DeleteAPNName returned with an error"));		
       
    65 		index=index-1;
       
    66 		if(index==0)
       
    67 			{
       
    68 			aMobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, index);
       
    69 			CHECK_EQUALS_L(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
    70 			CHECK_EQUALS_L(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
    71 			}
       
    72 		}
       
    73 	
       
    74 	CHECK_TRUE_L(index==0 , _L("RMobilePhone::EnumerateAPNEntries did not return empty list"));		
       
    75 	CleanupStack::PopAndDestroy(2, &deleteAPNNameStatus);
       
    76 	
       
    77 	}
       
    78 
       
    79 TBool CCTSYIntegrationTestAPNControlListBase::CheckEntryIsInListL(RMobilePhone &aMobilePhone,RMobilePhone::TAPNEntryV3 &aExpectedAPnEntry, TUint32 &aIndex)
       
    80 /*
       
    81  * This function undo checks a specific entry in list by comparing them
       
    82  *
       
    83  * @param aMobilePhone Reference to opened RMobilePhone subsession.
       
    84  * @param expectedAPnEntry Reference to the entry for which check is being carried out.
       
    85  * @param index stores the specific index of found entry in the APN list, which can be used by some other operation. 
       
    86  * @return true if entry is found.
       
    87  */
       
    88 	{
       
    89 	// Check RMobilePhone::EnumerateAPNEntries returns aIndex 
       
    90 	TUint32 listIndex= 0;
       
    91 	TBool ret(EFalse);
       
    92 	TExtEtelRequestStatus enumerateAPNEntriesStatus(aMobilePhone, EMobilePhoneEnumerateAPNEntries);
       
    93 	CleanupStack::PushL(enumerateAPNEntriesStatus);
       
    94 	aMobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, listIndex);
       
    95 	ASSERT_EQUALS(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
    96 	ASSERT_EQUALS(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
    97 	
       
    98 	// Check no entry exists in the list
       
    99 	if(listIndex==0)
       
   100 		{
       
   101 		ret=EFalse;
       
   102 		}
       
   103 	
       
   104 	// Check RMobilePhone::GetAPNname returns same APN name as that written
       
   105 	RMobilePhone::TAPNEntryV3Pckg expectedAPnEntryPckg(aExpectedAPnEntry);
       
   106 	RMobilePhone::TAPNEntryV3 myAPnEntry;
       
   107 	RMobilePhone::TAPNEntryV3Pckg myAPnEntryPckg(myAPnEntry);
       
   108 	TExtEtelRequestStatus getAPNnameStatus(aMobilePhone, EMobilePhoneGetAPNname);
       
   109 	CleanupStack::PushL(getAPNnameStatus);
       
   110 	for(TInt i=0; i<listIndex;i++)
       
   111 		{
       
   112 		aMobilePhone.GetAPNname(getAPNnameStatus,i, myAPnEntryPckg);
       
   113 		ASSERT_EQUALS(WaitForRequestWithTimeOut(getAPNnameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNname timed out"));
       
   114 		ASSERT_EQUALS(getAPNnameStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNname returned with an error"));		
       
   115 		if(myAPnEntry.iApn== aExpectedAPnEntry.iApn)
       
   116 			{
       
   117 			aIndex=i;
       
   118 			ret= ETrue;
       
   119 			break;
       
   120 			}
       
   121 		else
       
   122 			{
       
   123 			ret=EFalse;	
       
   124 			}
       
   125 		}
       
   126 			
       
   127 	// Pop:
       
   128 	// enumerateAPNEntriesStatus
       
   129 	// getAPNnameStatus
       
   130 		
       
   131 	CleanupStack::PopAndDestroy(2, &enumerateAPNEntriesStatus);
       
   132 		
       
   133 	return ret;
       
   134 	}
       
   135 
       
   136 
       
   137 CCTSYIntegrationTestAPNControlList0001::CCTSYIntegrationTestAPNControlList0001(CEtelSessionMgr& aEtelSessionMgr)
       
   138 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
   139 /**
       
   140  * Constructor.
       
   141  */
       
   142 	{
       
   143 	SetTestStepName(CCTSYIntegrationTestAPNControlList0001::GetTestStepName());
       
   144 	}
       
   145 
       
   146 CCTSYIntegrationTestAPNControlList0001::~CCTSYIntegrationTestAPNControlList0001()
       
   147 /**
       
   148  * Destructor.
       
   149  */
       
   150 	{
       
   151 	}
       
   152 
       
   153 TVerdict CCTSYIntegrationTestAPNControlList0001::doTestStepL()
       
   154 /**
       
   155  * @SYMTestCaseID BA-CTSY-INT-ACL-0001
       
   156  * @SYMFssID BA/CTSY/ACL-0001
       
   157  * @SYMTestCaseDesc Append and get entries from the APN control list.
       
   158  * @SYMTestPriority High
       
   159  * @SYMTestActions RMobilePhone::VerifySecurityCode, RMobilePhone::NotifySecurityEvent, RMobilePhone::NotifyAPNListChanged, RMobilePhone::GetAPNname, RMobilePhone::AppendAPNName
       
   160  * @SYMTestExpectedResults Pass - Number of APNs in list is correct. Written entries can be read.
       
   161  * @SYMTestType CIT
       
   162  * @SYMTestCaseDependencies live/manual
       
   163  *
       
   164  * Reason for test: Verify number of APNs is correct, APN notification completes and that written entries can be read.
       
   165  *
       
   166  * @return - TVerdict code
       
   167  */
       
   168 	{
       
   169 
       
   170 	//
       
   171 	// SET UP
       
   172 	//
       
   173 
       
   174 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   175 	
       
   176 	DisplayUserInteractionPromptL(KPrompt); // 30 seconds
       
   177 	
       
   178 	// Verify Pin2
       
   179 	iSimTestHelper.VerifyPin2L(mobilePhone, iNetworkTestHelper); 
       
   180 	
       
   181 	// Take the backup of APN Control list. 
       
   182 	TInt listCountAtStart;
       
   183 	TBackupAPNList backup(*this,mobilePhone);
       
   184 	CHECK_TRUE_L(backup.BackupL(listCountAtStart), _L("TBackupAPNList::Backup could not backup"));
       
   185 	CleanupStack::PushL (backup);
       
   186 	
       
   187 	// Ensure RMobilePhone::GetSecurityCaps returns caps in set of KCapsAccessPin2 
       
   188 	TUint32 securityCaps;
       
   189 	CHECK_EQUALS_L(mobilePhone.GetSecurityCaps(securityCaps), KErrNone,_L("RMobilePhone::GetSecurityCaps returned with an error"));
       
   190 	CHECK_BITS_SET_L(securityCaps,RMobilePhone::KCapsAccessPin2 ,KNoUnwantedBits, _L("RMobilePhone::GetSecurityCaps returned did not return KCapsAccessPin2 bits"));
       
   191 	
       
   192 	// Ensure the APN Control List Service Status is EAPNControlListServiceEnabled. 
       
   193 	RMobilePhone::TAPNControlListServiceStatus serviceApnControlListStatus;
       
   194 	TExtEtelRequestStatus setAPNControlListServiceStatus(mobilePhone, EMobilePhoneSetAPNControlListServiceStatus);
       
   195 	CleanupStack::PushL(setAPNControlListServiceStatus);
       
   196 	TExtEtelRequestStatus getAPNControlListServiceStatus(mobilePhone, EMobilePhoneGetAPNControlListServiceStatus);
       
   197 	CleanupStack::PushL(getAPNControlListServiceStatus);
       
   198 	mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
   199 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
   200 	CHECK_EQUALS_L(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
   201 	
       
   202 	if(serviceApnControlListStatus== RMobilePhone::EAPNControlListServiceDisabled)
       
   203 		{
       
   204 		// Enable the APN control List Service
       
   205 		serviceApnControlListStatus=RMobilePhone::EAPNControlListServiceEnabled;
       
   206 		mobilePhone.SetAPNControlListServiceStatus(setAPNControlListServiceStatus, serviceApnControlListStatus);
       
   207 		CHECK_EQUALS_L(WaitForRequestWithTimeOut(setAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus timed out"));
       
   208 		CHECK_EQUALS_L(setAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus returned with an error"));		
       
   209 			
       
   210 		// Get the APN Contol List Service Status again
       
   211 		mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
   212 		CHECK_EQUALS_L(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
   213 		CHECK_EQUALS_L(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
   214 		}
       
   215 		
       
   216 	CHECK_EQUALS_L(serviceApnControlListStatus, RMobilePhone::EAPNControlListServiceEnabled, _L("RMobilePhone::GetAPNControlListServiceStatus did not return EAPNControlListServiceEnabled status"));		
       
   217 	
       
   218 	// Ensure the APN list is empty.
       
   219 	EnsureApnListIsEmptyL(mobilePhone);
       
   220 
       
   221 	//
       
   222 	// SET UP END
       
   223 	//
       
   224 	
       
   225 	StartTest();
       
   226 	
       
   227 	//
       
   228 	// TEST START
       
   229 	//
       
   230 	
       
   231 	// ===  Append a name to the list ===
       
   232 	
       
   233 	// Post a notification RMobilePhone::NotifyAPNListChanged
       
   234 	TExtEtelRequestStatus notifyAPNListChangedStatus(mobilePhone, EMobilePhoneNotifyAPNListChanged);
       
   235 	CleanupStack::PushL(notifyAPNListChangedStatus);
       
   236 	mobilePhone.NotifyAPNListChanged(notifyAPNListChangedStatus); 
       
   237 	
       
   238 	// Append an APN name to the APN Control List using RMobilePhone::AppendAPNName 
       
   239 	RMobilePhone::TAPNEntryV3 myAPnEntry;
       
   240 	TBuf16<20> name = _L("WiFi");
       
   241 	myAPnEntry.iApn.Copy(name);
       
   242 	RMobilePhone::TAPNEntryV3Pckg myAPnEntryPckg(myAPnEntry);
       
   243 	TExtEtelRequestStatus appendAPNNameStatus(mobilePhone, EMobilePhoneAppendAPNName);
       
   244 	CleanupStack::PushL(appendAPNNameStatus);
       
   245 	mobilePhone.AppendAPNName(appendAPNNameStatus, myAPnEntryPckg);
       
   246 	ASSERT_EQUALS(WaitForRequestWithTimeOut(appendAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::AppendAPNName timed out"));
       
   247 	ASSERT_EQUALS(appendAPNNameStatus.Int(), KErrNone, _L("RMobilePhone::AppendAPNName returned with an error"));		
       
   248 	
       
   249 	// Check RMobilePhone::NotifyAPNListChanged completes with KErrNone
       
   250 	ASSERT_EQUALS(WaitForRequestWithTimeOut(notifyAPNListChangedStatus, ETimeMedium),KErrNone, _L("RMobilePhone::NotifyAPNListChanged timed out"));
       
   251 	ASSERT_EQUALS(notifyAPNListChangedStatus.Int(), KErrNone, _L("RMobilePhone::NotifyAPNListChanged returned with an error"));		
       
   252 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10014);
       
   253 			
       
   254 	// Check RMobilePhone::EnumerateAPNEntries returns aIndex = 1
       
   255 	TUint32 index= 0;
       
   256 	TExtEtelRequestStatus enumerateAPNEntriesStatus(mobilePhone, EMobilePhoneEnumerateAPNEntries);
       
   257 	CleanupStack::PushL(enumerateAPNEntriesStatus);
       
   258 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, index);
       
   259 	ASSERT_EQUALS(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
   260 	ASSERT_EQUALS(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
   261 	ASSERT_TRUE(index==1 , _L("RMobilePhone::EnumerateAPNEntries did not return the correct index number"));		
       
   262 		
       
   263 	// Check the first name written exists in the list
       
   264 	ASSERT_TRUE(CheckEntryIsInListL(mobilePhone,myAPnEntry, index), _L("CheckEntryIsInList was executed and expectedAPnEntry was not found"));
       
   265 
       
   266 	// ===  Append another name ===
       
   267 	
       
   268 	// Post a notification RMobilePhone::NotifyAPNListChanged
       
   269 	mobilePhone.NotifyAPNListChanged(notifyAPNListChangedStatus); 
       
   270 	
       
   271 	// Append an APN name to the APN Control List using RMobilePhone::AppendAPNName 
       
   272 	RMobilePhone::TAPNEntryV3 myAPnEntry2;
       
   273 	TBuf16<20> name2 = _L("GPRS");
       
   274 	myAPnEntry2.iApn.Copy(name2);
       
   275 	RMobilePhone::TAPNEntryV3Pckg myAPnEntryPckg2(myAPnEntry2);
       
   276 	mobilePhone.AppendAPNName(appendAPNNameStatus, myAPnEntryPckg2);
       
   277 	ASSERT_EQUALS(WaitForRequestWithTimeOut(appendAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::AppendAPNName timed out"));
       
   278 	ASSERT_EQUALS(appendAPNNameStatus.Int(), KErrNone, _L("RMobilePhone::AppendAPNName returned with an error"));		
       
   279 	
       
   280 	// Check RMobilePhone::NotifyAPNListChanged completes with KErrNone
       
   281 	ASSERT_EQUALS(WaitForRequestWithTimeOut(notifyAPNListChangedStatus, ETimeMedium),KErrNone, _L("RMobilePhone::NotifyAPNListChanged timed out"));
       
   282 	ASSERT_EQUALS(notifyAPNListChangedStatus.Int(), KErrNone, _L("RMobilePhone::NotifyAPNListChanged returned with an error"));		
       
   283 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10014);
       
   284 	
       
   285 	// Check RMobilePhone::EnumerateAPNEntries returns aIndex = 2
       
   286 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, index);
       
   287 	ASSERT_EQUALS(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
   288 	ASSERT_EQUALS(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
   289 	ASSERT_EQUALS((TInt)index, 2 , _L("RMobilePhone::EnumerateAPNEntries did not return the correct index number"));		
       
   290 	
       
   291 	// Check the first name that was written exists in the list
       
   292 	ASSERT_TRUE(CheckEntryIsInListL(mobilePhone,myAPnEntry, index), _L("CheckEntryIsInList was executed and expectedAPnEntry was not found"));
       
   293 
       
   294 	// Check the second name that was written exists in the list
       
   295 	ASSERT_TRUE(CheckEntryIsInListL(mobilePhone,myAPnEntry2, index), _L("CheckEntryIsInList was executed and expectedAPnEntry2 was not found"));
       
   296 	
       
   297 	//
       
   298 	// TEST END
       
   299 	//
       
   300 
       
   301     StartCleanup();
       
   302     
       
   303     EnsureApnListIsEmptyL(mobilePhone);
       
   304     // Pop:
       
   305     // backup
       
   306     // setAPNControlListServiceStatus
       
   307 	// getAPNControlListServiceStatus
       
   308 	// notifyAPNListChangedStatus
       
   309 	// appendAPNNameStatus
       
   310 	// enumerateAPNEntriesStatus
       
   311     CleanupStack::PopAndDestroy(6, &backup);
       
   312  
       
   313 	return TestStepResult();
       
   314 	}
       
   315 
       
   316 TPtrC CCTSYIntegrationTestAPNControlList0001::GetTestStepName()
       
   317 /**
       
   318  * @return The test step name.
       
   319  */
       
   320 	{
       
   321 	return _L("CCTSYIntegrationTestAPNControlList0001");
       
   322 	}
       
   323 
       
   324 
       
   325 
       
   326 CCTSYIntegrationTestAPNControlList0002::CCTSYIntegrationTestAPNControlList0002(CEtelSessionMgr& aEtelSessionMgr)
       
   327 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
   328 /**
       
   329  * Constructor.
       
   330  */
       
   331 	{
       
   332 	SetTestStepName(CCTSYIntegrationTestAPNControlList0002::GetTestStepName());
       
   333 	}
       
   334 
       
   335 CCTSYIntegrationTestAPNControlList0002::~CCTSYIntegrationTestAPNControlList0002()
       
   336 /**
       
   337  * Destructor.
       
   338  */
       
   339 	{
       
   340 	}
       
   341 
       
   342 TVerdict CCTSYIntegrationTestAPNControlList0002::doTestStepL()
       
   343 /**
       
   344  * @SYMTestCaseID BA-CTSY-INT-ACL-0002
       
   345  * @SYMFssID BA/CTSY/ACL-0002
       
   346  * @SYMTestCaseDesc Get APN name from the APN control list with an invalid index.
       
   347  * @SYMTestPriority High
       
   348  * @SYMTestActions RMobilePhone::EnumerateAPNEntries
       
   349  * @SYMTestExpectedResults Pass - Error returned when invalid index is specified.
       
   350  * @SYMTestType CIT
       
   351  * @SYMTestCaseDependencies live/manual
       
   352  *
       
   353  * Reason for test: Verify error is returned if an invalid index is specified.
       
   354  *
       
   355  * @return - TVerdict code
       
   356  */
       
   357 	{
       
   358 
       
   359 	//
       
   360 	// SET UP
       
   361 	//
       
   362 
       
   363 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   364 	
       
   365 	DisplayUserInteractionPromptL(KPrompt); // 30 seconds
       
   366 	
       
   367 	// Ensure the APN Control List Service Status is EAPNControlListServiceEnabled. 
       
   368 	RMobilePhone::TAPNControlListServiceStatus serviceApnControlListStatus;
       
   369 	TExtEtelRequestStatus setAPNControlListServiceStatus(mobilePhone, EMobilePhoneSetAPNControlListServiceStatus);
       
   370 	CleanupStack::PushL(setAPNControlListServiceStatus);
       
   371 	TExtEtelRequestStatus getAPNControlListServiceStatus(mobilePhone, EMobilePhoneGetAPNControlListServiceStatus);
       
   372 	CleanupStack::PushL(getAPNControlListServiceStatus);
       
   373 	mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
   374 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
   375 	CHECK_EQUALS_L(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
   376 	
       
   377 	iSimTestHelper.VerifyPin2L(mobilePhone,iNetworkTestHelper);	
       
   378 		
       
   379 	if(serviceApnControlListStatus== RMobilePhone::EAPNControlListServiceDisabled)
       
   380 		{
       
   381 		
       
   382 		serviceApnControlListStatus=RMobilePhone::EAPNControlListServiceEnabled;
       
   383 		mobilePhone.SetAPNControlListServiceStatus(setAPNControlListServiceStatus, serviceApnControlListStatus);
       
   384 		CHECK_EQUALS_L(WaitForRequestWithTimeOut(setAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus timed out"));
       
   385 		CHECK_EQUALS_L(setAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus returned with an error"));		
       
   386 			
       
   387 		// Get the APN Contol List Service Status again
       
   388 		mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
   389 		CHECK_EQUALS_L(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
   390 		CHECK_EQUALS_L(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
   391 		}
       
   392 	CHECK_EQUALS_L(serviceApnControlListStatus, RMobilePhone::EAPNControlListServiceEnabled, _L("RMobilePhone::GetAPNControlListServiceStatus did not return EAPNControlListServiceEnabled status"));		
       
   393 	
       
   394 	//
       
   395 	// SET UP END
       
   396 	//
       
   397 	
       
   398 	StartTest();
       
   399 	
       
   400 	//
       
   401 	// TEST START
       
   402 	//
       
   403 	
       
   404 	// Check Check RMobilePhone::EnumerateAPNEntries returns aIndex > 0
       
   405 	TUint32 index= 0;
       
   406 	TExtEtelRequestStatus enumerateAPNEntriesStatus(mobilePhone, EMobilePhoneEnumerateAPNEntries);
       
   407 	CleanupStack::PushL(enumerateAPNEntriesStatus);
       
   408 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, index);
       
   409 	ASSERT_EQUALS(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
   410 	ASSERT_EQUALS(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
   411 	ASSERT_TRUE(index>0 , _L("RMobilePhone::EnumerateAPNEntries did not return the correct index number"))		
       
   412 	
       
   413 	// Check RMobilePhone::GetAPNname with aIndex = -1 returns an error.
       
   414 	TUint invalidIndex= (TUint)-1;
       
   415 	RMobilePhone::TAPNEntryV3 myAPnEntry;
       
   416 	RMobilePhone::TAPNEntryV3Pckg myAPnEntryPckg(myAPnEntry);
       
   417 	TExtEtelRequestStatus getAPNnameStatus(mobilePhone, EMobilePhoneGetAPNname);
       
   418 	CleanupStack::PushL(getAPNnameStatus);
       
   419 	mobilePhone.GetAPNname(getAPNnameStatus,invalidIndex, myAPnEntryPckg);
       
   420 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getAPNnameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNname timed out"));
       
   421 	ASSERT_TRUE(getAPNnameStatus.Int()!=KErrNone, _L("RMobilePhone::GetAPNname did not return an error"))		
       
   422 		
       
   423 	// Check RMobilePhone::GetAPNname with aIndex = -10 returns an error.
       
   424 	invalidIndex= (TUint)-10;
       
   425 	mobilePhone.GetAPNname(getAPNnameStatus,invalidIndex, myAPnEntryPckg);
       
   426 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getAPNnameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNname timed out"));
       
   427 	ASSERT_TRUE(getAPNnameStatus.Int()!=KErrNone, _L("RMobilePhone::GetAPNname did not return an error"))		
       
   428 	
       
   429 	// Check RMobilePhone::GetAPNname with aIndex = 1000000 returns an error.
       
   430 	invalidIndex= 1000000;
       
   431 	mobilePhone.GetAPNname(getAPNnameStatus,invalidIndex, myAPnEntryPckg);
       
   432 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getAPNnameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNname timed out"));
       
   433 	ASSERT_TRUE(getAPNnameStatus.Int()!=KErrNone, _L("RMobilePhone::GetAPNname did not return an error"))		
       
   434 		
       
   435 	//
       
   436 	// TEST END
       
   437 	//
       
   438 
       
   439     StartCleanup();
       
   440 			
       
   441 	// Pop
       
   442 	// setAPNControlListServiceStatus
       
   443 	// getAPNControlListServiceStatus
       
   444 	// enumerateAPNEntriesStatus
       
   445 	// getAPNnameStatus
       
   446 	CleanupStack::PopAndDestroy(4,&setAPNControlListServiceStatus);
       
   447 
       
   448 	return TestStepResult();
       
   449 	}
       
   450 
       
   451 TPtrC CCTSYIntegrationTestAPNControlList0002::GetTestStepName()
       
   452 /**
       
   453  * @return The test step name.
       
   454  */
       
   455 	{
       
   456 	return _L("CCTSYIntegrationTestAPNControlList0002");
       
   457 	}
       
   458 
       
   459 
       
   460 
       
   461 CCTSYIntegrationTestAPNControlList0003::CCTSYIntegrationTestAPNControlList0003(CEtelSessionMgr& aEtelSessionMgr)
       
   462 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
   463 /**
       
   464  * Constructor.
       
   465  */
       
   466 	{
       
   467 	SetTestStepName(CCTSYIntegrationTestAPNControlList0003::GetTestStepName());
       
   468 	}
       
   469 
       
   470 CCTSYIntegrationTestAPNControlList0003::~CCTSYIntegrationTestAPNControlList0003()
       
   471 /**
       
   472  * Destructor.
       
   473  */
       
   474 	{
       
   475 	}
       
   476 
       
   477 TVerdict CCTSYIntegrationTestAPNControlList0003::doTestStepL()
       
   478 /**
       
   479  * @SYMTestCaseID BA-CTSY-INT-ACL-0003
       
   480  * @SYMFssID BA/CTSY/ACL-0003
       
   481  * @SYMTestCaseDesc Delete an entry from the APN control list.
       
   482  * @SYMTestPriority High
       
   483  * @SYMTestActions RMobilePhone::VerifySecurityCode, RMobilePhone::NotifySecurityEvent, RMobilePhone::NotifyAPNListChanged, RMobilePhone::GetAPNname, RMobilePhone::DeleteAPNName, RMobilePhone::AppendAPNName
       
   484  * @SYMTestExpectedResults Pass - An APN can be deleted from the APN control list.
       
   485  * @SYMTestType CIT
       
   486  * @SYMTestCaseDependencies live/manual
       
   487  *
       
   488  * Reason for test: Verify entry deleted, number of APN entries correct and APN notification completes.
       
   489  *
       
   490  * @return - TVerdict code
       
   491  */
       
   492 	{
       
   493 
       
   494 	//
       
   495 	// SET UP
       
   496 	//
       
   497 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   498 	
       
   499 	DisplayUserInteractionPromptL(KPrompt); // 30 seconds
       
   500 	
       
   501 	// Take the backup of APN Control list. 
       
   502 	TInt listCountAtStart;
       
   503 	TBackupAPNList backup(*this,mobilePhone);
       
   504 	CHECK_TRUE_L(backup.BackupL(listCountAtStart), _L("TBackupAPNList::Backup could not backup"));
       
   505 	CleanupStack::PushL (backup);
       
   506 	
       
   507 	// Ensure RMobilePhone::GetSecurityCaps returns caps in set of KCapsAccessPin2 
       
   508 	TUint32 securityCaps;
       
   509 	CHECK_EQUALS_L(mobilePhone.GetSecurityCaps(securityCaps), KErrNone,_L("RMobilePhone::GetSecurityCaps returned with an error"));
       
   510 	CHECK_BITS_SET_L(securityCaps,RMobilePhone::KCapsAccessPin2 ,KNoUnwantedBits, _L("RMobilePhone::GetSecurityCaps returned did not return KCapsAccessPin2 bits"));
       
   511 	
       
   512 	// 	Verify Pin2
       
   513 	iSimTestHelper.VerifyPin2L(mobilePhone, iNetworkTestHelper);
       
   514 	
       
   515 	// Ensure the APN Control List Service Status is EAPNControlListServiceEnabled. 
       
   516 	RMobilePhone::TAPNControlListServiceStatus serviceApnControlListStatus;
       
   517 	TExtEtelRequestStatus setAPNControlListServiceStatus(mobilePhone, EMobilePhoneSetAPNControlListServiceStatus);
       
   518 	CleanupStack::PushL(setAPNControlListServiceStatus);
       
   519 	TExtEtelRequestStatus getAPNControlListServiceStatus(mobilePhone, EMobilePhoneGetAPNControlListServiceStatus);
       
   520 	CleanupStack::PushL(getAPNControlListServiceStatus);
       
   521 	mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
   522 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
   523 	CHECK_EQUALS_L(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
   524 	if(serviceApnControlListStatus== RMobilePhone::EAPNControlListServiceDisabled)
       
   525 		{	
       
   526 		serviceApnControlListStatus=RMobilePhone::EAPNControlListServiceEnabled;
       
   527 		mobilePhone.SetAPNControlListServiceStatus(setAPNControlListServiceStatus, serviceApnControlListStatus);
       
   528 		CHECK_EQUALS_L(WaitForRequestWithTimeOut(setAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus timed out"));
       
   529 		CHECK_EQUALS_L(setAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus returned with an error"));		
       
   530 			
       
   531 		// Get the APN Contol List Service Status again
       
   532 		mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
   533 		CHECK_EQUALS_L(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
   534 		CHECK_EQUALS_L(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
   535 		}
       
   536 	CHECK_EQUALS_L(serviceApnControlListStatus, RMobilePhone::EAPNControlListServiceEnabled, _L("RMobilePhone::GetAPNControlListServiceStatus did not return EAPNControlListServiceEnabled status"));		
       
   537 	
       
   538 	// Ensure the APN list is empty. 
       
   539 	EnsureApnListIsEmptyL(mobilePhone);
       
   540 	//
       
   541 	// SET UP END
       
   542 	//
       
   543 	
       
   544 	StartTest();
       
   545 	
       
   546 	//
       
   547 	// TEST START
       
   548 	//
       
   549 	
       
   550 	// ===  Verify PIN2 and append a name to the list ===
       
   551 	
       
   552 	// Post a notification RMobilePhone::NotifyAPNListChanged
       
   553 	TExtEtelRequestStatus notifyAPNListChangedStatus(mobilePhone, EMobilePhoneNotifyAPNListChanged);
       
   554 	CleanupStack::PushL(notifyAPNListChangedStatus);
       
   555 	mobilePhone.NotifyAPNListChanged(notifyAPNListChangedStatus); 
       
   556 	
       
   557 	// Append an APN name to the APN Control List using RMobilePhone::AppendAPNName 
       
   558 	RMobilePhone::TAPNEntryV3 myAPnEntry;
       
   559 	TBuf16<20> name = _L("WiFi");
       
   560 	myAPnEntry.iApn.Copy(name);
       
   561 	RMobilePhone::TAPNEntryV3Pckg myAPnEntryPckg(myAPnEntry);
       
   562 	TExtEtelRequestStatus appendAPNNameStatus(mobilePhone, EMobilePhoneAppendAPNName);
       
   563 	CleanupStack::PushL(appendAPNNameStatus);
       
   564 	mobilePhone.AppendAPNName(appendAPNNameStatus, myAPnEntryPckg);
       
   565 	ASSERT_EQUALS(WaitForRequestWithTimeOut(appendAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::AppendAPNName timed out"));
       
   566 	ASSERT_EQUALS(appendAPNNameStatus.Int(), KErrNone, _L("RMobilePhone::AppendAPNName returned with an error"));		
       
   567 	
       
   568 	// Check RMobilePhone::NotifyAPNListChanged completes with KErrNone
       
   569 	ASSERT_EQUALS(WaitForRequestWithTimeOut(notifyAPNListChangedStatus, ETimeMedium),KErrNone, _L("RMobilePhone::NotifyAPNListChanged timed out"));
       
   570 	ASSERT_EQUALS(notifyAPNListChangedStatus.Int(), KErrNone, _L("RMobilePhone::NotifyAPNListChanged returned with an error"));
       
   571 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10014);		
       
   572 	
       
   573 	// Check RMobilePhone::EnumerateAPNEntries returns aIndex = 1
       
   574 	TUint32 index= 0;
       
   575 	TUint32 indexValue=0;
       
   576 	TExtEtelRequestStatus enumerateAPNEntriesStatus(mobilePhone, EMobilePhoneEnumerateAPNEntries);
       
   577 	CleanupStack::PushL(enumerateAPNEntriesStatus);
       
   578 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, index);
       
   579 	ASSERT_EQUALS(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
   580 	ASSERT_EQUALS(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
   581 	ASSERT_EQUALS((TInt)index, 1 , _L("RMobilePhone::EnumerateAPNEntries did not return the correct index number"));		
       
   582 	
       
   583 	// ===  Append another name ===
       
   584 	
       
   585 	// Post a notification RMobilePhone::NotifyAPNListChanged
       
   586 	mobilePhone.NotifyAPNListChanged(notifyAPNListChangedStatus); 
       
   587 	
       
   588 	// Append an APN name to the APN Control List using RMobilePhone::AppendAPNName 
       
   589 	RMobilePhone::TAPNEntryV3 myAPnEntry2;
       
   590 	TBuf16<20> name2 = _L("GPRS");
       
   591 	myAPnEntry2.iApn.Copy(name2);
       
   592 	RMobilePhone::TAPNEntryV3Pckg myAPnEntryPckg2(myAPnEntry2);
       
   593 	mobilePhone.AppendAPNName(appendAPNNameStatus, myAPnEntryPckg2);
       
   594 	ASSERT_EQUALS(WaitForRequestWithTimeOut(appendAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::AppendAPNName timed out"));
       
   595 	ASSERT_EQUALS(appendAPNNameStatus.Int(), KErrNone, _L("RMobilePhone::AppendAPNName returned with an error"));		
       
   596 	
       
   597 	// Check RMobilePhone::NotifyAPNListChanged completes with KErrNone
       
   598 	ASSERT_EQUALS(WaitForRequestWithTimeOut(notifyAPNListChangedStatus, ETimeMedium),KErrNone, _L("RMobilePhone::NotifyAPNListChanged timed out"));
       
   599 	ASSERT_EQUALS(notifyAPNListChangedStatus.Int(), KErrNone, _L("RMobilePhone::NotifyAPNListChanged returned with an error"));		
       
   600 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10014);		
       
   601 	
       
   602 	// Check RMobilePhone::EnumerateAPNEntries returns aIndex = 2
       
   603 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, index);
       
   604 	ASSERT_EQUALS(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeShort),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
   605 	ASSERT_EQUALS(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
   606 	ASSERT_EQUALS((int)index, 2 , _L("RMobilePhone::EnumerateAPNEntries did not return the correct index number"));		
       
   607 	
       
   608 	// ===  Delete first name written ===
       
   609 	
       
   610 	// Post a notification RMobilePhone::NotifyAPNListChanged
       
   611 	mobilePhone.NotifyAPNListChanged(notifyAPNListChangedStatus); 
       
   612 	
       
   613 	// Check the first written entry exists is in the APN list.
       
   614 	ASSERT_TRUE(CheckEntryIsInListL(mobilePhone,myAPnEntry, indexValue), _L("CheckEntryIsInList was executed and expectedAPnEntry was not found"));
       
   615 		
       
   616 	// Delete a first written APN name with RMobilePhone::DeleteAPNName
       
   617 	TExtEtelRequestStatus deleteAPNNameStatus(mobilePhone, EMobilePhoneDeleteAPNName);
       
   618 	CleanupStack::PushL(deleteAPNNameStatus);
       
   619 	mobilePhone.DeleteAPNName(deleteAPNNameStatus, indexValue);
       
   620 	ASSERT_EQUALS(WaitForRequestWithTimeOut(deleteAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::DeleteAPNName timed out"));
       
   621 	ASSERT_EQUALS(deleteAPNNameStatus.Int(), KErrNone, _L("RMobilePhone::DeleteAPNName returned with an error"));		
       
   622 	
       
   623 	// Check RMobilePhone::NotifyAPNListChanged completes with KErrNone
       
   624 	ASSERT_EQUALS(WaitForRequestWithTimeOut(notifyAPNListChangedStatus, ETimeShort),KErrNone, _L("RMobilePhone::NotifyAPNListChanged timed out"));
       
   625 	ASSERT_EQUALS(notifyAPNListChangedStatus.Int(), KErrNone, _L("RMobilePhone::NotifyAPNListChanged returned with an error"));		
       
   626 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10014);		
       
   627 	
       
   628 	// Check RMobilePhone::EnumerateAPNEntries returns aIndex = 1
       
   629 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, index);
       
   630 	ASSERT_EQUALS(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
   631 	ASSERT_EQUALS(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
   632 	ASSERT_EQUALS((int)index, 1 , _L("RMobilePhone::EnumerateAPNEntries did not return the correct index number"));		
       
   633 	
       
   634 	// Check first written entry does not exist and returns an error
       
   635 	ASSERT_TRUE(!(CheckEntryIsInListL(mobilePhone,myAPnEntry, indexValue)), _L("CheckEntryIsInList was executed and it did not return an error"));
       
   636 
       
   637 	// Check the second written entry exists is in the APN list.
       
   638 	ASSERT_TRUE(CheckEntryIsInListL(mobilePhone,myAPnEntry2, indexValue), _L("CheckEntryIsInList was executed and expectedAPnEntry was not found"));
       
   639 
       
   640 	// ===  Delete second name written ===
       
   641 
       
   642 	// Post a notification RMobilePhone::NotifyAPNListChanged
       
   643 	mobilePhone.NotifyAPNListChanged(notifyAPNListChangedStatus); 
       
   644 	
       
   645 	// Delete the second APN name entry with RMobilePhone::DeleteAPNName 
       
   646 	mobilePhone.DeleteAPNName(deleteAPNNameStatus, indexValue);
       
   647 	ASSERT_EQUALS(WaitForRequestWithTimeOut(deleteAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::DeleteAPNName timed out"));
       
   648 	ASSERT_EQUALS(deleteAPNNameStatus.Int(), KErrNone, _L("RMobilePhone::DeleteAPNName returned with an error"));		
       
   649 	
       
   650 	// Check RMobilePhone::NotifyAPNListChanged completes with KErrNone
       
   651 	ASSERT_EQUALS(WaitForRequestWithTimeOut(notifyAPNListChangedStatus, ETimeMedium),KErrNone, _L("RMobilePhone::NotifyAPNListChanged timed out"));
       
   652 	ASSERT_EQUALS(notifyAPNListChangedStatus.Int(), KErrNone, _L("RMobilePhone::NotifyAPNListChanged returned with an error"));		
       
   653 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10014);		
       
   654 		
       
   655 	// Check RMobilePhone::EnumerateAPNEntries returns aIndex = 0
       
   656 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, index);
       
   657 	ASSERT_EQUALS(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
   658 	ASSERT_EQUALS(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
   659 	ASSERT_TRUE(index==0 , _L("RMobilePhone::EnumerateAPNEntries did not return the correct index number"));		
       
   660 	
       
   661 	// Check first written entry does not exist and returns an error
       
   662 	ASSERT_TRUE(!(CheckEntryIsInListL(mobilePhone,myAPnEntry, indexValue)), _L("CheckEntryIsInList was executed and it did not return an error"));
       
   663 	
       
   664 	// Check second written entry does not exist and returns an error
       
   665 	ASSERT_TRUE(!(CheckEntryIsInListL(mobilePhone,myAPnEntry2, indexValue)), _L("CheckEntryIsInList was executed and it did not return an error"));
       
   666 	
       
   667 	//
       
   668 	// TEST END
       
   669 	//
       
   670 
       
   671     StartCleanup();
       
   672     
       
   673     EnsureApnListIsEmptyL(mobilePhone);
       
   674     
       
   675     // Pop
       
   676     // backup
       
   677     // setAPNControlListServiceStatus
       
   678     // getAPNControlListServiceStatus
       
   679     // notifyAPNListChangedStatus
       
   680     // appendAPNNameStatus
       
   681    	// enumerateAPNEntriesStatus
       
   682     // deleteAPNNameStatus
       
   683     CleanupStack::PopAndDestroy(7, &backup);
       
   684    
       
   685   	return TestStepResult();
       
   686 	}
       
   687 
       
   688 TPtrC CCTSYIntegrationTestAPNControlList0003::GetTestStepName()
       
   689 /**
       
   690  * @return The test step name.
       
   691  */
       
   692 	{
       
   693 	return _L("CCTSYIntegrationTestAPNControlList0003");
       
   694 	}
       
   695 
       
   696 
       
   697 
       
   698 CCTSYIntegrationTestAPNControlList0004::CCTSYIntegrationTestAPNControlList0004(CEtelSessionMgr& aEtelSessionMgr)
       
   699 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
   700 /**
       
   701  * Constructor.
       
   702  */
       
   703 	{
       
   704 	SetTestStepName(CCTSYIntegrationTestAPNControlList0004::GetTestStepName());
       
   705 	}
       
   706 
       
   707 CCTSYIntegrationTestAPNControlList0004::~CCTSYIntegrationTestAPNControlList0004()
       
   708 /**
       
   709  * Destructor.
       
   710  */
       
   711 	{
       
   712 	}
       
   713 
       
   714 TVerdict CCTSYIntegrationTestAPNControlList0004::doTestStepL()
       
   715 /**
       
   716  * @SYMTestCaseID BA-CTSY-INT-ACL-0004
       
   717  * @SYMFssID BA/CTSY/ACL-0004
       
   718  * @SYMTestCaseDesc Attempt to delete an entry from the APN control list with invalid index.
       
   719  * @SYMTestPriority High
       
   720  * @SYMTestActions RMobilePhone::VerifySecurityCode, RMobilePhone::NotifySecurityEvent, RMobilePhone::DeleteAPNName
       
   721  * @SYMTestExpectedResults Pass - Cannot delete entry from APN control list when index is invalid.
       
   722  * @SYMTestType CIT
       
   723  * @SYMTestCaseDependencies live/manual
       
   724  *
       
   725  * Reason for test: Verify error is returned and number of entries in APN control list does not change.
       
   726  *
       
   727  * @return - TVerdict code
       
   728  */
       
   729 	{
       
   730 
       
   731 	//
       
   732 	// SET UP
       
   733 	//
       
   734 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   735 	
       
   736 	DisplayUserInteractionPromptL(KPrompt); // 30 seconds
       
   737 	
       
   738 	// Ensure RMobilePhone::GetSecurityCaps returns caps in set of KCapsAccessPin2 
       
   739 	TUint32 securityCaps;
       
   740 	CHECK_EQUALS_L(mobilePhone.GetSecurityCaps(securityCaps), KErrNone,_L("RMobilePhone::GetSecurityCaps returned with an error"));
       
   741 	CHECK_BITS_SET_L(securityCaps,RMobilePhone::KCapsAccessPin2 ,KNoUnwantedBits, _L("RMobilePhone::GetSecurityCaps returned did not return KCapsAccessPin2 bits"));
       
   742 	
       
   743 	// Ensure the APN Control List Service Status is EAPNControlListServiceEnabled. 
       
   744 	RMobilePhone::TAPNControlListServiceStatus serviceApnControlListStatus;
       
   745 	TExtEtelRequestStatus setAPNControlListServiceStatus(mobilePhone, EMobilePhoneSetAPNControlListServiceStatus);
       
   746 	CleanupStack::PushL(setAPNControlListServiceStatus);
       
   747 	TExtEtelRequestStatus getAPNControlListServiceStatus(mobilePhone, EMobilePhoneGetAPNControlListServiceStatus);
       
   748 	CleanupStack::PushL(getAPNControlListServiceStatus);
       
   749 	mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
   750 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
   751 	CHECK_EQUALS_L(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
   752 	
       
   753 	iSimTestHelper.VerifyPin2L(mobilePhone, iNetworkTestHelper);
       
   754 	
       
   755 	if(serviceApnControlListStatus== RMobilePhone::EAPNControlListServiceDisabled)
       
   756 		{
       
   757 		serviceApnControlListStatus=RMobilePhone::EAPNControlListServiceEnabled;
       
   758 		mobilePhone.SetAPNControlListServiceStatus(setAPNControlListServiceStatus, serviceApnControlListStatus);
       
   759 		CHECK_EQUALS_L(WaitForRequestWithTimeOut(setAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus timed out"));
       
   760 		CHECK_EQUALS_L(setAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus returned with an error"));		
       
   761 			
       
   762 		// Get the APN Contol List Service Status again
       
   763 		mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
   764 		CHECK_EQUALS_L(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
   765 		CHECK_EQUALS_L(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
   766 		}
       
   767 	CHECK_EQUALS_L(serviceApnControlListStatus, RMobilePhone::EAPNControlListServiceEnabled, _L("RMobilePhone::GetAPNControlListServiceStatus did not return EAPNControlListServiceEnabled status"));		
       
   768 	
       
   769 	// Ensure APN Control List is not empty. 
       
   770 	TUint32 storeIndex;
       
   771 	TExtEtelRequestStatus enumerateAPNEntriesStatus(mobilePhone, EMobilePhoneEnumerateAPNEntries);
       
   772 	CleanupStack::PushL(enumerateAPNEntriesStatus);
       
   773 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, storeIndex);
       
   774 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
   775 	CHECK_EQUALS_L(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));	
       
   776 	if(storeIndex==0)
       
   777 		{
       
   778 		RMobilePhone::TAPNEntryV3 myAPnEntry;
       
   779 		TBuf16<20> name = _L("WiFi");
       
   780 		myAPnEntry.iApn.Copy(name);
       
   781 		RMobilePhone::TAPNEntryV3Pckg myAPnEntryPckg(myAPnEntry);
       
   782 		TExtEtelRequestStatus appendAPNNameStatus(mobilePhone, EMobilePhoneAppendAPNName);
       
   783 		CleanupStack::PushL(appendAPNNameStatus);
       
   784 		mobilePhone.AppendAPNName(appendAPNNameStatus, myAPnEntryPckg);
       
   785 		CHECK_EQUALS_L(WaitForRequestWithTimeOut(appendAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::AppendAPNName timed out"));
       
   786 		CHECK_EQUALS_L(appendAPNNameStatus.Int(), KErrNone, _L("RMobilePhone::AppendAPNName returned with an error"));		
       
   787 		}
       
   788 	CHECK_TRUE_L(storeIndex>0 , _L("RMobilePhone::EnumerateAPNEntries returned an empty list"));		
       
   789 	
       
   790 	// Ensure index 5 in the APN Control List is empty. 
       
   791 	CHECK_TRUE_L(storeIndex<5, _L("The desired Index in the APN Control List is not empty"));		
       
   792 	
       
   793 	//
       
   794 	// SET UP END
       
   795 	//
       
   796 	
       
   797 	StartTest();
       
   798 	
       
   799 	//
       
   800 	// TEST START
       
   801 	//
       
   802 	
       
   803 	// ===  Delete an entry which is empty ===
       
   804 	
       
   805 	// Check RMobilePhone::DeleteAPNName with aIndex = 5 returns an error
       
   806 	TUint32 index=5;
       
   807 	TExtEtelRequestStatus deleteAPNNameStatus(mobilePhone, EMobilePhoneDeleteAPNName);
       
   808 	CleanupStack::PushL(deleteAPNNameStatus);
       
   809 	mobilePhone.DeleteAPNName(deleteAPNNameStatus, index);
       
   810 	ASSERT_EQUALS(WaitForRequestWithTimeOut(deleteAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::DeleteAPNName timed out"));
       
   811 	ASSERT_TRUE(deleteAPNNameStatus.Int()!=KErrNone, _L("RMobilePhone::DeleteAPNName did not return an error"))	;	
       
   812 	
       
   813 	// Check RMobilePhone::EnumerateAPNEntries returns same aIndex as before
       
   814 	TUint32 checkIndex;
       
   815 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, checkIndex);
       
   816 	ASSERT_EQUALS(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
   817 	ASSERT_EQUALS(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
   818 	ASSERT_EQUALS(checkIndex, storeIndex , _L("RMobilePhone::EnumerateAPNEntries did not return the same index"));		
       
   819 	
       
   820 	// ===  Delete an entry which is negative ===
       
   821 	
       
   822 	// Check RMobilePhone::DeleteAPNName with aIndex = -1 returns KErrMMEtelAPNNameInvalidIndex
       
   823 	index= (TUint)-1;
       
   824 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10022);		
       
   825 	CHECK_EQUALS_L(1, 2, _L("This test has been made to leave intentially"));		
       
   826 	mobilePhone.DeleteAPNName(deleteAPNNameStatus, index);
       
   827 	ASSERT_EQUALS(WaitForRequestWithTimeOut(deleteAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::DeleteAPNName timed out"));
       
   828 	ASSERT_EQUALS(deleteAPNNameStatus.Int(), KErrMMEtelAPNNameInvalidIndex, _L("RMobilePhone::DeleteAPNName returned wrong error"));		
       
   829 	
       
   830 	// Check RMobilePhone::EnumerateAPNEntries returns same aIndex as before
       
   831 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, checkIndex);
       
   832 	ASSERT_EQUALS(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
   833 	ASSERT_EQUALS(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
   834 	ASSERT_EQUALS(checkIndex,storeIndex , _L("RMobilePhone::EnumerateAPNEntries did not returne the same index"));		
       
   835 	
       
   836 	
       
   837 	// ===  Delete an entry which is too high ===
       
   838 		
       
   839 	// Check RMobilePhone::DeleteAPNName with aIndex = 1000000 returns KErrMMEtelAPNNameInvalidIndex
       
   840 	index=1000000;
       
   841 	mobilePhone.DeleteAPNName(deleteAPNNameStatus, index);
       
   842 	ASSERT_EQUALS(WaitForRequestWithTimeOut(deleteAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::DeleteAPNName timed out"));
       
   843 	ASSERT_EQUALS(deleteAPNNameStatus.Int(), KErrMMEtelAPNNameInvalidIndex, _L("RMobilePhone::DeleteAPNName returned wrong error"));		
       
   844 	
       
   845 	// Check RMobilePhone::EnumerateAPNEntries returns same aIndex as before
       
   846 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, checkIndex);
       
   847 	ASSERT_EQUALS(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
   848 	ASSERT_EQUALS(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
   849 	ASSERT_EQUALS(checkIndex, storeIndex , _L("RMobilePhone::EnumerateAPNEntries did not return the same index"));		
       
   850 	
       
   851 	//
       
   852 	// TEST END
       
   853 	//
       
   854 
       
   855     StartCleanup();
       
   856     
       
   857     EnsureApnListIsEmptyL(mobilePhone);
       
   858     
       
   859     // Pop
       
   860     // setAPNControlListServiceStatus
       
   861     // getAPNControlListServiceStatus
       
   862     // enumerateAPNEntriesStatus
       
   863     // getAPNnameStatus
       
   864     // deleteAPNNameStatus
       
   865     CleanupStack::PopAndDestroy(5,&setAPNControlListServiceStatus); 
       
   866 
       
   867 	return TestStepResult();
       
   868 	}
       
   869 
       
   870 TPtrC CCTSYIntegrationTestAPNControlList0004::GetTestStepName()
       
   871 /**
       
   872  * @return The test step name.
       
   873  */
       
   874 	{
       
   875 	return _L("CCTSYIntegrationTestAPNControlList0004");
       
   876 	}
       
   877 
       
   878 
       
   879 
       
   880 CCTSYIntegrationTestAPNControlList0005::CCTSYIntegrationTestAPNControlList0005(CEtelSessionMgr& aEtelSessionMgr)
       
   881 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
   882 /**
       
   883  * Constructor.
       
   884  */
       
   885 	{
       
   886 	SetTestStepName(CCTSYIntegrationTestAPNControlList0005::GetTestStepName());
       
   887 	}
       
   888 
       
   889 CCTSYIntegrationTestAPNControlList0005::~CCTSYIntegrationTestAPNControlList0005()
       
   890 /**
       
   891  * Destructor.
       
   892  */
       
   893 	{
       
   894 	}
       
   895 
       
   896 TVerdict CCTSYIntegrationTestAPNControlList0005::doTestStepL()
       
   897 /**
       
   898  * @SYMTestCaseID BA-CTSY-INT-ACL-0005
       
   899  * @SYMFssID BA/CTSY/ACL-0005
       
   900  * @SYMTestCaseDesc Modify APN control list without verifying PIN2.
       
   901  * @SYMTestPriority High
       
   902  * @SYMTestActions RMobilePhone::DeleteAPNName, RMobilePhone::EnumerateAPNEntries
       
   903  * @SYMTestExpectedResults Pass - APN control list cannot be modified without PIN2.
       
   904  * @SYMTestType CIT
       
   905  * @SYMTestCaseDependencies live/manual
       
   906  *
       
   907  * Reason for test: Verify KErrGsm0707SimPin2Required is returned on attempt to append or delete a name.
       
   908  *
       
   909  * @return - TVerdict code
       
   910  */
       
   911 	{
       
   912 
       
   913 	//
       
   914 	// SET UP
       
   915 	//
       
   916 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   917 	
       
   918 	DisplayUserInteractionPromptL(KPrompt); // 30 seconds
       
   919 	
       
   920 	// Check the APN Control List Service Status is EAPNControlListServiceEnabled. 
       
   921 	RMobilePhone::TAPNControlListServiceStatus serviceApnControlListStatus;
       
   922 	TExtEtelRequestStatus getAPNControlListServiceStatus(mobilePhone, EMobilePhoneGetAPNControlListServiceStatus);
       
   923 	CleanupStack::PushL(getAPNControlListServiceStatus);
       
   924 	mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
   925 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
   926 	CHECK_EQUALS_L(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
   927 	CHECK_EQUALS_L(serviceApnControlListStatus, RMobilePhone::EAPNControlListServiceEnabled, _L("RMobilePhone::GetAPNControlListServiceStatus did not return EAPNControlListServiceEnabled status"));		
       
   928 	
       
   929 	//
       
   930 	// SET UP END
       
   931 	//
       
   932 	
       
   933 	StartTest();
       
   934 	
       
   935 	//
       
   936 	// TEST START
       
   937 	//
       
   938 	
       
   939 	
       
   940 	// ===  Get the number of APN entries ===
       
   941 
       
   942 	// Check RMobilePhone::EnumerateAPNEntries returns aIndex >= 0 (store aIndex for later)
       
   943 	TUint32 storeIndex;
       
   944 	TExtEtelRequestStatus enumerateAPNEntriesStatus(mobilePhone, EMobilePhoneEnumerateAPNEntries);
       
   945 	CleanupStack::PushL(enumerateAPNEntriesStatus);
       
   946 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, storeIndex);
       
   947 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
   948 	CHECK_EQUALS_L(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
   949 	CHECK_TRUE_L((int)storeIndex>=0 , _L("RMobilePhone::EnumerateAPNEntries returned an empty list"));		
       
   950 
       
   951 	// ===  Attempt to append an APN name without PIN2 ===
       
   952 
       
   953 	// Check RMobilePhone::AppendAPNName with a valid name returns KErrGsm0707SimPin2Required or KErrAccessDenied
       
   954 	RMobilePhone::TAPNEntryV3 myAPnEntry;
       
   955 	TBuf16<20> name = _L("WiFi");
       
   956 	myAPnEntry.iApn.Copy(name);
       
   957 	RMobilePhone::TAPNEntryV3Pckg myAPnEntryPckg(myAPnEntry);
       
   958 	TExtEtelRequestStatus appendAPNNameStatus(mobilePhone, EMobilePhoneAppendAPNName);
       
   959 	CleanupStack::PushL(appendAPNNameStatus);
       
   960 	mobilePhone.AppendAPNName(appendAPNNameStatus, myAPnEntryPckg);
       
   961 	ASSERT_EQUALS(WaitForRequestWithTimeOut(appendAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::AppendAPNName timed out"));
       
   962 	ASSERT_TRUE((appendAPNNameStatus.Int()==KErrGsm0707SimPin2Required || appendAPNNameStatus.Int()== KErrAccessDenied) , _L("RMobilePhone::AppendAPNName did not return an error"));		
       
   963 
       
   964 	
       
   965 	// Check RMobilePhone::EnumerateAPNEntries returns same aIndex as before
       
   966 	TUint32 checkIndex;
       
   967 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, checkIndex);
       
   968 	ASSERT_EQUALS(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
   969 	ASSERT_EQUALS(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
   970 	ASSERT_EQUALS(checkIndex, storeIndex , _L("RMobilePhone::EnumerateAPNEntries did not return the same index"));		
       
   971 	
       
   972 	// ===  Attempt to delete an APN name without PIN2 ===
       
   973 
       
   974 	// Check RMobilePhone::DeleteAPNName with a valid index returns KErrGsm0707SimPin2Required
       
   975 	TUint32 indexValue=0;
       
   976 	TExtEtelRequestStatus deleteAPNNameStatus(mobilePhone, EMobilePhoneDeleteAPNName);
       
   977 	CleanupStack::PushL(deleteAPNNameStatus);
       
   978 	mobilePhone.DeleteAPNName(deleteAPNNameStatus, indexValue);
       
   979 	ASSERT_EQUALS(WaitForRequestWithTimeOut(deleteAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::DeleteAPNName timed out"));
       
   980 	ASSERT_TRUE((deleteAPNNameStatus.Int()==KErrGsm0707SimPin2Required || deleteAPNNameStatus.Int()== KErrAccessDenied) , _L("RMobilePhone::DeleteAPNName did not return an error"));		
       
   981 
       
   982 	
       
   983 	// Check RMobilePhone::EnumerateAPNEntries returns same aIndex as before
       
   984 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, checkIndex);
       
   985 	ASSERT_EQUALS(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
   986 	ASSERT_EQUALS(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
   987 	ASSERT_EQUALS(checkIndex, storeIndex , _L("RMobilePhone::EnumerateAPNEntries did not return the same index"));		
       
   988 	
       
   989 	//
       
   990 	// TEST END
       
   991 	//
       
   992 
       
   993     StartCleanup();
       
   994 	
       
   995 	// Pop:
       
   996 	// getAPNControlListServiceStatus
       
   997 	// enumerateAPNEntriesStatus
       
   998 	// appendAPNNameStatus
       
   999 	// deleteAPNNameStatus
       
  1000 	
       
  1001 	CleanupStack::PopAndDestroy(4, &getAPNControlListServiceStatus);
       
  1002 
       
  1003 			
       
  1004 	return TestStepResult();
       
  1005 	}
       
  1006 
       
  1007 TPtrC CCTSYIntegrationTestAPNControlList0005::GetTestStepName()
       
  1008 /**
       
  1009  * @return The test step name.
       
  1010  */
       
  1011 	{
       
  1012 	return _L("CCTSYIntegrationTestAPNControlList0005");
       
  1013 	}
       
  1014 
       
  1015 
       
  1016 
       
  1017 CCTSYIntegrationTestAPNControlList0006::CCTSYIntegrationTestAPNControlList0006(CEtelSessionMgr& aEtelSessionMgr)
       
  1018 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
  1019 /**
       
  1020  * Constructor.
       
  1021  */
       
  1022 	{
       
  1023 	SetTestStepName(CCTSYIntegrationTestAPNControlList0006::GetTestStepName());
       
  1024 	}
       
  1025 
       
  1026 CCTSYIntegrationTestAPNControlList0006::~CCTSYIntegrationTestAPNControlList0006()
       
  1027 /**
       
  1028  * Destructor.
       
  1029  */
       
  1030 	{
       
  1031 	}
       
  1032 
       
  1033 TVerdict CCTSYIntegrationTestAPNControlList0006::doTestStepL()
       
  1034 /**
       
  1035  * @SYMTestCaseID BA-CTSY-INT-ACL-0006
       
  1036  * @SYMFssID BA/CTSY/ACL-0006
       
  1037  * @SYMTestCaseDesc Enable and disable the APN control list service.
       
  1038  * @SYMTestPriority High
       
  1039  * @SYMTestActions RMobilePhone::NotifySecurityEvent, RMobilePhone::GetAPNControlListServiceStatus, RMobilePhone::SetAPNControlListServiceStatus, RMobilePhone::NotifyAPNControlListServiceStatusChange
       
  1040  * @SYMTestExpectedResults Pass - APN control list can be enabled and disabled.
       
  1041  * @SYMTestType CIT
       
  1042  * @SYMTestCaseDependencies live/manual
       
  1043  *
       
  1044  * Reason for test: Verify control list service status and notification.
       
  1045  *
       
  1046  * @return - TVerdict code
       
  1047  */
       
  1048 	{
       
  1049 
       
  1050 	//
       
  1051 	// SET UP
       
  1052 	//
       
  1053 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1054 	
       
  1055 	DisplayUserInteractionPromptL(KPrompt); // 30 seconds
       
  1056 	
       
  1057 	// Verify Pin2
       
  1058 	iSimTestHelper.VerifyPin2L(mobilePhone,iNetworkTestHelper);
       
  1059 	
       
  1060 	// Ensure the APN Control List Service Status is EAPNControlListServiceDisabled 
       
  1061 	RMobilePhone::TAPNControlListServiceStatus serviceApnControlListStatus;
       
  1062 	TExtEtelRequestStatus setAPNControlListServiceStatus(mobilePhone, EMobilePhoneSetAPNControlListServiceStatus);
       
  1063 	CleanupStack::PushL(setAPNControlListServiceStatus);
       
  1064 	TExtEtelRequestStatus getAPNControlListServiceStatus(mobilePhone, EMobilePhoneGetAPNControlListServiceStatus);
       
  1065 	CleanupStack::PushL(getAPNControlListServiceStatus);
       
  1066 	mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
  1067 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
  1068 	CHECK_EQUALS_L(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
  1069 	if(serviceApnControlListStatus== RMobilePhone::EAPNControlListServiceEnabled)
       
  1070 		{	
       
  1071 		serviceApnControlListStatus=RMobilePhone::EAPNControlListServiceDisabled;
       
  1072 		mobilePhone.SetAPNControlListServiceStatus(setAPNControlListServiceStatus, serviceApnControlListStatus);
       
  1073 		CHECK_EQUALS_L(WaitForRequestWithTimeOut(setAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus timed out"));
       
  1074 		CHECK_EQUALS_L(setAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus returned with an error"));		
       
  1075 			
       
  1076 		// Get the APN Contol List Service Status again
       
  1077 		mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
  1078 		CHECK_EQUALS_L(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
  1079 		CHECK_EQUALS_L(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
  1080 		}
       
  1081 	
       
  1082 	CHECK_EQUALS_L(serviceApnControlListStatus, RMobilePhone::EAPNControlListServiceDisabled, _L("RMobilePhone::GetAPNControlListServiceStatus did not return EAPNControlListServiceDisabled status"));		
       
  1083 
       
  1084 	//
       
  1085 	// SET UP END
       
  1086 	//
       
  1087 	
       
  1088 	StartTest();
       
  1089 	
       
  1090 	//
       
  1091 	// TEST START
       
  1092 	//
       
  1093 		
       
  1094 
       
  1095 	// ===  Enable the APN control list service ===
       
  1096 
       
  1097 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10019);
       
  1098 	CHECK_EQUALS_L(1, 2, _L("This test has been made to leave intentially"));		
       
  1099 	
       
  1100 	// Call RMobilePhone::NotifyAPNControlListServiceStatusChange 
       
  1101 	TExtEtelRequestStatus notifyAPNControlListServiceStatusChangeStatus(mobilePhone, EMobilePhoneNotifyAPNControlListServiceStatusChange);
       
  1102 	CleanupStack::PushL(notifyAPNControlListServiceStatusChangeStatus);
       
  1103 	mobilePhone.NotifyAPNControlListServiceStatusChange(notifyAPNControlListServiceStatusChangeStatus, serviceApnControlListStatus); 
       
  1104 	
       
  1105 	// Enable the APN control list service with RMobilePhone::SetAPNControlListServiceStatus with aAPNControlListServiceStatus = EAPNControlListServiceEnabled 
       
  1106 	RMobilePhone::TAPNControlListServiceStatus aPNControlListServiceStatus2=RMobilePhone::EAPNControlListServiceEnabled;
       
  1107 	mobilePhone.SetAPNControlListServiceStatus(setAPNControlListServiceStatus, aPNControlListServiceStatus2);
       
  1108 	ASSERT_EQUALS(WaitForRequestWithTimeOut(setAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus timed out"));
       
  1109 	ASSERT_EQUALS(setAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus returned with an error"));		
       
  1110 	
       
  1111     // Check RMobilePhone::NotifyAPNControlListServiceStatusChange completes with aAPNControlListServiceStatus = EAPNControlListServiceEnabled
       
  1112 	TInt wantedStatus= KErrNone;
       
  1113 	RMobilePhone::TAPNControlListServiceStatus expectedAPNControlListServiceStatus= RMobilePhone::EAPNControlListServiceEnabled;
       
  1114 	iNetworkTestHelper.WaitForMobilePhoneNotifyAPNControlListServiceStatusChange(mobilePhone,
       
  1115 																		  notifyAPNControlListServiceStatusChangeStatus,
       
  1116 																          serviceApnControlListStatus, 
       
  1117 																		  expectedAPNControlListServiceStatus,
       
  1118 																		  wantedStatus );
       
  1119 	
       
  1120 	// ===  Get the service status ===
       
  1121 	
       
  1122 	// Check RMobilePhone::GetAPNControlListServiceStatus returns aAPNControlListServiceStatus = EAPNControlListServiceEnabled
       
  1123 	mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
  1124 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
  1125 	ASSERT_EQUALS(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
  1126 	ASSERT_EQUALS(serviceApnControlListStatus, RMobilePhone::EAPNControlListServiceEnabled, _L("RMobilePhone::GetAPNControlListServiceStatus did not return EAPNControlListServiceEnabled status"));		
       
  1127 	
       
  1128 	// ===  Disable the APN control list service ===
       
  1129 			
       
  1130 	// Verify Pin2
       
  1131 	iSimTestHelper.VerifyPin2L(mobilePhone,iNetworkTestHelper);			
       
  1132 	
       
  1133 	// Post notifier RMobilePhone::NotifyAPNControlListServiceStatusChange 
       
  1134 	mobilePhone.NotifyAPNControlListServiceStatusChange(notifyAPNControlListServiceStatusChangeStatus, serviceApnControlListStatus); 
       
  1135 
       
  1136 	// Disable the APN control list service with RMobilePhone::SetAPNControlListServiceStatus with aAPNControlListServiceStatus = EAPNControlListServiceDisabled 
       
  1137 	RMobilePhone::TAPNControlListServiceStatus aPNControlListServiceStatus3= RMobilePhone::EAPNControlListServiceDisabled;
       
  1138 	mobilePhone.SetAPNControlListServiceStatus(setAPNControlListServiceStatus, aPNControlListServiceStatus3);
       
  1139 	ASSERT_EQUALS(WaitForRequestWithTimeOut(setAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus timed out"));
       
  1140 	ASSERT_EQUALS(setAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus returned with an error"));		
       
  1141 	
       
  1142 		
       
  1143 	// Check RMobilePhone::NotifyAPNControlListServiceStatusChange completes with aAPNControlListServiceStatus = EAPNControlListServiceDisabled
       
  1144 	expectedAPNControlListServiceStatus= RMobilePhone::EAPNControlListServiceDisabled;
       
  1145 	wantedStatus= KErrNone;
       
  1146 	iNetworkTestHelper.WaitForMobilePhoneNotifyAPNControlListServiceStatusChange(mobilePhone,
       
  1147 																		  notifyAPNControlListServiceStatusChangeStatus,
       
  1148 																          serviceApnControlListStatus, 
       
  1149 																		  expectedAPNControlListServiceStatus,
       
  1150 																		  wantedStatus );
       
  1151 	
       
  1152 	// ===  Get the service status ===
       
  1153 
       
  1154 	// Check RMobilePhone::GetAPNControlListServiceStatus returns aAPNControlListServiceStatus = EAPNControlListServiceDisabled
       
  1155 	mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
  1156 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
  1157 	ASSERT_EQUALS(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
  1158 	ASSERT_EQUALS(serviceApnControlListStatus, RMobilePhone::EAPNControlListServiceDisabled, _L("RMobilePhone::GetAPNControlListServiceStatus did not return EAPNControlListServiceDisabled status"));		
       
  1159 	
       
  1160 	//
       
  1161 	// TEST END
       
  1162 	//
       
  1163 
       
  1164     StartCleanup();
       
  1165   
       
  1166     // Pop:
       
  1167     // setAPNControlListServiceStatus
       
  1168     // getAPNControlListServiceStatus
       
  1169     // notifyAPNControlListServiceStatusChangeStatus
       
  1170     
       
  1171     CleanupStack::PopAndDestroy(3, &setAPNControlListServiceStatus);
       
  1172     
       
  1173     return TestStepResult();
       
  1174 	}
       
  1175 
       
  1176 TPtrC CCTSYIntegrationTestAPNControlList0006::GetTestStepName()
       
  1177 /**
       
  1178  * @return The test step name.
       
  1179  */
       
  1180 	{
       
  1181 	return _L("CCTSYIntegrationTestAPNControlList0006");
       
  1182 	}
       
  1183 
       
  1184 
       
  1185 
       
  1186 CCTSYIntegrationTestAPNControlList0007::CCTSYIntegrationTestAPNControlList0007(CEtelSessionMgr& aEtelSessionMgr)
       
  1187 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
  1188 /**
       
  1189  * Constructor.
       
  1190  */
       
  1191 	{
       
  1192 	SetTestStepName(CCTSYIntegrationTestAPNControlList0007::GetTestStepName());
       
  1193 	}
       
  1194 
       
  1195 CCTSYIntegrationTestAPNControlList0007::~CCTSYIntegrationTestAPNControlList0007()
       
  1196 /**
       
  1197  * Destructor.
       
  1198  */
       
  1199 	{
       
  1200 	}
       
  1201 
       
  1202 TVerdict CCTSYIntegrationTestAPNControlList0007::doTestStepL()
       
  1203 /**
       
  1204  * @SYMTestCaseID BA-CTSY-INT-ACL-0007
       
  1205  * @SYMFssID BA/CTSY/ACL-0007
       
  1206  * @SYMTestCaseDesc Enable and disable the APN control list without verifying PIN2.
       
  1207  * @SYMTestPriority High
       
  1208  * @SYMTestActions 
       
  1209  * @SYMTestExpectedResults Pass - APN control list service cannot be enabled / disabled without PIN2.
       
  1210  * @SYMTestType CIT
       
  1211  * @SYMTestCaseDependencies live/manual
       
  1212  *
       
  1213  * Reason for test: Verify KErrGsm0707SimPin2Required is returned on attempt to enable or disable the service.
       
  1214  *
       
  1215  * @return - TVerdict code
       
  1216  */
       
  1217 	{
       
  1218 	
       
  1219 	//
       
  1220 	// SET UP
       
  1221 	//
       
  1222 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1223 	
       
  1224 	DisplayUserInteractionPromptL(KPrompt); // 30 seconds
       
  1225 	
       
  1226 	// Ensure RMobilePhone::GetSecurityCaps returns caps in set of KCapsAccessPin2 
       
  1227 	TUint32 securityCaps;
       
  1228 	CHECK_EQUALS_L(mobilePhone.GetSecurityCaps(securityCaps), KErrNone,_L("RMobilePhone::GetSecurityCaps returned with an error"));
       
  1229 	CHECK_BITS_SET_L(securityCaps,RMobilePhone::KCapsAccessPin2 ,KNoUnwantedBits, _L("RMobilePhone::GetSecurityCaps returned did not return KCapsAccessPin2 bits"));
       
  1230 
       
  1231 	//
       
  1232 	// SET UP END
       
  1233 	//
       
  1234 	
       
  1235 	StartTest();
       
  1236 	
       
  1237 	//
       
  1238 	// TEST START
       
  1239 	//
       
  1240 	
       
  1241 	// Check APN Control List Service Status 
       
  1242 	RMobilePhone::TAPNControlListServiceStatus serviceApnControlListStatus;
       
  1243 	TExtEtelRequestStatus getAPNControlListServiceStatus(mobilePhone, EMobilePhoneGetAPNControlListServiceStatus);
       
  1244 	CleanupStack::PushL(getAPNControlListServiceStatus);
       
  1245 	mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
  1246 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
  1247 	ASSERT_EQUALS(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
  1248 		
       
  1249 	TExtEtelRequestStatus setAPNControlListServiceStatus(mobilePhone, EMobilePhoneSetAPNControlListServiceStatus);
       
  1250 	CleanupStack::PushL(setAPNControlListServiceStatus);
       
  1251 	
       
  1252 	// If APN list service is already diasbaled then check RMobilePhone::SetAPNControlListServiceStatus with aAPNControlListServiceStatus = EAPNControlListServiceEnabled returns KErrGsm0707SimPin2Required  
       
  1253 	if(serviceApnControlListStatus==RMobilePhone::EAPNControlListServiceDisabled)
       
  1254 		{
       
  1255 		// Check RMobilePhone::SetAPNControlListServiceStatus with aAPNControlListServiceStatus = EAPNControlListServiceEnabled returns KErrGsm0707SimPin2Required
       
  1256 		RMobilePhone::TAPNControlListServiceStatus aPNControlListServiceStatus1=RMobilePhone::EAPNControlListServiceEnabled;
       
  1257 		mobilePhone.SetAPNControlListServiceStatus(setAPNControlListServiceStatus, aPNControlListServiceStatus1);
       
  1258 		ASSERT_EQUALS(WaitForRequestWithTimeOut(setAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus timed out"));
       
  1259 		ASSERT_TRUE((setAPNControlListServiceStatus.Int()== KErrNone||setAPNControlListServiceStatus.Int()== KErrAccessDenied || setAPNControlListServiceStatus.Int()==KErrGsm0707SimPin2Required) , _L("RMobilePhone::SetAPNControlListServiceStatus did not return an error"));		
       
  1260 		DEBUG_PRINTF1(_L("<font color=Orange>$CTSYProblem RMobilePhone::SetAPNControlListServiceStatus disables the APN control list without verifying Pin2.\n KErrNone is returned instead of an access error. This problem occurs when it is tried to disable the already disabled APN control list</font> "));
       
  1261 		
       
  1262 		}
       
  1263 	// If APN list service is already enabled then check RMobilePhone::SetAPNControlListServiceStatus with aAPNControlListServiceStatus = EAPNControlListServiceDisabled returns KErrGsm0707SimPin2Required        
       
  1264 	else
       
  1265 		{
       
  1266 		// Check RMobilePhone::SetAPNControlListServiceStatus with aAPNControlListServiceStatus = EAPNControlListServiceDisabled returns KErrGsm0707SimPin2Required
       
  1267 		RMobilePhone::TAPNControlListServiceStatus aPNControlListServiceStatus2= RMobilePhone::EAPNControlListServiceDisabled;
       
  1268 		mobilePhone.SetAPNControlListServiceStatus(setAPNControlListServiceStatus, aPNControlListServiceStatus2);
       
  1269 		ASSERT_EQUALS(WaitForRequestWithTimeOut(setAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus timed out"));
       
  1270 		ASSERT_TRUE((setAPNControlListServiceStatus.Int()== KErrNone||setAPNControlListServiceStatus.Int()== KErrAccessDenied || setAPNControlListServiceStatus.Int()== KErrGsm0707SimPin2Required) , _L("RMobilePhone::SetAPNControlListServiceStatus did not return an error (II)"));		
       
  1271 		DEBUG_PRINTF1(_L("<font color=Orange>$CTSYProblem RMobilePhone::SetAPNControlListServiceStatus enables the APN control list without verifying Pin2.\n KErrNone is returned instead of an access error. This	problem occurs when it is tried to enable the already enabled APN control list</font> "));
       
  1272 		}
       
  1273 	
       
  1274 
       
  1275 	//
       
  1276 	// TEST END
       
  1277 	//
       
  1278 
       
  1279     StartCleanup();
       
  1280 	
       
  1281 	// Pop:
       
  1282 	// getAPNControlListServiceStatus
       
  1283 	// setAPNControlListServiceStatus
       
  1284 	CleanupStack::PopAndDestroy(2, &getAPNControlListServiceStatus);
       
  1285 		
       
  1286 	
       
  1287 	
       
  1288 	return TestStepResult();
       
  1289 	}
       
  1290 
       
  1291 TPtrC CCTSYIntegrationTestAPNControlList0007::GetTestStepName()
       
  1292 /**
       
  1293  * @return The test step name.
       
  1294  */
       
  1295 	{
       
  1296 	return _L("CCTSYIntegrationTestAPNControlList0007");
       
  1297 	}
       
  1298 
       
  1299 
       
  1300 
       
  1301 CCTSYIntegrationTestAPNControlList0008::CCTSYIntegrationTestAPNControlList0008(CEtelSessionMgr& aEtelSessionMgr)
       
  1302 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
  1303 /**
       
  1304  * Constructor.
       
  1305  */
       
  1306 	{
       
  1307 	SetTestStepName(CCTSYIntegrationTestAPNControlList0008::GetTestStepName());
       
  1308 	}
       
  1309 
       
  1310 CCTSYIntegrationTestAPNControlList0008::~CCTSYIntegrationTestAPNControlList0008()
       
  1311 /**
       
  1312  * Destructor.
       
  1313  */
       
  1314 	{
       
  1315 	}
       
  1316 
       
  1317 TVerdict CCTSYIntegrationTestAPNControlList0008::doTestStepL()
       
  1318 /**
       
  1319  * @SYMTestCaseID BA-CTSY-INT-ACL-0008
       
  1320  * @SYMFssID BA/CTSY/ACL-0008
       
  1321  * @SYMTestCaseDesc Add an entry to the APN control list when the list on USIM is full.
       
  1322  * @SYMTestPriority High
       
  1323  * @SYMTestActions 
       
  1324  * @SYMTestExpectedResults Pass - Cannot append to APN control list when it is full.
       
  1325  * @SYMTestType CIT
       
  1326  * @SYMTestCaseDependencies live/manual
       
  1327  *
       
  1328  * Reason for test: Verify KErrMMEtelAPNNameAPNListFull is returned on attempt to append an entry to a full SIM.
       
  1329  *
       
  1330  * @return - TVerdict code
       
  1331  */
       
  1332 	{
       
  1333 
       
  1334 	//
       
  1335 	// SET UP
       
  1336 	//
       
  1337 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1338 	
       
  1339 	DisplayUserInteractionPromptL(KPrompt); // 30 seconds
       
  1340 	
       
  1341 	// Take the backup of APN Control list. 
       
  1342 	TInt listCountAtStart;
       
  1343 	TBackupAPNList backup(*this,mobilePhone);
       
  1344 	CHECK_TRUE_L(backup.BackupL(listCountAtStart), _L("TBackupAPNList::Backup could not backup"));
       
  1345 	CleanupStack::PushL (backup);
       
  1346 	
       
  1347 	// Verfiy Pin2
       
  1348 	iSimTestHelper.VerifyPin2L(mobilePhone, iNetworkTestHelper);
       
  1349 	
       
  1350 	// Insert USIM with full APN control list.
       
  1351 	RMobilePhone::TAPNEntryV3 myAPnEntry;
       
  1352 	TBuf16<20> name = _L("WiFi");
       
  1353 	myAPnEntry.iApn.Copy(name);
       
  1354 	RMobilePhone::TAPNEntryV3Pckg myAPnEntryPckg(myAPnEntry);
       
  1355 	TExtEtelRequestStatus appendAPNNameStatus(mobilePhone, EMobilePhoneAppendAPNName);
       
  1356 	CleanupStack::PushL(appendAPNNameStatus);
       
  1357 	do
       
  1358 		{
       
  1359 		mobilePhone.AppendAPNName(appendAPNNameStatus, myAPnEntryPckg);
       
  1360 		ASSERT_EQUALS(WaitForRequestWithTimeOut(appendAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::AppendAPNName timed out"));
       
  1361 		}while(appendAPNNameStatus.Int()==KErrNone);
       
  1362 	
       
  1363 	// Ensure RMobilePhone::GetSecurityCaps returns caps in set of KCapsAccessPin2  
       
  1364 	TUint32 securityCaps;
       
  1365 	CHECK_EQUALS_L(mobilePhone.GetSecurityCaps(securityCaps), KErrNone,_L("RMobilePhone::GetSecurityCaps returned with an error"));
       
  1366 	CHECK_BITS_SET_L(securityCaps,RMobilePhone::KCapsAccessPin2 ,KNoUnwantedBits, _L("RMobilePhone::GetSecurityCaps returned did not return KCapsAccessPin2 bits"));
       
  1367 	
       
  1368 	//
       
  1369 	// SET UP END
       
  1370 	//
       
  1371 	
       
  1372 	StartTest();
       
  1373 	
       
  1374 	//
       
  1375 	// TEST START
       
  1376 	//
       
  1377 	
       
  1378 	
       
  1379 	// ===  Get the number of entries in the APN control list ===
       
  1380 
       
  1381 	// Check RMobilePhone::EnumerateAPNEntries returns aIndex >= 0 (store aIndex for later)
       
  1382 	TUint32 storeIndex;
       
  1383 	TExtEtelRequestStatus enumerateAPNEntriesStatus(mobilePhone, EMobilePhoneEnumerateAPNEntries);
       
  1384 	CleanupStack::PushL(enumerateAPNEntriesStatus);
       
  1385 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, storeIndex);
       
  1386 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
  1387 	CHECK_EQUALS_L(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
  1388 	CHECK_TRUE_L((int)storeIndex>=0 , _L("RMobilePhone::EnumerateAPNEntries returned an empty list"));		
       
  1389 
       
  1390 	// ===  Attempt to add another entry to the full list ===
       
  1391 
       
  1392 	// Check RMobilePhone::AppendAPNName with a valid name returns KErrMMEtelAPNNameAPNListFull
       
  1393 	mobilePhone.AppendAPNName(appendAPNNameStatus, myAPnEntryPckg);
       
  1394 	ASSERT_EQUALS(WaitForRequestWithTimeOut(appendAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::AppendAPNName timed out"));
       
  1395 	ASSERT_TRUE(appendAPNNameStatus.Int()== KErrOverflow ||appendAPNNameStatus.Int()== KErrMMEtelAPNNameAPNListFull, _L("RMobilePhone::AppendAPNName returned with an error"));		
       
  1396 	
       
  1397 	// ===  Get the number of entries in the APN control list ===
       
  1398 
       
  1399 	// Check RMobilePhone::EnumerateAPNEntries returns same aIndex as before
       
  1400 	TUint32 checkIndex;
       
  1401 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, checkIndex);
       
  1402 	ASSERT_EQUALS(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
  1403 	ASSERT_EQUALS(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
  1404 	ASSERT_EQUALS(checkIndex, storeIndex , _L("RMobilePhone::EnumerateAPNEntries did not return the same index"));		
       
  1405 	
       
  1406 		
       
  1407 	//
       
  1408 	// TEST END
       
  1409 	//
       
  1410 
       
  1411     StartCleanup();
       
  1412     
       
  1413     EnsureApnListIsEmptyL(mobilePhone);
       
  1414     
       
  1415     // Pop: 
       
  1416     // backup
       
  1417     // appendAPNNameStatus
       
  1418     // enumerateAPNEntriesStatus
       
  1419     CleanupStack::PopAndDestroy(3, &backup);
       
  1420 			
       
  1421 	return TestStepResult();
       
  1422 	}
       
  1423 
       
  1424 TPtrC CCTSYIntegrationTestAPNControlList0008::GetTestStepName()
       
  1425 /**
       
  1426  * @return The test step name.
       
  1427  */
       
  1428 	{
       
  1429 	return _L("CCTSYIntegrationTestAPNControlList0008");
       
  1430 	}
       
  1431 
       
  1432 
       
  1433 
       
  1434 CCTSYIntegrationTestAPNControlList0009::CCTSYIntegrationTestAPNControlList0009(CEtelSessionMgr& aEtelSessionMgr)
       
  1435 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
  1436 /**
       
  1437  * Constructor.
       
  1438  */
       
  1439 	{
       
  1440 	SetTestStepName(CCTSYIntegrationTestAPNControlList0009::GetTestStepName());
       
  1441 	}
       
  1442 
       
  1443 CCTSYIntegrationTestAPNControlList0009::~CCTSYIntegrationTestAPNControlList0009()
       
  1444 /**
       
  1445  * Destructor.
       
  1446  */
       
  1447 	{
       
  1448 	}
       
  1449 
       
  1450 TVerdict CCTSYIntegrationTestAPNControlList0009::doTestStepL()
       
  1451 /**
       
  1452  * @SYMTestCaseID BA-CTSY-INT-ACL-0009
       
  1453  * @SYMFssID BA/CTSY/ACL-0009
       
  1454  * @SYMTestCaseDesc Activate a context when APN is not in the APN Control List.
       
  1455  * @SYMTestPriority High
       
  1456  * @SYMTestActions RPacketContext::NotifyStatusChange, RPacketContext::Activate, RPacketService::GetStatus, RPacketContext::GetLastErrorCause
       
  1457  * @SYMTestExpectedResults Pass - Context cannot be activated.
       
  1458  * @SYMTestType CIT
       
  1459  * @SYMTestCaseDependencies live/manual
       
  1460  *
       
  1461  * Reason for test: Verify context does not activate.
       
  1462  *
       
  1463  * @return - TVerdict code
       
  1464  */
       
  1465 	{
       
  1466 
       
  1467 	//
       
  1468 	// SET UP
       
  1469 	//
       
  1470 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1471   	
       
  1472   	DisplayUserInteractionPromptL(KPrompt); // 30 seconds
       
  1473 	 	
       
  1474 	// Get packet service
       
  1475 	RPacketService& packetService = iEtelSessionMgr.GetPacketServiceL(KMainServer, KMainPhone, KMainPacketService);
       
  1476 	
       
  1477 	// Registered with the network
       
  1478  	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, 
       
  1479 			_L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
  1480 	
       
  1481 	// Ensure phone is attached to packet service. 
       
  1482 	RPacketService::TStatus packetStatus;
       
  1483 	CHECK_EQUALS_L(packetService.GetStatus(packetStatus), KErrNone, _L("RPacketService::GetStatus returned with an error"));
       
  1484 	TExtEtelRequestStatus attachStatus(packetService, EPacketAttach);
       
  1485 	CleanupStack::PushL(attachStatus);
       
  1486 	if(packetStatus==RPacketService::EStatusUnattached)
       
  1487 		{
       
  1488 		packetService.Attach(attachStatus);
       
  1489 		CHECK_EQUALS_L(WaitForRequestWithTimeOut(attachStatus, ETimeMedium), KErrNone,				
       
  1490 							_L("PacketService::Attach timed out"))
       
  1491 		CHECK_EQUALS_L(attachStatus.Int(), KErrNone,				
       
  1492 							_L("RPacketService::Attach returned an error"))	
       
  1493 	
       
  1494 		}
       
  1495 		
       
  1496 	// Ensure that the APN Control List service is enabled. 
       
  1497 	RMobilePhone::TAPNControlListServiceStatus serviceApnControlListStatus;
       
  1498 	TExtEtelRequestStatus getAPNControlListServiceStatus(mobilePhone, EMobilePhoneGetAPNControlListServiceStatus);
       
  1499 	CleanupStack::PushL(getAPNControlListServiceStatus);
       
  1500 	mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
  1501 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
  1502 	CHECK_EQUALS_L(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
  1503 	TExtEtelRequestStatus setAPNControlListServiceStatus(mobilePhone, EMobilePhoneSetAPNControlListServiceStatus);
       
  1504 	CleanupStack::PushL(setAPNControlListServiceStatus);
       
  1505 	if(serviceApnControlListStatus== RMobilePhone::EAPNControlListServiceDisabled)
       
  1506 		{	
       
  1507 		iSimTestHelper.VerifyPin2L(mobilePhone,iNetworkTestHelper);
       
  1508 		serviceApnControlListStatus=RMobilePhone::EAPNControlListServiceEnabled;
       
  1509 		mobilePhone.SetAPNControlListServiceStatus(setAPNControlListServiceStatus, serviceApnControlListStatus);
       
  1510 		CHECK_EQUALS_L(WaitForRequestWithTimeOut(setAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus timed out"));
       
  1511 		CHECK_EQUALS_L(setAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus returned with an error"));		
       
  1512 			
       
  1513 		// Get the APN Contol List Service Status again
       
  1514 		mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
  1515 		CHECK_EQUALS_L(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
  1516 		CHECK_EQUALS_L(getAPNControlListServiceStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus returned with an error"));		
       
  1517 		}
       
  1518 	
       
  1519 	CHECK_EQUALS_L(serviceApnControlListStatus, RMobilePhone::EAPNControlListServiceEnabled, _L("RMobilePhone::GetAPNControlListServiceStatus did not return EAPNControlListServiceEnabled status"));		
       
  1520 	
       
  1521 	//
       
  1522 	// SET UP END
       
  1523 	//
       
  1524 	
       
  1525 	StartTest();
       
  1526 	
       
  1527 	//
       
  1528 	// TEST START
       
  1529 	//
       
  1530 		
       
  1531 	// Open a new primary context.
       
  1532 	RPacketContext& packetContext = iEtelSessionMgr.GetPrimaryPacketContextL(
       
  1533 											KMainServer,
       
  1534 											KMainPhone,
       
  1535 											KMainPacketService,
       
  1536 											KPrimaryPacketContext1); 
       
  1537 
       
  1538 	
       
  1539 	// Set a valid context config with RPacketContext::SetConfig with iAccessPointName = an APN which is not in the control list  
       
  1540 	RPacketContext::TContextConfigGPRS config;
       
  1541 	TBuf16<20> name = _L("APN3");
       
  1542 	config.iAccessPointName.Copy(name);
       
  1543 	TPckg<RPacketContext::TContextConfigGPRS> configPk(config);
       
  1544 	TExtEtelRequestStatus setConfigStatus(packetContext, EPacketContextSetConfig);	
       
  1545 	CleanupStack::PushL(setConfigStatus);
       
  1546 	packetContext.SetConfig(setConfigStatus, configPk);
       
  1547 	ASSERT_EQUALS(WaitForRequestWithTimeOut(setConfigStatus, ETimeLong), KErrNone, 
       
  1548 					_L("RPacketContext::SetConfig timed out"));
       
  1549 	ASSERT_EQUALS(setConfigStatus.Int(), KErrNone,
       
  1550 					_L("RPacketContext::SetConfig returned with error status."));
       
  1551 					
       
  1552 	// Post notification for context's status change
       
  1553 	TExtEtelRequestStatus notifyContextStChStatus(packetContext, EPacketContextNotifyStatusChange);
       
  1554 	CleanupStack::PushL(notifyContextStChStatus);
       
  1555 	RPacketContext::TContextStatus packetContextStatus;
       
  1556 	packetContext.NotifyStatusChange(notifyContextStChStatus, packetContextStatus);
       
  1557 
       
  1558 
       
  1559 	// Activate packet context with RPacketContext::Activate 
       
  1560 	TExtEtelRequestStatus contextActivateStatus(packetContext, EPacketContextActivate);
       
  1561 	CleanupStack::PushL(contextActivateStatus);
       
  1562 	packetContext.Activate(contextActivateStatus);
       
  1563 
       
  1564 	// ===  Check context and service statuses ===
       
  1565 
       
  1566 	// Check RPacketContext::NotifyStatusChange completes with EStatusActivating -> EStatusInactive
       
  1567 	RPacketContext::TContextStatus expectedPacketContextStatus = RPacketContext::EStatusActivating;
       
  1568 	iPacketServiceHelper.WaitForPacketContextNotifyStatusChange(
       
  1569 				packetContext,
       
  1570 				notifyContextStChStatus,
       
  1571 				packetContextStatus, 
       
  1572 				expectedPacketContextStatus,
       
  1573 				KErrNone);
       
  1574 	
       
  1575 	packetContext.NotifyStatusChange(notifyContextStChStatus, packetContextStatus);
       
  1576 	
       
  1577 	expectedPacketContextStatus = RPacketContext::EStatusInactive;
       
  1578 	iPacketServiceHelper.WaitForPacketContextNotifyStatusChange(
       
  1579 				packetContext,
       
  1580 				notifyContextStChStatus,
       
  1581 				packetContextStatus, 
       
  1582 				expectedPacketContextStatus,
       
  1583 				KErrNone);
       
  1584 
       
  1585 	// Check RPacketContext::GetStatus returns EStatusInactive
       
  1586 	ASSERT_EQUALS(packetContext.GetStatus(packetContextStatus), KErrNone, _L("RPacketContext::GetStatus returned with an error."));
       
  1587 	ASSERT_EQUALS(packetContextStatus, RPacketContext::EStatusInactive, _L("RPacketContext::GetStatus returns incorrect status."));
       
  1588 
       
  1589 	// Check TRequestStatus used for RPacketContext::Activate != KErrNone
       
  1590 	ASSERT_EQUALS(WaitForRequestWithTimeOut(contextActivateStatus, ETimeLong), KErrNone, 
       
  1591 					_L("RPacketContext::Activate timed out."));
       
  1592 	ASSERT_EQUALS(contextActivateStatus.Int(), KErrNone,
       
  1593 					_L("RPacketContext::Activate returned with error status."));
       
  1594 
       
  1595 	// Check RPacketContext::GetLastErrorCause returns an error.
       
  1596 	TInt err;
       
  1597 	ASSERT_EQUALS(packetContext.GetLastErrorCause(err), KErrNone, _L("RPacketContext::GetLastErrorCause returned with an error"));
       
  1598 	ASSERT_TRUE(err!=KErrNone, _L("RPacketContext::GetLastErrorCause did not return an error via pass by reference argument "));
       
  1599 
       
  1600 	//
       
  1601 	// TEST END
       
  1602 	//
       
  1603 
       
  1604     StartCleanup();
       
  1605 	
       
  1606 	// PopAndDestroy:
       
  1607     // attachStatus
       
  1608 	// setAPNControlListServiceStatus
       
  1609 	// getAPNControlListServiceStatus
       
  1610 	// setConfigStatus
       
  1611 	// notifyContextStChStatus
       
  1612 	// contextActivateStatus
       
  1613 	
       
  1614 	CleanupStack::PopAndDestroy(6, &attachStatus);
       
  1615 	return TestStepResult();
       
  1616 	}
       
  1617 
       
  1618 TPtrC CCTSYIntegrationTestAPNControlList0009::GetTestStepName()
       
  1619 /**
       
  1620  * @return The test step name.
       
  1621  */
       
  1622 	{
       
  1623 	return _L("CCTSYIntegrationTestAPNControlList0009");
       
  1624 	}
       
  1625 
       
  1626 
       
  1627 
       
  1628 CCTSYIntegrationTestAPNControlList0010::CCTSYIntegrationTestAPNControlList0010(CEtelSessionMgr& aEtelSessionMgr)
       
  1629 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
  1630 /**
       
  1631  * Constructor.
       
  1632  */
       
  1633 	{
       
  1634 	SetTestStepName(CCTSYIntegrationTestAPNControlList0010::GetTestStepName());
       
  1635 	}
       
  1636 
       
  1637 CCTSYIntegrationTestAPNControlList0010::~CCTSYIntegrationTestAPNControlList0010()
       
  1638 /**
       
  1639  * Destructor.
       
  1640  */
       
  1641 	{
       
  1642 	}
       
  1643 
       
  1644 TVerdict CCTSYIntegrationTestAPNControlList0010::doTestStepL()
       
  1645 /**
       
  1646  * @SYMTestCaseID BA-CTSY-INT-ACL-0010
       
  1647  * @SYMFssID BA/CTSY/ACL-0010
       
  1648  * @SYMTestCaseDesc Cancel get APN Control List status
       
  1649  * @SYMTestPriority High
       
  1650  * @SYMTestActions 
       
  1651  * @SYMTestExpectedResults Pass - KErrCancel
       
  1652  * @SYMTestType CIT
       
  1653  * @SYMTestCaseDependencies live/automatic
       
  1654  *
       
  1655  * Reason for test: Verify request is cancelled.
       
  1656  *
       
  1657  * @return - TVerdict code
       
  1658  */
       
  1659 	{
       
  1660 
       
  1661 	//
       
  1662 	// SET UP
       
  1663 	//
       
  1664 	
       
  1665 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1666 	
       
  1667 	//
       
  1668 	// SET UP END
       
  1669 	//
       
  1670 	
       
  1671 	StartTest();
       
  1672 	
       
  1673 	//
       
  1674 	// TEST START
       
  1675 	//
       
  1676 	
       
  1677 	// Call RMobilePhone::GetAPNControlListServiceStatus 
       
  1678 	RMobilePhone::TAPNControlListServiceStatus serviceApnControlListStatus;
       
  1679 	TExtEtelRequestStatus getAPNControlListServiceStatus(mobilePhone, EMobilePhoneGetAPNControlListServiceStatus);
       
  1680 	CleanupStack::PushL(getAPNControlListServiceStatus);
       
  1681 	mobilePhone.GetAPNControlListServiceStatus(getAPNControlListServiceStatus, serviceApnControlListStatus);
       
  1682 	
       
  1683 	// Cancel request with RTelSubSessionBase.CancelAsyncRequest( EMobilePhoneGetAPNControlListServiceStatus ); 
       
  1684 	mobilePhone.CancelAsyncRequest(EMobilePhoneGetAPNControlListServiceStatus);
       
  1685 	
       
  1686 	// Check request completes with KErrCancel or KErrNone
       
  1687 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNControlListServiceStatus timed out"));
       
  1688 	ASSERT_TRUE(((getAPNControlListServiceStatus.Int()== KErrCancel) || (getAPNControlListServiceStatus.Int()== KErrNone)) , _L("RMobilePhone::GetAPNControlListServiceStatus request could not be cancelled"))	;	
       
  1689 	
       
  1690 	//
       
  1691 	// TEST END
       
  1692 	//
       
  1693 
       
  1694     StartCleanup();
       
  1695 	
       
  1696 	CleanupStack::PopAndDestroy(&getAPNControlListServiceStatus);
       
  1697 	
       
  1698 	return TestStepResult();
       
  1699 	}
       
  1700 
       
  1701 TPtrC CCTSYIntegrationTestAPNControlList0010::GetTestStepName()
       
  1702 /**
       
  1703  * @return The test step name.
       
  1704  */
       
  1705 	{
       
  1706 	return _L("CCTSYIntegrationTestAPNControlList0010");
       
  1707 	}
       
  1708 
       
  1709 
       
  1710 
       
  1711 CCTSYIntegrationTestAPNControlList0011::CCTSYIntegrationTestAPNControlList0011(CEtelSessionMgr& aEtelSessionMgr)
       
  1712 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
  1713 /**
       
  1714  * Constructor.
       
  1715  */
       
  1716 	{
       
  1717 	SetTestStepName(CCTSYIntegrationTestAPNControlList0011::GetTestStepName());
       
  1718 	}
       
  1719 
       
  1720 CCTSYIntegrationTestAPNControlList0011::~CCTSYIntegrationTestAPNControlList0011()
       
  1721 /**
       
  1722  * Destructor.
       
  1723  */
       
  1724 	{
       
  1725 	}
       
  1726 
       
  1727 TVerdict CCTSYIntegrationTestAPNControlList0011::doTestStepL()
       
  1728 /**
       
  1729  * @SYMTestCaseID BA-CTSY-INT-ACL-0011
       
  1730  * @SYMFssID BA/CTSY/ACL-0011
       
  1731  * @SYMTestCaseDesc Cancel set APN Control List status
       
  1732  * @SYMTestPriority High
       
  1733  * @SYMTestActions 
       
  1734  * @SYMTestExpectedResults Pass - KErrCancel
       
  1735  * @SYMTestType CIT
       
  1736  * @SYMTestCaseDependencies live/automatic
       
  1737  *
       
  1738  * Reason for test: Verify request is cancelled.
       
  1739  *
       
  1740  * @return - TVerdict code
       
  1741  */
       
  1742 	{
       
  1743 
       
  1744 	//
       
  1745 	// SET UP
       
  1746 	//
       
  1747 
       
  1748 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1749 
       
  1750 	//
       
  1751 	// SET UP END
       
  1752 	//
       
  1753 	
       
  1754 	StartTest();
       
  1755 	
       
  1756 	//
       
  1757 	// TEST START
       
  1758 	//
       
  1759 	
       
  1760 	// Call RMobilePhone::SetAPNControlListServiceStatus 
       
  1761 	RMobilePhone::TAPNControlListServiceStatus serviceApnControlListStatus=RMobilePhone::EAPNControlListServiceEnabled;
       
  1762 	TExtEtelRequestStatus setAPNControlListServiceStatus(mobilePhone, EMobilePhoneSetAPNControlListServiceStatus);
       
  1763 	CleanupStack::PushL(setAPNControlListServiceStatus);
       
  1764 	mobilePhone.SetAPNControlListServiceStatus(setAPNControlListServiceStatus, serviceApnControlListStatus);
       
  1765 	
       
  1766 	// Cancel request with RTelSubSessionBase.CancelAsyncRequest( EMobilePhoneSetAPNControlListServiceStatus ); 
       
  1767 	mobilePhone.CancelAsyncRequest(EMobilePhoneSetAPNControlListServiceStatus);
       
  1768 	
       
  1769 	// Check request completes with KErrCancel or KErrNone.
       
  1770 	ASSERT_EQUALS(WaitForRequestWithTimeOut(setAPNControlListServiceStatus, ETimeMedium),KErrNone, _L("RMobilePhone::SetAPNControlListServiceStatus timed out"));
       
  1771 	ASSERT_TRUE(((setAPNControlListServiceStatus.Int()== KErrCancel) || (setAPNControlListServiceStatus.Int()== KErrNone)) , _L("RMobilePhone::SetAPNControlListServiceStatus request could not be cancelled"));		
       
  1772 			
       
  1773 	//
       
  1774 	// TEST END
       
  1775 	//
       
  1776 
       
  1777     StartCleanup();
       
  1778 	
       
  1779 	CleanupStack::PopAndDestroy(&setAPNControlListServiceStatus);
       
  1780 	
       
  1781 	return TestStepResult();
       
  1782 	}
       
  1783 
       
  1784 TPtrC CCTSYIntegrationTestAPNControlList0011::GetTestStepName()
       
  1785 /**
       
  1786  * @return The test step name.
       
  1787  */
       
  1788 	{
       
  1789 	return _L("CCTSYIntegrationTestAPNControlList0011");
       
  1790 	}
       
  1791 
       
  1792 
       
  1793 
       
  1794 CCTSYIntegrationTestAPNControlList0012::CCTSYIntegrationTestAPNControlList0012(CEtelSessionMgr& aEtelSessionMgr)
       
  1795 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
  1796 /**
       
  1797  * Constructor.
       
  1798  */
       
  1799 	{
       
  1800 	SetTestStepName(CCTSYIntegrationTestAPNControlList0012::GetTestStepName());
       
  1801 	}
       
  1802 
       
  1803 CCTSYIntegrationTestAPNControlList0012::~CCTSYIntegrationTestAPNControlList0012()
       
  1804 /**
       
  1805  * Destructor.
       
  1806  */
       
  1807 	{
       
  1808 	}
       
  1809 
       
  1810 TVerdict CCTSYIntegrationTestAPNControlList0012::doTestStepL()
       
  1811 /**
       
  1812  * @SYMTestCaseID BA-CTSY-INT-ACL-0012
       
  1813  * @SYMFssID BA/CTSY/ACL-0012
       
  1814  * @SYMTestCaseDesc Cancel enumerating the entries from the APN Control List.
       
  1815  * @SYMTestPriority High
       
  1816  * @SYMTestActions 
       
  1817  * @SYMTestExpectedResults Pass - KErrCancel
       
  1818  * @SYMTestType CIT
       
  1819  * @SYMTestCaseDependencies live/automatic
       
  1820  *
       
  1821  * Reason for test: Verify request is cancelled.
       
  1822  *
       
  1823  * @return - TVerdict code
       
  1824  */
       
  1825 	{
       
  1826 
       
  1827 	//
       
  1828 	// SET UP
       
  1829 	//
       
  1830 
       
  1831 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);	
       
  1832 	
       
  1833 	//
       
  1834 	// SET UP END
       
  1835 	//
       
  1836 	
       
  1837 	StartTest();
       
  1838 	
       
  1839 	//
       
  1840 	// TEST START
       
  1841 	//
       
  1842 
       
  1843 	// Call RMobilePhone::EnumerateAPNEntries
       
  1844 	TUint32 index= 0;
       
  1845 	TExtEtelRequestStatus enumerateAPNEntriesStatus(mobilePhone, EMobilePhoneEnumerateAPNEntries);
       
  1846 	CleanupStack::PushL(enumerateAPNEntriesStatus);
       
  1847 	mobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, index);
       
  1848 	
       
  1849 	// Cancel request with RTelSubSession::CancelAsyncRequest( EMobilePhoneEnumerateAPNEntries ); 
       
  1850 	mobilePhone.CancelAsyncRequest(EMobilePhoneEnumerateAPNEntries);
       
  1851 	
       
  1852 	
       
  1853 	// Check request completes with KErrCancel or KErrNone.
       
  1854 	ASSERT_EQUALS(WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
  1855 	ASSERT_TRUE(((enumerateAPNEntriesStatus.Int()== KErrCancel) || (enumerateAPNEntriesStatus.Int()== KErrNone)) , _L("RMobilePhone::EnumerateAPNEntries request could not be cancelled"));		
       
  1856 		
       
  1857 	//
       
  1858 	// TEST END
       
  1859 	//
       
  1860 
       
  1861     StartCleanup();
       
  1862 	
       
  1863 	CleanupStack::PopAndDestroy(&enumerateAPNEntriesStatus);
       
  1864 		
       
  1865 	return TestStepResult();
       
  1866 	}
       
  1867 
       
  1868 TPtrC CCTSYIntegrationTestAPNControlList0012::GetTestStepName()
       
  1869 /**
       
  1870  * @return The test step name.
       
  1871  */
       
  1872 	{
       
  1873 	return _L("CCTSYIntegrationTestAPNControlList0012");
       
  1874 	}
       
  1875 
       
  1876 
       
  1877 
       
  1878 CCTSYIntegrationTestAPNControlList0013::CCTSYIntegrationTestAPNControlList0013(CEtelSessionMgr& aEtelSessionMgr)
       
  1879 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
  1880 /**
       
  1881  * Constructor.
       
  1882  */
       
  1883 	{
       
  1884 	SetTestStepName(CCTSYIntegrationTestAPNControlList0013::GetTestStepName());
       
  1885 	}
       
  1886 
       
  1887 CCTSYIntegrationTestAPNControlList0013::~CCTSYIntegrationTestAPNControlList0013()
       
  1888 /**
       
  1889  * Destructor.
       
  1890  */
       
  1891 	{
       
  1892 	}
       
  1893 
       
  1894 TVerdict CCTSYIntegrationTestAPNControlList0013::doTestStepL()
       
  1895 /**
       
  1896  * @SYMTestCaseID BA-CTSY-INT-ACL-0013
       
  1897  * @SYMFssID BA/CTSY/ACL-0013
       
  1898  * @SYMTestCaseDesc Cancel reading entries from the APN Control List
       
  1899  * @SYMTestPriority High
       
  1900  * @SYMTestActions 
       
  1901  * @SYMTestExpectedResults Pass - KErrCancel
       
  1902  * @SYMTestType CIT
       
  1903  * @SYMTestCaseDependencies live/automatic
       
  1904  *
       
  1905  * Reason for test: Verify request is cancelled.
       
  1906  *
       
  1907  * @return - TVerdict code
       
  1908  */
       
  1909 	{
       
  1910 
       
  1911 	//
       
  1912 	// SET UP
       
  1913 	//
       
  1914 
       
  1915 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);	
       
  1916 
       
  1917 	//
       
  1918 	// SET UP END
       
  1919 	//
       
  1920 	
       
  1921 	StartTest();
       
  1922 	
       
  1923 	//
       
  1924 	// TEST START
       
  1925 	//
       
  1926 	
       
  1927 	// Call RMobilePhone::GetAPNname
       
  1928 	TUint32 index=0;
       
  1929 	RMobilePhone::TAPNEntryV3 myAPnEntry;
       
  1930 	RMobilePhone::TAPNEntryV3Pckg myAPnEntryPckg(myAPnEntry);
       
  1931 	TExtEtelRequestStatus getAPNnameStatus(mobilePhone, EMobilePhoneGetAPNname);
       
  1932 	CleanupStack::PushL(getAPNnameStatus);
       
  1933 	mobilePhone.GetAPNname(getAPNnameStatus,index, myAPnEntryPckg);
       
  1934 	
       
  1935 	// Cancel request with RTelSubSession::CancelAsyncRequest( EMobilePhoneGetAPNname ); 
       
  1936 	mobilePhone.CancelAsyncRequest(EMobilePhoneGetAPNname);
       
  1937 	
       
  1938 	// Check request completes with KErrCancel or KErrNone.
       
  1939 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getAPNnameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNname timed out"));
       
  1940 	ASSERT_TRUE(((getAPNnameStatus.Int()== KErrCancel) || (getAPNnameStatus.Int()== KErrNone)) , _L("RMobilePhone::GetAPNname request could not be cancelled"));		
       
  1941 		
       
  1942 	//
       
  1943 	// TEST END
       
  1944 	//
       
  1945 
       
  1946     StartCleanup();
       
  1947     
       
  1948 	CleanupStack::PopAndDestroy(&getAPNnameStatus);
       
  1949 	
       
  1950 	return TestStepResult();
       
  1951 	}
       
  1952 
       
  1953 TPtrC CCTSYIntegrationTestAPNControlList0013::GetTestStepName()
       
  1954 /**
       
  1955  * @return The test step name.
       
  1956  */
       
  1957 	{
       
  1958 	return _L("CCTSYIntegrationTestAPNControlList0013");
       
  1959 	}
       
  1960 
       
  1961 
       
  1962 
       
  1963 CCTSYIntegrationTestAPNControlList0014::CCTSYIntegrationTestAPNControlList0014(CEtelSessionMgr& aEtelSessionMgr)
       
  1964 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
  1965 /**
       
  1966  * Constructor.
       
  1967  */
       
  1968 	{
       
  1969 	SetTestStepName(CCTSYIntegrationTestAPNControlList0014::GetTestStepName());
       
  1970 	}
       
  1971 
       
  1972 CCTSYIntegrationTestAPNControlList0014::~CCTSYIntegrationTestAPNControlList0014()
       
  1973 /**
       
  1974  * Destructor.
       
  1975  */
       
  1976 	{
       
  1977 	}
       
  1978 
       
  1979 TVerdict CCTSYIntegrationTestAPNControlList0014::doTestStepL()
       
  1980 /**
       
  1981  * @SYMTestCaseID BA-CTSY-INT-ACL-0014
       
  1982  * @SYMFssID BA/CTSY/ACL-0014
       
  1983  * @SYMTestCaseDesc Cancel adding an entry to the APN Control List
       
  1984  * @SYMTestPriority High
       
  1985  * @SYMTestActions 
       
  1986  * @SYMTestExpectedResults Pass - KErrCancel
       
  1987  * @SYMTestType CIT
       
  1988  * @SYMTestCaseDependencies live/automatic
       
  1989  *
       
  1990  * Reason for test: Verify request is cancelled.
       
  1991  *
       
  1992  * @return - TVerdict code
       
  1993  */
       
  1994 	{
       
  1995 
       
  1996 	//
       
  1997 	// SET UP
       
  1998 	//
       
  1999 
       
  2000 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);		
       
  2001 
       
  2002 	//
       
  2003 	// SET UP END
       
  2004 	//
       
  2005 	
       
  2006 	StartTest();
       
  2007 	
       
  2008 	//
       
  2009 	// TEST START
       
  2010 	//
       
  2011 	
       
  2012 	// Call RMobilePhone::AppendAPNName 
       
  2013 	RMobilePhone::TAPNEntryV3 myAPnEntry;
       
  2014 	TBuf16<20> name = _L("WiFi");
       
  2015 	myAPnEntry.iApn.Copy(name);
       
  2016 	RMobilePhone::TAPNEntryV3Pckg myAPnEntryPckg(myAPnEntry);
       
  2017 	TExtEtelRequestStatus appendAPNNameStatus(mobilePhone, EMobilePhoneAppendAPNName);
       
  2018 	CleanupStack::PushL(appendAPNNameStatus);
       
  2019 	mobilePhone.AppendAPNName(appendAPNNameStatus, myAPnEntryPckg);
       
  2020 	
       
  2021 	// Cancel request with RTelSubSession::CancelAsyncRequest( EMobilePhoneAppendAPNName ); 
       
  2022 	mobilePhone.CancelAsyncRequest(EMobilePhoneAppendAPNName);
       
  2023 	
       
  2024 	// Check request completes with KErrCancel or KErrNone.
       
  2025 	ASSERT_EQUALS(WaitForRequestWithTimeOut(appendAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::AppendAPNName timed out"));
       
  2026 	ASSERT_TRUE(((appendAPNNameStatus.Int()== KErrCancel) || (appendAPNNameStatus.Int()== KErrNone)) , _L("RMobilePhone::AppendAPNName request could not be cancelled"));		
       
  2027 	
       
  2028 	//
       
  2029 	// TEST END
       
  2030 	//
       
  2031 
       
  2032     StartCleanup();
       
  2033 	
       
  2034 	CleanupStack::PopAndDestroy(&appendAPNNameStatus);
       
  2035 	
       
  2036 	return TestStepResult();
       
  2037 	}
       
  2038 
       
  2039 TPtrC CCTSYIntegrationTestAPNControlList0014::GetTestStepName()
       
  2040 /**
       
  2041  * @return The test step name.
       
  2042  */
       
  2043 	{
       
  2044 	return _L("CCTSYIntegrationTestAPNControlList0014");
       
  2045 	}
       
  2046 
       
  2047 
       
  2048 
       
  2049 CCTSYIntegrationTestAPNControlList0015::CCTSYIntegrationTestAPNControlList0015(CEtelSessionMgr& aEtelSessionMgr)
       
  2050 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
  2051 /**
       
  2052  * Constructor.
       
  2053  */
       
  2054 	{
       
  2055 	SetTestStepName(CCTSYIntegrationTestAPNControlList0015::GetTestStepName());
       
  2056 	}
       
  2057 
       
  2058 CCTSYIntegrationTestAPNControlList0015::~CCTSYIntegrationTestAPNControlList0015()
       
  2059 /**
       
  2060  * Destructor.
       
  2061  */
       
  2062 	{
       
  2063 	}
       
  2064 
       
  2065 TVerdict CCTSYIntegrationTestAPNControlList0015::doTestStepL()
       
  2066 /**
       
  2067  * @SYMTestCaseID BA-CTSY-INT-ACL-0015
       
  2068  * @SYMFssID BA/CTSY/ACL-0015
       
  2069  * @SYMTestCaseDesc Cancel deleting an entry from the APN Control List
       
  2070  * @SYMTestPriority High
       
  2071  * @SYMTestActions 
       
  2072  * @SYMTestExpectedResults Pass - KErrCancel
       
  2073  * @SYMTestType CIT
       
  2074  * @SYMTestCaseDependencies live/automatic
       
  2075  *
       
  2076  * Reason for test: Verify request is cancelled.
       
  2077  *
       
  2078  * @return - TVerdict code
       
  2079  */
       
  2080 	{
       
  2081 
       
  2082 	//
       
  2083 	// SET UP
       
  2084 	//
       
  2085 
       
  2086 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);		
       
  2087 
       
  2088 	//
       
  2089 	// SET UP END
       
  2090 	//
       
  2091 	
       
  2092 	StartTest();
       
  2093 	
       
  2094 	//
       
  2095 	// TEST START
       
  2096 	//
       
  2097 
       
  2098 	// Call RMobilePhone::DeleteAPNName
       
  2099 	TUint32 index=0;
       
  2100 	TExtEtelRequestStatus deleteAPNNameStatus(mobilePhone, EMobilePhoneDeleteAPNName);
       
  2101 	CleanupStack::PushL(deleteAPNNameStatus);
       
  2102 	mobilePhone.DeleteAPNName(deleteAPNNameStatus, index);
       
  2103 	
       
  2104 	// Cancel request with RTelSubSession::CancelAsyncRequest( EMobilePhoneDeleteAPNName ); 
       
  2105 	mobilePhone.CancelAsyncRequest(EMobilePhoneDeleteAPNName);
       
  2106 	
       
  2107 	// Check request completes with KErrCancel or KErrNone.
       
  2108 	ASSERT_EQUALS(WaitForRequestWithTimeOut(deleteAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::DeleteAPNName timed out"));
       
  2109 	ASSERT_TRUE(((deleteAPNNameStatus.Int()== KErrCancel) || (deleteAPNNameStatus.Int()== KErrNone)) , _L("RMobilePhone::DeleteAPNName request could not be cancelled"));		
       
  2110 	//
       
  2111 	// TEST END
       
  2112 	//
       
  2113 
       
  2114     StartCleanup();
       
  2115    
       
  2116 	CleanupStack::PopAndDestroy(&deleteAPNNameStatus);
       
  2117 	
       
  2118 	return TestStepResult();
       
  2119 	}
       
  2120 
       
  2121 TPtrC CCTSYIntegrationTestAPNControlList0015::GetTestStepName()
       
  2122 /**
       
  2123  * @return The test step name.
       
  2124  */
       
  2125 	{
       
  2126 	return _L("CCTSYIntegrationTestAPNControlList0015");
       
  2127 	}
       
  2128 
       
  2129 
       
  2130 
       
  2131 CCTSYIntegrationTestAPNControlList0016::CCTSYIntegrationTestAPNControlList0016(CEtelSessionMgr& aEtelSessionMgr)
       
  2132 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
  2133 /**
       
  2134  * Constructor.
       
  2135  */
       
  2136 	{
       
  2137 	SetTestStepName(CCTSYIntegrationTestAPNControlList0016::GetTestStepName());
       
  2138 	}
       
  2139 
       
  2140 CCTSYIntegrationTestAPNControlList0016::~CCTSYIntegrationTestAPNControlList0016()
       
  2141 /**
       
  2142  * Destructor.
       
  2143  */
       
  2144 	{
       
  2145 	}
       
  2146 
       
  2147 TVerdict CCTSYIntegrationTestAPNControlList0016::doTestStepL()
       
  2148 /**
       
  2149  * @SYMTestCaseID BA-CTSY-INT-ACL-0016
       
  2150  * @SYMFssID BA/CTSY/ACL-0016
       
  2151  * @SYMTestCaseDesc Cancel notification of change in the APN control list
       
  2152  * @SYMTestPriority High
       
  2153  * @SYMTestActions 
       
  2154  * @SYMTestExpectedResults Pass - KErrCancel
       
  2155  * @SYMTestType CIT
       
  2156  * @SYMTestCaseDependencies live/automatic
       
  2157  *
       
  2158  * Reason for test: Verify request is cancelled.
       
  2159  *
       
  2160  * @return - TVerdict code
       
  2161  */
       
  2162 	{
       
  2163 
       
  2164 	//
       
  2165 	// SET UP
       
  2166 	//
       
  2167 
       
  2168 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);		
       
  2169 
       
  2170 	//
       
  2171 	// SET UP END
       
  2172 	//
       
  2173 	
       
  2174 	StartTest();
       
  2175 	
       
  2176 	//
       
  2177 	// TEST START
       
  2178 	//
       
  2179 		
       
  2180 	// Call RMobilePhone::NotifyAPNListChanged 
       
  2181 	TExtEtelRequestStatus notifyAPNListChangedStatus(mobilePhone, EMobilePhoneNotifyAPNListChanged);
       
  2182 	CleanupStack::PushL(notifyAPNListChangedStatus);
       
  2183 	mobilePhone.NotifyAPNListChanged(notifyAPNListChangedStatus); 
       
  2184 	
       
  2185 	// Cancel request with RTelSubSessionBase::CancelAsyncRequest(EMobilePhoneNotifyAPNListChanged) 
       
  2186 	mobilePhone.CancelAsyncRequest(EMobilePhoneNotifyAPNListChanged);
       
  2187 	
       
  2188 	// Check request completes with KErrCancel
       
  2189 	ASSERT_EQUALS(WaitForRequestWithTimeOut(notifyAPNListChangedStatus, ETimeMedium),KErrNone, _L("RMobilePhone::NotifyAPNListChanged timed out"));
       
  2190 	ASSERT_EQUALS(notifyAPNListChangedStatus.Int(), KErrCancel, _L("RMobilePhone::NotifyAPNListChanged request could not be cancelled"));		
       
  2191 	
       
  2192 	//
       
  2193 	// TEST END
       
  2194 	//
       
  2195 
       
  2196     StartCleanup();
       
  2197 	
       
  2198 	CleanupStack::PopAndDestroy(&notifyAPNListChangedStatus);
       
  2199 		
       
  2200 	return TestStepResult();
       
  2201 	}
       
  2202 
       
  2203 TPtrC CCTSYIntegrationTestAPNControlList0016::GetTestStepName()
       
  2204 /**
       
  2205  * @return The test step name.
       
  2206  */
       
  2207 	{
       
  2208 	return _L("CCTSYIntegrationTestAPNControlList0016");
       
  2209 	}
       
  2210 
       
  2211 
       
  2212 
       
  2213 CCTSYIntegrationTestAPNControlList0017::CCTSYIntegrationTestAPNControlList0017(CEtelSessionMgr& aEtelSessionMgr)
       
  2214 	: CCTSYIntegrationTestAPNControlListBase(aEtelSessionMgr)
       
  2215 /**
       
  2216  * Constructor.
       
  2217  */
       
  2218 	{
       
  2219 	SetTestStepName(CCTSYIntegrationTestAPNControlList0017::GetTestStepName());
       
  2220 	}
       
  2221 
       
  2222 CCTSYIntegrationTestAPNControlList0017::~CCTSYIntegrationTestAPNControlList0017()
       
  2223 /**
       
  2224  * Destructor.
       
  2225  */
       
  2226 	{
       
  2227 	}
       
  2228 
       
  2229 TVerdict CCTSYIntegrationTestAPNControlList0017::doTestStepL()
       
  2230 /**
       
  2231  * @SYMTestCaseID BA-CTSY-INT-ACL-0017
       
  2232  * @SYMFssID BA/CTSY/ACL-0017
       
  2233  * @SYMTestCaseDesc Cancel notification of change in the APN control list service status
       
  2234  * @SYMTestPriority High
       
  2235  * @SYMTestActions 
       
  2236  * @SYMTestExpectedResults Pass - KErrCancel
       
  2237  * @SYMTestType CIT
       
  2238  * @SYMTestCaseDependencies live/automatic
       
  2239  *
       
  2240  * Reason for test: Verify request is cancelled.
       
  2241  *
       
  2242  * @return - TVerdict code
       
  2243  */
       
  2244 	{
       
  2245 
       
  2246 	//
       
  2247 	// SET UP
       
  2248 	//
       
  2249 
       
  2250 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);			
       
  2251 
       
  2252 	//
       
  2253 	// SET UP END
       
  2254 	//
       
  2255 	
       
  2256 	StartTest();
       
  2257 	
       
  2258 	//
       
  2259 	// TEST START
       
  2260 	//
       
  2261 	
       
  2262 	// Call RMobilePhone::NotifyAPNControlListServiceStatusChange 
       
  2263 	RMobilePhone::TAPNControlListServiceStatus serviceApnControlListStatus;
       
  2264 	TExtEtelRequestStatus notifyAPNControlListServiceStatusChangeStatus(mobilePhone, EMobilePhoneNotifyAPNControlListServiceStatusChange);
       
  2265 	CleanupStack::PushL(notifyAPNControlListServiceStatusChangeStatus);
       
  2266 	mobilePhone.NotifyAPNControlListServiceStatusChange(notifyAPNControlListServiceStatusChangeStatus, serviceApnControlListStatus); 
       
  2267 		
       
  2268 	// Cancel request with RTelSubSessionBase::CancelAsyncRequest(EMobilePhoneNotifyAPNControlListServiceStatusChange) 
       
  2269 	mobilePhone.CancelAsyncRequest(EMobilePhoneNotifyAPNControlListServiceStatusChange);
       
  2270 		
       
  2271 	// Check request completes with KErrCancel
       
  2272 	ASSERT_EQUALS(WaitForRequestWithTimeOut(notifyAPNControlListServiceStatusChangeStatus, ETimeMedium),KErrNone, _L("RMobilePhone::NotifyAPNControlListServiceStatusChange timed out"));
       
  2273 	ASSERT_EQUALS(notifyAPNControlListServiceStatusChangeStatus.Int(), KErrCancel, _L("RMobilePhone::NotifyAPNControlListServiceStatusChange could not be cancelled"));		
       
  2274 	
       
  2275 	//
       
  2276 	// TEST END
       
  2277 	//
       
  2278 
       
  2279     StartCleanup();
       
  2280 	CleanupStack::PopAndDestroy(&notifyAPNControlListServiceStatusChangeStatus);
       
  2281 	return TestStepResult();
       
  2282 	}
       
  2283 
       
  2284 TPtrC CCTSYIntegrationTestAPNControlList0017::GetTestStepName()
       
  2285 /**
       
  2286  * @return The test step name.
       
  2287  */
       
  2288 	{
       
  2289 	return _L("CCTSYIntegrationTestAPNControlList0017");
       
  2290 	}
       
  2291 TBackupAPNList::TBackupAPNList(CCTSYIntegrationTestSuiteStepBase &aTestStep,
       
  2292 		RMobilePhone &aMobilePhone) : TTsyTestHelperBase(aTestStep) ,iMobilePhone(aMobilePhone)
       
  2293 /*
       
  2294 * Constructor
       
  2295 * @param aBase pointer to the test.
       
  2296 * @param aMobilePhone reference to a Mobile Phone session
       
  2297 *
       
  2298 */
       
  2299 	{
       
  2300 	}
       
  2301 TBool TBackupAPNList::BackupL(TInt &aListCount)
       
  2302 /*
       
  2303 * This function takes backup of the entries of APN Control list and return false if it fails
       
  2304 * @param aListCount refer to the number of entries in the list at the time of backup
       
  2305 * @return true if the backup was successful
       
  2306 *
       
  2307 */	
       
  2308 	{
       
  2309 	// Enumerater the entries of APN control List
       
  2310 	TUint32 index= 0;
       
  2311 	iValid=EFalse;
       
  2312 	TExtEtelRequestStatus enumerateAPNEntriesStatus(iMobilePhone, EMobilePhoneEnumerateAPNEntries);
       
  2313 	CleanupStack::PushL(enumerateAPNEntriesStatus);
       
  2314 	iMobilePhone.EnumerateAPNEntries(enumerateAPNEntriesStatus, index);
       
  2315 	CHECK_EQUALS_L(iTestStep.WaitForRequestWithTimeOut(enumerateAPNEntriesStatus, ETimeMedium),KErrNone, _L("RMobilePhone::EnumerateAPNEntries timed out"));
       
  2316 	CHECK_EQUALS_L(enumerateAPNEntriesStatus.Int(), KErrNone, _L("RMobilePhone::EnumerateAPNEntries returned with an error"));		
       
  2317 	iValid=ETrue;
       
  2318 	aListCount=(int)index;
       
  2319 	iListCount=aListCount;
       
  2320 	
       
  2321 	// Store the values of APN control list, so that they can be restored later
       
  2322 	RMobilePhone::TAPNEntryV3 myAPnEntry;
       
  2323 	RMobilePhone::TAPNEntryV3Pckg myAPnEntryPckg(myAPnEntry);
       
  2324 	TExtEtelRequestStatus getAPNnameStatus(iMobilePhone, EMobilePhoneGetAPNname);
       
  2325 	CleanupStack::PushL(getAPNnameStatus);
       
  2326 	for(TInt i=0;i<index; i++)
       
  2327 		{
       
  2328 		iMobilePhone.GetAPNname(getAPNnameStatus,i, myAPnEntryPckg);
       
  2329 		CHECK_EQUALS_L(iTestStep.WaitForRequestWithTimeOut(getAPNnameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::GetAPNname timed out"));
       
  2330 		CHECK_EQUALS_L(getAPNnameStatus.Int(), KErrNone, _L("RMobilePhone::GetAPNname returned with an error"));		
       
  2331 		CHECK_EQUALS_L(iEntryArray.Append(myAPnEntry), KErrNone, _L("RArray::Append could not append RMobilePhone::TAPNEntryV3 in array"));
       
  2332 		}
       
  2333 			
       
  2334 	// Pop:
       
  2335 	// enumerateAPNEntriesStatus
       
  2336 	// getAPNnameStatus
       
  2337 	CleanupStack::PopAndDestroy(2,&enumerateAPNEntriesStatus);
       
  2338 	
       
  2339 	return iValid;
       
  2340 	}
       
  2341 
       
  2342 void TBackupAPNList::DoCleanupL(TAny* aPtr)
       
  2343 /*
       
  2344 * This function is a static clean up function to be saved in the cleanup stack. It restores the saved entries.
       
  2345 *
       
  2346 * @param aPtr a pointer to a TBackupAPNList instance.
       
  2347 *
       
  2348 */	
       
  2349 	{
       
  2350 	TBackupAPNList* me = static_cast<TBackupAPNList*>(aPtr);
       
  2351 	me->CleanupL();
       
  2352 	}
       
  2353 
       
  2354 void TBackupAPNList::CleanupL()
       
  2355 /*
       
  2356 * This function restores the saved entries to the entries in the phone
       
  2357 *
       
  2358 */	
       
  2359 	{
       
  2360 	TExtEtelRequestStatus appendAPNNameStatus(iMobilePhone, EMobilePhoneAppendAPNName);
       
  2361 	CleanupStack::PushL(appendAPNNameStatus);
       
  2362 			
       
  2363 	for(TInt count=0; count<iListCount;count++)
       
  2364 			{
       
  2365 			RMobilePhone::TAPNEntryV3Pckg myAPnEntryPckg(iEntryArray[count]);
       
  2366 			iMobilePhone.AppendAPNName(appendAPNNameStatus, myAPnEntryPckg);
       
  2367 			CHECK_EQUALS_L(iTestStep.WaitForRequestWithTimeOut(appendAPNNameStatus, ETimeMedium),KErrNone, _L("RMobilePhone::AppendAPNName timed out"));
       
  2368 			CHECK_EQUALS_L(appendAPNNameStatus.Int(), KErrNone, _L("RMobilePhone::AppendAPNName returned with an error"));	
       
  2369 			}
       
  2370 						
       
  2371 	iEntryArray.Close();
       
  2372 	CleanupStack::PopAndDestroy(&appendAPNNameStatus);
       
  2373 	}
       
  2374 
       
  2375 TBackupAPNList::operator TCleanupItem()
       
  2376 /*
       
  2377 * This operator create a TCleanupItem to save a pointer to the DoCleanup static function and this in the cleanup stack
       
  2378 *
       
  2379 */	
       
  2380 	{
       
  2381 	return TCleanupItem(DoCleanupL,this);
       
  2382 	}
       
  2383 
       
  2384 
       
  2385 
       
  2386