telephonyserver/etelsimtoolkit/tetel/Te_EtelSat/te_etelsatpcmds1g.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2008-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 // The class definition of a TestExecute class for testing EtelSat
       
    15 // release 7 features.
       
    16 // 
       
    17 //
       
    18 
       
    19 #include "Te_EtelSatTestStepBase.h"
       
    20 #include "te_etelsatpcmds1g.h"
       
    21 
       
    22 CTestSatPCmds1g::CTestSatPCmds1g()
       
    23 	{ 
       
    24 	SetTestStepName(_L("TestSatPCmds1g"));
       
    25 	} // CTestSatPCmds1g::CTestSatPCmds1g
       
    26 
       
    27 
       
    28 enum TVerdict CTestSatPCmds1g::doTestStepL()
       
    29 /**
       
    30  * @SYMTestCaseID TEL-ETEL-NA-4009
       
    31  * @SYMREQ PREQ2064 
       
    32  * @SYMTestCaseDesc Test Release 7 EtelSat APIs
       
    33  * @SYMTestPriority High
       
    34  * @SYMTestActions Calls RSat Proactive Commands
       
    35  * @SYMTestExpectedResults Pass, client and TSY data is consistent.
       
    36  * @SYMTestType CT
       
    37  *
       
    38  * @return - TVerdict code
       
    39  */
       
    40 	{
       
    41 	INFO_PRINTF1(_L("SAT Release 7 tests"));
       
    42 	
       
    43 	TInt ret=phone.Open(iTelServer,DSATTSY_PHONE_NAME);
       
    44 	TEST(ret==KErrNone);
       
    45 
       
    46 	ret=sat.Open(phone);
       
    47 	TEST(ret==KErrNone);
       
    48 
       
    49 	//
       
    50 	// Test OPEN CHANNEL proactive command when UICC is in server mode
       
    51 	// Test RSat::TOpenUiccServerModeChannelV7
       
    52 	// TSAT379, TSAT380
       
    53 	//
       
    54 	
       
    55 	RSat::TOpenUiccServerModeChannelV7* openUiccServerModeChannelV7 = 
       
    56 		new (ELeave) RSat::TOpenUiccServerModeChannelV7;
       
    57 	CleanupStack::PushL(openUiccServerModeChannelV7);
       
    58 		
       
    59 	RSat::TOpenUiccServerModeChannelV7Pckg* openChannelV7Pckg = 
       
    60 		new (ELeave) RSat::TOpenUiccServerModeChannelV7Pckg(*openUiccServerModeChannelV7);
       
    61 	CleanupStack::PushL(openChannelV7Pckg);
       
    62 
       
    63 	// Assert default parameters are correct
       
    64 	TEST(openUiccServerModeChannelV7->ExtensionId() == RSat::KSatV7);
       
    65 	TEST(openUiccServerModeChannelV7->iLinkEst == RSat::ELinkEstablishmentNotSet);
       
    66 	TEST(openUiccServerModeChannelV7->iReconnectionMode == RSat::EReconnectionModeNotSet);
       
    67 	TEST(openUiccServerModeChannelV7->iBufferSize == 0);
       
    68 	TEST(openUiccServerModeChannelV7->iFrameId == 0);
       
    69 	TEST(openUiccServerModeChannelV7->iBearer.iType == RSat::EBearerTypeNotSet);
       
    70 	TEST(openUiccServerModeChannelV7->iSimMeInterface.iTransportProto == RSat::EProtocolNotSet);
       
    71 	TEST(openUiccServerModeChannelV7->iTextAttribute.iStatus == RSat::ETextAttributeNotSet);
       
    72 	
       
    73 	openUiccServerModeChannelV7->iPCmdType = DSATTSY_UICC_SERVER_MODE;
       
    74 	
       
    75 	TRequestStatus reqStatus = KErrNotFound;
       
    76 	sat.NotifyOpenChannelPCmd(reqStatus, *openChannelV7Pckg);
       
    77 	User::WaitForRequest(reqStatus);
       
    78 	TEST(reqStatus.Int()==KErrNone);
       
    79 	
       
    80 	// Assert version is correct
       
    81 	TEST(openUiccServerModeChannelV7->ExtensionId() == RSat::KSatV7);
       
    82 	
       
    83 	// Assert parameters from RSat::TOpenChannelBaseV2
       
    84 	TEST(openUiccServerModeChannelV7->PCmdNumber()==DSATTSY_OPEN_CHANNEL_NUMBER);
       
    85 	TEST(openUiccServerModeChannelV7->iPCmdType==DSATTSY_UICC_SERVER_MODE);
       
    86 	TEST(openUiccServerModeChannelV7->iLinkEst==DSATTSY_ON_DEMAND_ESTABLISHMENT);
       
    87 	TEST(openUiccServerModeChannelV7->iReconnectionMode==DSATTSY_AUTO_RECONNECTION);
       
    88 	TEST(openUiccServerModeChannelV7->iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
       
    89 	TEST(openUiccServerModeChannelV7->iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
       
    90 	TEST(openUiccServerModeChannelV7->iIconId.iIdentifier==DSATTSY_ICON_ID1);
       
    91 	TEST(openUiccServerModeChannelV7->iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
       
    92 	TEST(openUiccServerModeChannelV7->iBearer.iType==DSATTSY_CSD_BEARER_TYPE);
       
    93 	TEST(openUiccServerModeChannelV7->iBearer.iParams==DSATTSY_BEARER_PARAMS);
       
    94 	TEST(openUiccServerModeChannelV7->iBufferSize==DSATTSY_BUFFER_SIZE);
       
    95 	TEST(openUiccServerModeChannelV7->iSimMeInterface.iPrtNumber==DSATTSY_PORT_1);
       
    96 	TEST(openUiccServerModeChannelV7->iSimMeInterface.iTransportProto==DSATTSY_TCP_PROTO);
       
    97 	TEST(openUiccServerModeChannelV7->iDestinationAddress.iType==DSATTSY_IPV4_TYPE);
       
    98 	TEST(openUiccServerModeChannelV7->iDestinationAddress.iAddress==DSATTSY_ADDRESS);
       
    99 	
       
   100 	// Assert parameters from RSat::TOpenUiccServerModeChannelV7
       
   101 	RSat::TTextAttribute textAttribute;
       
   102 	textAttribute.iStatus = DSATTSY_TEXT_ATTRIBUTE_STATUS;
       
   103 	const TUint8 textAttributeData[DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH] = DSATTSY_TEXT_ATTRIBUTE_DATA;
       
   104 	textAttribute.iTextAttributeData.Append(textAttributeData, DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH);
       
   105 	TEST(openUiccServerModeChannelV7->iTextAttribute.iStatus == textAttribute.iStatus);
       
   106 	TEST(openUiccServerModeChannelV7->iTextAttribute.iTextAttributeData == textAttribute.iTextAttributeData);
       
   107 	
       
   108 	TEST(openUiccServerModeChannelV7->iFrameId == DSATTSYV6_FRAME_IDENTIFIER1);
       
   109 
       
   110 	INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd (RSat::TOpenUiccServerModeChannelV7)"), iTestCount++);
       
   111 	
       
   112 	// Open Channel Cancel
       
   113 	sat.NotifyOpenChannelPCmd(reqStatus,*openChannelV7Pckg);
       
   114 	sat.CancelAsyncRequest(ESatNotifyOpenChannelPCmd);
       
   115 	TEST(reqStatus.Int()==KErrCancel);
       
   116 
       
   117 	INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd Cancel (RSat::TOpenUiccServerModeChannelV7)"), iTestCount++);
       
   118 	
       
   119 	//
       
   120 	// Open Channel Terminal Rsp when response PCmd is RSat::EOpenChannelUiccServerMode
       
   121 	// TSAT381, TSAT382
       
   122 	//
       
   123 	
       
   124 	RSat::TOpenChannelRspV2* openChannelRsp = new (ELeave) RSat::TOpenChannelRspV2;
       
   125 	CleanupStack::PushL(openChannelRsp);
       
   126 	RSat::TOpenChannelRspV2Pckg* openChannelRspPckg = 
       
   127 		new (ELeave) RSat::TOpenChannelRspV2Pckg(*openChannelRsp);
       
   128 	CleanupStack::PushL(openChannelRspPckg);
       
   129 
       
   130 	openChannelRsp->SetPCmdNumber(DSATTSY_OPEN_CHANNEL_NUMBER);
       
   131 	openChannelRsp->iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS;
       
   132 	openChannelRsp->iInfoType=DSATTSY_PCMD_RSP_NO_INFO;
       
   133 	openChannelRsp->iAdditionalInfo=DSATTSY_NULL_BUF;
       
   134 	openChannelRsp->iBearer.iType=DSATTSY_CSD_BEARER_TYPE;
       
   135 	openChannelRsp->iBearer.iParams=DSATTSY_BEARER_PARAMS;
       
   136 	openChannelRsp->iBufferSize=DSATTSY_BUFFER_SIZE;
       
   137 
       
   138 	sat.TerminalRsp(reqStatus,RSat::EOpenChannelUiccServerMode, *openChannelRspPckg);
       
   139 	User::WaitForRequest(reqStatus);
       
   140 	TEST(reqStatus.Int()==KErrNone);
       
   141 	INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - Open Channel UICC server mode rsp"),iTestCount++);
       
   142 	
       
   143 	// Terminal response cancel
       
   144 	sat.TerminalRsp(reqStatus, RSat::EOpenChannelUiccServerMode, *openChannelRspPckg);
       
   145 	sat.CancelAsyncRequest(ESatTerminalRsp);
       
   146 	User::WaitForRequest(reqStatus);
       
   147 	TEST(reqStatus.Int()==KErrCancel);
       
   148 	INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - Open Channel cancel UICC server mode rsp"),iTestCount++);
       
   149 	
       
   150 	sat.Close();
       
   151 	phone.Close();
       
   152 	
       
   153 	CleanupStack::PopAndDestroy(4, openUiccServerModeChannelV7);
       
   154 	
       
   155 	return TestStepResult();
       
   156 	} // CTestSatPCmds1g::doTestStepL
       
   157